Borrar filtros
Borrar filtros

how to design bandpass filter with cut off wavelengths given.

6 visualizaciones (últimos 30 días)
I have a gridded bathymetry data. I have to remove all signals from the data with a wavelength greater than 4000 km and less than 400 km. How can I design a bandpass filter, eg. Butterworth filter? how do I determine the cut off frequencies and order of the filter? the spacing between grid points is 0.16 km.

Respuesta aceptada

Star Strider
Star Strider el 22 de Feb. de 2018
This will work for a filter design:
Ts = 0.16; % Sampling Interval (Units: km)
Fs = 1/Ts; % Sampling Frequency (Units: 1/km)
Fn = Fs/2; % Nyquist Frequency
Freq1 = 1/4000; % Convert Wavelentgh To Frequency (Units: 1/km)
Freq2 = 1/400; % Convert Wavelentgh To Frequency (Units: 1/km)
Wp = [Freq1 Freq2]/Fn; % Passband Frequencies (Normalised)
Ws = Wp.*[0.8 1.2]; % Stopband Frequencies (Normalised)
Rp = 1; % Passband Ripple
Rs = 50; % Stopband Ripple
[n,Wn] = buttord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = butter(n,Wn); % Calculate Filter
[sos,g] = zp2sos(z,p,k); % Convert To Second-Order-Section
figure(1)
freqz(sos, 2^16, Fs) % Filter Bode Plot
set(subplot(2,1,1), 'XLim',[0 0.05])
set(subplot(2,1,2), 'XLim',[0 0.05])
The Bode plot of the filter amplitude appears to have strange units, with the filter appearing to ‘amplify’ the signal. This is due to the way freqz calculates filter gain, not the design of the filter. The filter will not amplify your signal.
I leave the implementation to you, because I have no idea what you are doing.
  4 comentarios
math seeker
math seeker el 26 de Feb. de 2018
The line
freqz(sos, 2^16, Fs)
gives me an error.
error: freqz: B must be a vector
Star Strider
Star Strider el 26 de Feb. de 2018
The code in my Answer runs without errors in R2017b. (I copied it from my post and ran it again just now, to be sure.)
I have no idea what your problem could be, since you only posted the freqz call.

Iniciar sesión para comentar.

Más respuestas (1)

Abhishek Ballaney
Abhishek Ballaney el 22 de Feb. de 2018
https://in.mathworks.com/help/signal/ref/butter.html

Categorías

Más información sobre PHY Components 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!

Translated by