| MATLAB® | ![]() |
ts2 = idealfilter(ts1,Interval,FilterType)
ts2 = idealfilter(ts1,Interval,FilterType,Index)
ts2 = idealfilter(ts1,Interval,FilterType) applies an ideal filter of FilterType 'pass' or 'notch' to one or more frequency intervals specified by Interval for the timeseries object ts1. You specify several frequency intervals as an n-by-2 array of start and end frequencies, where n represents the number of intervals.
ts2 = idealfilter(ts1,Interval,FilterType,Index) applies an ideal filter and uses the optional Index integer array to specify the columns or rows to filter. When ts.IsTimeFirst is set to true, Index specifies one or more data columns. When ts.IsTimeFirst is set to false, Index specifies one or more data rows.
You use the ideal notch filter when you want to remove variations in a specific frequency range. Alternatively, you use the ideal pass filter to allow only the variations in a specific frequency range.
These filters are ideal in the sense that they are not realizable; an ideal filter is noncausal and the ends of the filter amplitude are perfectly flat in the frequency domain.
If the time-series data is sampled nonuniformly, filtering resamples this data on a uniform time vector.
All NaNs in the time series are interpolated before filtering using the interpolation method you assigned to the timeseries object.
You will apply an ideal notch filter to the data in count.dat.
Load the matrix count into the workspace.
load count.dat;
Create a timeseries object based on this matrix. The time vector ranges from 1 to 24 seconds in 1-second intervals.
count1=timeseries(count(:,1),1:24);
Enter the frequency interval in hertz.
interval=[0.08 0.2];
idealfilter_count = idealfilter(count1,interval,'notch')
Compare the original data and the shaped data with an overlaid plot of the two curves.
plot(count1,'-.'), grid on, hold on
plot(filter_count,'-')
legend('Original Data','Shaped Data',2)

filter (timeseries), timeseries
![]() | i | idivide | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |