필터 지우기
필터 지우기

i want to find and hear the frequency responce of a .wav file using following equation y(n)=y(n-1​​)-0.9*y(n​-​2)+x(n)+​x(​n-1) but still its giving error in equation foolowing is my code

조회 수: 1 (최근 30일)
the main error is due to the equation please help me to figure it out .following is the code and error
PathOriginal = fullfile('C:\Users\Desktop\assigmnt', 'Voice 002.wav'); [y, Fs, n] = wavread(PathOriginal);
b=[1 1]; a=[1 -1 0.9];
y(n)= y(n-1)-0.9*y(n-2)+x(n)+x(n-1) [H,w]=freqz(b,a,n,Fs) player=audioplayer(y, Fs) play(player)
player2=audioplayer(H, w, Fs) play(player2)
error : ??? Error: File: q2.m Line: 7 Column: 12
Unexpected MATLAB operator.
this error appears in equation's line .

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 24일
You need to use semi-colons to separate multiple commands in the same line. For example
player2=audioplayer(H, w, Fs) play(player2)
is not valid and needs to be
player2=audioplayer(H, w, Fs); play(player2)
  댓글 수: 2
lione felus
lione felus 2015년 7월 24일
편집: lione felus 2015년 7월 24일
thanks walter but its actually giving error in the line where equation is written . here is my m file
Walter Roberson
Walter Roberson 2015년 7월 24일
The line in question is
y(n)= y(n-1?)-0.9*y(n-?2)+x(?n-1)+x(n)
You should delete the line and retype it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by