|
Last change
on this file since 798 was
753,
checked in by sommeria, 12 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 |
|
|---|
| 11 | function DataOut=signal_bandpass_filter(DataIn)
|
|---|
| 12 | %% set GUI config
|
|---|
| 13 | DataOut=[];
|
|---|
| 14 | if strcmp(DataIn,'*')
|
|---|
| 15 | DataOut.InputFieldType='1D';
|
|---|
| 16 | return
|
|---|
| 17 | end
|
|---|
| 18 | %%%%%%%%%%%%%%%%%%%%%%%%%
|
|---|
| 19 | frequency=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.