0

我编写有关子带编码和延迟信号的代码我的代码:

N = 18; %Setting the filter length
[h0,h1,g0,g1] = firpr2chfb(N-1,0.4); % MATLAB function for the analysis/synthesis       
num=20000;
[x,fs,nbits] = wavread('sub1.wav',num);
% Analysis part
% Level 1
x0 = filter(h0,1,x); % Lowpass filtering
x1 = filter(h1,1,x); % Highpass filtering 
v0 = downsample(x0,2); % Down-sampling, signal component v_0[n]
v1= downsample(x1,2); % Down-sampling, signal component v_1[n]
% Level 2
x2= v0; % Selecting the lowpass output from Level for the input to Level 
x02 = filter(h0,1,x2); % Lowpass filtering
x12 = filter(h1,1,x2); % Lowpass filtering
v02= downsample(x02,2); % Down-sampling
v12= downsample(x12,2); % Down-sampling
v2= v12; % Signal component v_2[n]
% Level 3
x3= v02; % Selecting the lowpass output from Level for the input to Level 
x03 = filter(h0,1,x3); % Lowpass filtering
x13 = filter(h1,1,x3); % Highpass filtering
v03= downsample(x03,2); % Down-sampling
v13= downsample(x13,2); % Down-sampling
v3= v13; % Signal component v_3[n]
w13= [zeros(size(1:N-1)) v3(1:length(v3)-(N-1))]

但我收到一个错误

==> octavesubband 在 40 w13= [zeros(size(1:N-1))v3(1:length(v3)-(N-1))]; %插入延迟z^(-(N-))

不知道修 请帮我。谢谢

4

1 回答 1

1

好吧,它首先查看您尝试连接的数组的大小:

>> size(v3(1:length(v3)-(N-1)))

ans =

        2483           1

>> size(zeros(size(1:N-1)))

ans =

     1    17

这建议您需要转置其中一个:

w13= [zeros(size(1:N-1))'; v3(1:length(v3)-(N-1))];

或者

w13= [zeros(size(1:N-1)) v3(1:length(v3)-(N-1))'];
于 2013-05-10T04:21:47.737 回答