Removing a tone from a recorded audio signal
조회 수: 11 (최근 30일)
이전 댓글 표시
I'm trying to remove a specific tone (frequency) from a recorded audio sample (a song with a tone played over it). I have code written that identifies the tone, and I tried to use the iircomb function to design a notch filter and remove this frequency.
The code I'm using doesn't give any errors, but it doesn't seem to work - the output audio signal is much too short compared to the input audio signal. Here's the code:
Q = 35;
bw = maxFreq/(Fs/2)/Q;
[b,a] = iircomb(round(Fs/maxFreq),bw);
yOut = filter(yAudio,a,b);
sound(yOut,sampleRate);
...where yAudio is the recorded (input) audio signal, sampleRate is 44100 (times per second), maxFreq is the identified frequency I'm trying to remove, and yOut is the output audio signal I want to obtain.
How can I do this / why isn't this design working? When I debug this function, I see that 'a' and 'b' are of size 1x65, but the original input audio signal yAudio is 235200x1 (this varies depending on the length of time I record the sample).
Thanks!
댓글 수: 0
답변 (1개)
Star Strider
2017년 4월 22일
You might get better results with the filtfilt function, instead of filter, although I don’t understand the shorter output signal with filter. (I rarely use filter, so I’m not familiar with it.)
A different filter design, such as that outlined in the documentation for Remove the 60 Hz Hum from a Signal (link) using the designfilt function could be worth a go. Make the requisite changes to the arguments to filter the frequency you want.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!