?? sbc2.m
字號(hào):
function sbc2;
% function of subbands coding;
% accomplish 2 subbands coding of voice-signals;
% DPCM use 8,4 bits within eath subbands ;
clear;close all;
%a=input('PLease input the bits vecter of the 2 subband-coding:');
a=input('請選擇長度為2的字長向量,任一字長不能小于4。\n字長向量為:');
[m,n]=size(a);
if n~=2||mean(a)<6||mean(a)>16
error('輸入錯(cuò)誤,重請?jiān)?\n你必須信息按照提示進(jìn)行輸入!','k');
%error('You have input a error number,try again!\nYou must input according the requirement!','k');
return;
end
tic;
[x1,fs,nb]=wavread('E:\MATLAB6p5\work\2006\manspeech.wav');
wc=3400;wc=wc/fs;[m,n]=size(x1);
y=lowpass(x1,wc);
wavwrite(x1,fs/3,nb,'E:\manspeech1.wav');
[x,fs,nb]=wavread('E:\manspeech1.wav');
[y1,y2]=bandpass(x);
y1=code(y1,a(1));
y2=code(y2,a(2));
dec=decode(y1,a(1));y1=dec;
dec=decode(y2,a(2));y2=dec;
[yy1,yy2]=restructor(y1,y2);
f=result(yy1,yy2);
f=f/max(f);
max(f);[m1,n1]=size(f),
wavwrite(f,fs*3,max(a),'E:\manspeech2.wav');
toc,error=abs(sum((f(1:m)-x1))/sum(x1))
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -