An error at modulation process
이전 댓글 표시
[sound,fs]=wavread('sesdeneme.wav');
fn1 = [10/(7000), 700/(7000)];
[b1,a1] = butter(10, fn1, 'bandpass');
y1=filter(b1, a1, sound);
envelope1 = abs(hilbert(y1));
t=0:0.001:1;
car1=5*cos(2.*pi.*350.*t);
mod1=envelope1.*car1;
plot(t,mod1);grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
i am trying to product envelope1 and car1 but i get this error:
??? Error using ==> times
Matrix dimensions must agree.
Error in ==> implantsonhali at 60
mod1=envelope1.*car1;
Can anyone please help me? :) ty
채택된 답변
추가 답변 (10개)
Wayne King
2012년 4월 8일
You have a two-channel recording, do this:
[sound,fs]=wavread('sesdeneme.wav');
sound = sound(:,1);
fn1 = [10/(7000), 700/(7000)];
[b1,a1] = butter(10, fn1, 'bandpass');
y1=filter(b1, a1, sound);
envelope1 = abs(hilbert(y1));
t=0:1/fs:(length(y1)*1/fs)-1/fs;
car1=(5*cos(2.*pi.*350.*t))';
mod1=envelope1.*car1;
plot(t,mod1);grid on
Honglei Chen
2012년 4월 7일
0 개 추천
It seems taht your evelope1 is derived from the input sound, while your car1 has the dimension of t, so the two don't match in size.
Wayne King
2012년 4월 8일
[sound,fs]=wavread('sesdeneme.wav');
fn1 = [10/(7000), 700/(7000)];
[b1,a1] = butter(10, fn1, 'bandpass');
y1=filter(b1, a1, sound);
envelope1 = abs(hilbert(y1));
t=0:1/fs:(length(y1)*1/fs)-1/fs;
if iscolumn(envelope1)
t = t(:);
end
car1=5*cos(2.*pi.*350.*t);
mod1=envelope1.*car1;
plot(t,mod1);grid on
Wayne King
2012년 4월 8일
You must not have a version with iscolumn(). That's fine, you don't need that, I just put that in in case the output of filter() is a column vector.
Just make sure that car1 and envelope1 are both row or column vectors
Enter
>>whos envelope1
if it is column vector, then use
t = t(:);
and you'll be fine.
카테고리
도움말 센터 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!