Implementing Notch filter for an audio signal

4 visualizaciones (últimos 30 días)
Mitja Kocjancic
Mitja Kocjancic el 9 de Abr. de 2022
Comentada: Mathieu NOE el 13 de Abr. de 2022
Hello, I have the folowing filter expressed as an equasion
If you put in Exel for example values from 0khz to 15khz in 1Hz increments, you get a response that looks like this
Now when I wanted to implement this in matlab, and used this audio sample: https://transfer.sh/ruffRk/test.wav
[y,Fs] = audioread('test.wav');
filtered = (1+1i*6.4*y)/(5+1i*6.4*y);
sound(filtered,Fs);
I got the folowing error
Error using /
Requested 3888467x3888467 (225308.2GB) array exceeds maximum array size
preference (32.0GB). This might cause MATLAB to become unresponsive.
Now I don't know how to implement this notch filter properly in matlab, I guess its just requires too much RAM, that I don't have or is there any other way?
Thanks for Anwsering and Best Regards
  6 comentarios
Mitja Kocjancic
Mitja Kocjancic el 12 de Abr. de 2022
@Mathieu NOE you made my day, thanks man, not sure how to accept this anwser but yey it finaly works :)
now I have it like this
function result = k_notch(signal, phase, Fs)
disp("Applying Notch filter for: " + phase);
num = [6.4/(2*pi) 1];
den = [6.4/(2*pi) 5];
%Discrete this
[ad, bd] = bilinear(num, den, Fs);
%Filter signal
result = filter(ad,bd,signal);
end
and I am happy :)
Mathieu NOE
Mathieu NOE el 13 de Abr. de 2022
My pleasure !

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Audio Processing Algorithm Design en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by