Low, High, and Band pass filter

Hi,
Please Help me solve a worrying problem. I want to use low pass, high pass and bandpass filter for the Temperature profile of the attached file. I want to use 10km for the lowpass, 1km for the high pass and 1-10km for the bandpass filters. Any filtering method would do
thanks

9 Comments

How to read this file? What format is it?
It's netcdf file.i can read it but filtering the data is my headache.
Please share the method to open the attached file or share data in a readable format like 'mat', 'xlsx', 'csv', 'txt' or something. Thanks
TTA
TTA on 24 Sep 2019
Edited: TTA on 24 Sep 2019
projectdir = ' ';
dinfo = dir( fullfile(projectdir, '*_nc'));
filenames = fullfile( projectdir, {dinfo.name} );
nfiles = length(filenames);
for K = 1 : nfiles
thisfile = filenames{K};
temperature = ncread(thisfile, 'Temp') + 273.15;
end
end
Sorry, but I couldn't access the file using above method. Can you please share you "temperature" variable in a '.mat' file ?
I'm sorry I answered you late. Attached is the mat file containing the data. the first row is alitude and second is temperature I want to filter
Thank you so much for sharing the data. I have few queries :
Is your altitude data in 'km'? Also, what is sampling distance/wavelength? It seems the Altitude has not fixed sampling distance/wavelength (0.02 in the beginning 0.03 towards the end)?
When we filter some data in 'frequency domain' , say 10Hz of lowpass filter, then we mean that for time-domain data we don't want that data to complete a cycle in less than 0.1 sec. If it takes more time then we are happy to let it pass. Hence, the noisy signal which is changing at high frequency will not pass after the filtering.
If altitude is in distance (km) then, what do you mean by lowpass filter of 10km?
Yes the altitude is not regular in space so we have to interpolate it to have a regular 0.02 (20m) space and in the end it stops at 60km. Since this is not in time, we can assume that every meter (m) to the time (sec). The lowpass filter will have a cut off of higher time (or m) which means a lower frequency.
TTA
TTA on 27 Sep 2019
Edited: TTA on 27 Sep 2019
Or may be I didn't get the understanding. This is why I need help

Sign in to comment.

 Accepted Answer

Assuming you can interpolate the data and make altitude to vary at fixed step of 0.02 km and 1km equivalent to 1sec.
To make butterworth filter you can use:
Sampling_Space = 0.02; % km, equivalent to 50 Hz
Low_filt = 10; % km, equivalent to 0.1 Hz
High_filt = 1; % km, equivalent to 1 Hz
Band_filt = [10 1]; % km, equivalent to 0.1Hz to 1Hz
[bl,al] = butter(2,(2*Sampling_Space)/Low_filt,'low');
[bh, ah] = butter(2,(2*Sampling_Space)/High_filt,'high');
[bb, ab] = butter(2,(2*Sampling_Space)/Band_filt,'bandpass');
Now to filter your data :
temperature_low_filtered = filter(bl,al,temperature);
temperature_high_filtered = filter(bh,ah,temperature);
temperature_band_filtered = filter(bb,ab,temperature);
I hope it helps !

More Answers (0)

Tags

Asked:

TTA
on 23 Sep 2019

Commented:

TTA
on 27 Sep 2019

Community Treasure Hunt

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

Start Hunting!