Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Filter of sin component of sound signal
조회 수: 2 (최근 30일)
이전 댓글 표시
Hey
This is a project that i am working on, there we are suppose to filter out a sin-component from a small sound signal.
I have the signal "x" already, this "x" contains the sound signal og the energy-spectral-density.
And I have done all the calculations for the filter and signal, and ended up with this differential equation:
y = 2*a*cos(W_s)*y(n-1) - a.^2*y(n-2) - b0*x(n) - b0*2*cos(W_s)*x(n-1) + b0*x(n-2);
So my next step is to get this signal y(n) and check and se if the sin-component is gone. I know that I should be loop like this:
for n = 3:length(x)
y(n) = 2*a*cos(W_s)*y(n-1) - a.^2*y(n-2) - b0*x(n) - b0*2*cos(W_s)*x(n-1) + b0*x(n-2);
end
But i am getting this error: Attempted to access y(2); index out of bounds because numel(y)=1.
댓글 수: 0
답변 (1개)
Youssef Khmou
2015년 4월 18일
편집: Youssef Khmou
2015년 4월 18일
Concerning the equation of y, can you explain its origin. As for the error, initial condition must be set :
y=zeros(size(x));
y(1)=x(1);
y(2)=x(2);
% for loop
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!