Buffer processing with high and low pass filtering ?

1 回表示 (過去 30 日間)
I Made
I Made 2013 年 3 月 11 日
I have a buffer named segmen that has < 512 x 490 int16 > values in it
r1c1 r1c2 r1c3 r1c4 r1c5 ... r1c490 (c1= column 1 r1=row 1)
r2c1 r2c2 r2c3 r2c4 r2c5 ... r2c490
.
.
.
r520c1 r2c2 r2c3 r2c4 r2c5 ... r2c490
I want to process it using formula like : (r1c1+r2c1)/2, (r1c1-r2c1)/2 -> low pass and high pass filter
i expect the output to be < 256 x 490 int 16>, but i do it wrong. Here is my code:
f=wavread('tes.wav','native');
v=[1/sqrt(2) 1/sqrt(2)]; %haar scaling function
w=[1/sqrt(2) -1/sqrt(2)]; %haar wavelet function
if mod(length(f),2)~=0
f=[f 0];
end
leftchanel=f(1:size(f),1);
segment=buffer(leftchanel,512);
d=length(segment);
m=1:d/2;
a1=segment(2*m-1).*v(1) + segment(2*m).*v(2);
d1=segment(2*m-1).*w(1) + segment(2*m).*w(2);
Using that code what i got is < 1 x 256 int 16> but i expected < 256 x 490 int 16>, i need advise to correct my mistake please ?

採用された回答

Walter Roberson
Walter Roberson 2013 年 3 月 11 日
編集済み: Walter Roberson 2013 年 3 月 11 日
hint:
A(2*k,:)
  2 件のコメント
I Made
I Made 2013 年 3 月 11 日
編集済み: I Made 2013 年 3 月 11 日
it was right to do r1c1+r2c1 , but it's not looping for r1c2+r2c2... hmm i think my loop is not perfect yet, am i correct?
I Made
I Made 2013 年 3 月 11 日
wow thanks, i figured it out lol.
change my code into this:
a1=segment(2*m-1,:).*v(1) + segment(2*m,:).*v(2);
d1=segment(2*m-1,:).*w(1) + segment(2*m,:).*w(2);
stupid me T_T

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Multiresolution Analysis についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by