Design lowpass kaiser filter for hourly tides

Hi all,
I am trying to design a low-pass Kaiser filter for some hourly tide data so that I can apply filtfilt before harmonically analyzing the dataset. I attempted to modify the filter for http://www.mathworks.com/matlabcentral/answers/260004-design-of-a-highpass-filter-with-a-kaiser-window. I need my cutoff frequency be greater than 12 cycles per day. Here's what I did:
Ts = 1/24; % Sampling Interval (Day) 3 Hours = 3/24 Days
Fs = 1/Ts; % Sampling Frequency (1/Day)
Fn = Fs/2; % Nyquist Frequency (1/Day)
Fc = 24/11; % Cutoff Frequency (1/Day)
Fp = 24/12; % Passband Frequency (1/Day)
band_edges = [Fp Fc]/Fn; % Normalised Band Edges
mag_vct = [1 0]; % Specify Highpass
sb_att = 0.045; % Stopband Attenuation (dB)
pb_rpl = 0.01; % Passband Ripple (dB)
devs = [pb_rpl sb_att]; % Filter Specifications Vector
[n,Wn,beta,ftype] = kaiserord(band_edges,mag_vct,devs,Fs); % Design Filter
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale'); % Create Filter
fzv = linspace(0, 1, 1000)*Fn; % Frequency Vector
freqz(hh, 1024, fzv, Fs)
I also tried:
d = designfilt('lowpassfir','PassbandFrequency',Fp,...
'StopbandFrequency',Fc,'PassbandRipple',pb_rpl,...
'StopbandAttenuation',sb_att,'SampleRate',Fs, ...
'DesignMethod', 'kaiserwin');
hfvt = fvtool(d);
However, neither of these give the desired result and they are not the same.

Risposte (1)

Star Strider
Star Strider il 17 Mar 2016
I’m not certain what you want your filter to do. If your sampling interval, ‘Ts’ is 1/24 day, your sampling frequency is 24 cycles/day, and your Nyquist frequency (the highest resolvable frequency in a sampled signal) is 12 cycles/day. (The Nyquist frequency is the hard upper limit to any discrete filter.) So if you want a filter to pass everything below 12 cycles/day, you’re essentially not filtering it — you’re passing all the frequencies your instrumentation can resolve.
Do you want your filter to have a 2 cycles/day cutoff? (That would make sense for tides, but I would design it to have a cutoff of 3 or 4 cycles/day to be certain to capture all the information necessary to define a tidal signal.)
Note that oceanography is not an area of my expertise. I may be missing something.

Richiesto:

il 17 Mar 2016

Risposto:

il 17 Mar 2016

Community Treasure Hunt

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

Start Hunting!

Translated by