Create a Notch filter with low and high pass filters
    15 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Luke McDevitt
 el 4 de Dic. de 2022
  
    
    
    
    
    Comentada: Paul
      
      
 el 5 de Dic. de 2022
            I have been attempting to create a notch filter where I can specifiy the range of frequncies that will be filtered out. This is my best attempt:
[y,Fs] = audioread('africa-toto.wav');
notchfilt = highpass(y,1000,Fs) .* lowpass(y,100,Fs);
figure
freqz(notchfilt, 1, 2^16, Fs)
sound(notchfilt,Fs)
I'm not sure why but the resulting audio playback is very very grainy and doesnt remove the frequencies specified correctly. 
1 comentario
  Paul
      
      
 el 5 de Dic. de 2022
				Hi Luke,
Not sure why the outputs of highpass() and lowpass() would be multiplied. If anything, it looks like they should be added
% create some data
Fs = 5000;
rng(100);
y = randn(1024,1);
% DTFT of the input
[hy,wy] = freqz(y,1,2^16);
% the output and its DTFT
notchfilt = highpass(y,1000,Fs) + lowpass(y,100,Fs);
[hn,wn] = freqz(notchfilt,1,2^16);
figure
plot(wy/2/pi*Fs,[abs(hy) , abs(hn)]),grid
Having said, designing the bandstop filter directly is the way to go.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
				Más información sobre Measurements and Spatial Audio en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



