Design a low pass filter for time domain data

7 views (last 30 days)
Hi,all I wish to design a low pass filter for the time domain data.I have transformed the data into frequency domain, which showed below. But I have no idea on how to design a low pass filter, because I can not determine the sampling frequency and cutoff frequency. The data is a 87238x1 vector. The total time for recording this data is 300 seconds.

Accepted Answer

Star Strider
Star Strider on 9 Aug 2016
You already have much of the information you need, particularly the length of the vector and the total time.
Assuming a constant sampling interval, you can calculate these:
Lv = 87238; % Data Vector Length (samples)
Tv = 300; % Data Vector Length (sec)
Ts = Tv/Lv; % Sampling Interval (sec/sample)
t = linspace(0, 1, Lv)*Ts; % Time Vector (sec)
Fs = 1/Ts; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
You have to choose the cutoff frequency.
There are several ways to design filters in MATLAB, including dfilt and designfilt, however the IIR filter design procedure I usually use may be easier. It is here: How to design a lowpass filter for ocean wave data in Matlab?

More Answers (0)

Categories

Find more on Digital and Analog Filters in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!