DSPRelated.com
Forums

IIR filter Implementation

Started by Par May 3, 2005
In article <b_-dnRP7Q4eCXubfRVn-hQ@rcn.net>, Jerry Avins  <jya@ieee.org> wrote:
>Par wrote: >>>If your interval is the time to take 100 samples, then you can't >>>localize within it. Your indication of strength will be an average over >>>the entire 100-sample interval. When you wrote "dominant", what meaning >>>did you have in mind? >>> >>> >>>Jerry >>>-- >> >> >> Why do you think I cannot localize within the interval of samples? >> Forgetting about filters for a moment, localizing in the time domain is >> what STFT about, right? >> >> In STFT, we apply a sliding window and take the DFT of each section. If I >> want to monitor the evolution of a single freq. using the STFT, say N/3, I >> can simply compute the DFT at N/3, slide the window further, compute DFT at >> N/3 again, and so forth. Then, I will get an idea of how N/3 evolves along >> the time domain. >> >> This would be equivalent to filtering out the single frequency using a >> digital filter, followed by decimation. The decimation factor will be >> depending on how many samples I slide the window through in the STFT. So, >> after filtering, I can compute the square of the time-domain signal to see >> the strength of the freq. along the time-domain. > >A sliding DFT will come closest to providing what you want (recall that >I recommended it). A sample doesn't represent a frequency, but rather an >amplitude. There is also a sliding Goertzel, by the way. > >You will not get temporal localization within 100 samples if you use all >100 samples in the same DFT. If you use, say, 10 at a time, then slide >along until they're all exhausted, you will have done three things: only >the middle 80 results will be completely valid; you will have made the >temporal resolution 10 times better; you will have made the frequency >resolution 10 times coarser. For a given number of samples, the product
One can always do both frequency and temporal analysis (e.g. the 100 sample window plus 90 10 sample windows) and, *given* some a priori knowledge about the maximum frequency modulation and the rise/fall time of the signal of interest in the system under test, use the intersection of both results to resolve frequency and time to a higher resolution than the product would indicate. I will agree that if one knows nothing about the system under test, one can't do this; but when building instrumentation (motor speed control, etc.), one often knows *something* about the characteristics of the system being measured. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Ronald H. Nicholson Jr. wrote:

> In article <2JWdnXURT7pyX-LfRVn-3w@comcast.com>, > glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:
>>The FFT, and DFT in general, has periodic boundary conditions, which >>allow only discrete frequency solutions.
> An FFT is a computationally efficient transform for mapping N points into > another set of N points in a different orthogonal basis. No assumption > of periodicity is required to transform a complex vector from one basis > to another. The assumption of periodicity is only needed for certain > interpretations of the results.
The basis functions are periodic. You can ignore that, but the transform won't. It is my understanding that when FFT is used for convolution the data is zero padded to twice the original length to get around the periodicity effects.
> An, in fact, in the real world, the probability that some unknown > sinusoidal signal is exactly synchronized to an arbitrary sampling window, > thus providing the periodic boundary condition, is small, and but possibly > much larger than the presence of some Sync-shaped distribution of FFT > bin frequencies.
As far as the FFT, you get the transform of the input signal through the sampling window, and then repeated at the transform periodicity, with a discontinuity at the boundary.
> By making some a priori assumptions about the data (e.g. some finite > number of very narrow band signals above a certain noise floor) one can > interpret the results of an FFT to produce more useful results (given > that the a priori assumptions are likely met) than by assuming that only > the discrete FFT bin frequencies are present. A sinusoidal tone-burst > between FFT bins will never-the-less leave a clear signature in the > FFT spectra. One is often able to calculate bounds, or statistically > measure the likelyhood using other means, that this same between-the-bins > FFT spectrum signature could be produced by noise in the system under > consideration. One can then make a decision based on comparitive > probabilities as to which interpretation to prefer.
Well, as with any aliasing problem, the solution is not unique. If you have other information you can reconstruct the original signal. If, for example, you know that the input is a single sinusoid, then you can recover that information from the transform. Then again, if you know it is a single sinusoid you can recover it with three appropriately chosen sample points, enough to solve for the average (DC) value, phase, and frequency. Consider the problem in time instead of frequency. Say you have a pulse that doesn't match up with the sample points in sampled data. Low pass filter it, and it will have energy in nearby sample points, otherwise it is lost due to aliasing. It is filtered so that there are no frequency components outside the appropriate window, but the result will be the same as if the spectrum were repeated with the sampling frequency period. That you well know as aliasing. Now consider the same situation in transform space. You have a frequency that is between frequency sample points. Filter it in time, such that it is non-zero over a time window. The result, though, is the same as repeating the signal with the periodicity of the window. Aliasing in time instead of frequency.
> And my earlier comments about being able to more precisely measure > frequency between bins was based on the a priori assumption of > "sufficiently" low noise compared to the signal(s) of interest.
-- glen
"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message 
news:XY2dnYSe2qcElBjfRVn-3w@comcast.com...
>................It is my understanding that when FFT is used for > convolution the data is zero padded to twice the original length to get > around the periodicity effects. >
I like to think of it as simply a necessity caused by using fixed array lengths. Let's say we would convolve 2 sequences that are each N elements in length. The resulting convolution has 2N-1 elements. Nothing about periodicity there. Oh, unless you were thinking periodicity in the time domain. Yep. If one is going to use the DFT in implementing a convolution then one is going to be using fixed-length arrays. So, the arrays better be >=2N-1 in length to accomodate the result. Actually the length you need is M+N-1 where M and N are the lengths of the two sequences in the convolution. This could be very different from twice one length or another. Fred