source: trunk/src/transform_field/signal_bandpass_filter.m @ 783

Last change on this file since 783 was 753, checked in by sommeria, 11 years ago

signal spectrum analysis and various improvements in transform

File size: 996 bytes
Line 
1% 'signal_band_filter': example of pass-band filter (using the signal toolbox fct fdesign)
2% frequency and bandwidth need to be modified in the function
3%
4% OUTPUT:
5% DataOut: Matlab structure representing the output (filtered) field
6%
7%INPUT:
8% DataIn: Matlab structure representing the output field
9%
10
11function DataOut=signal_bandpass_filter(DataIn)
12%% set GUI config
13DataOut=[];
14if strcmp(DataIn,'*')   
15    DataOut.InputFieldType='1D';
16    return
17end
18%%%%%%%%%%%%%%%%%%%%%%%%%
19frequency=2*5/54.5;% frequency at which the signal needs to be filetered
20 %d=fdesign.bandpass(0.8*frequency, 0.95*frequency, 1.05*frequency, 1.2*frequency, 60, 1, 60);
21 d=fdesign.bandpass(0.7*frequency, 0.9*frequency, 1.1*frequency, 1.3*frequency, 60, 1, 60);
22 Hd=design(d);% command  fvtool(Hd) to visualize the filter frequency response
23 DataOut=DataIn;
24 if isfield(DataIn,'U')
25 DataOut.U = filter(Hd,DataIn.U);
26 end
27  if isfield(DataIn,'V')
28 DataOut.V = filter(Hd,DataIn.V);
29 end
30
Note: See TracBrowser for help on using the repository browser.