Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FFT filtering basics

Status
Not open for further replies.
Hi,

Usually you need a window function if the signal frequencies are not integer numbers within the data window.

For example if one frequency is 7.6 times in the window.
Without a window function you see a lot of "noise" frequencies
with the window function the noise is reduced but the true frequencies are some kind of diffuse.

Klaus
 

suppose the incoming signal is 1KHz(which is known) then no window is required? Because corresponding bin only needs to be extracted.Also I do not quite understand the meaning of spectral leakage. Why does it happen?Any examples?
 

A single point filtering is useless.

The simplest is a rectangular window (centered on the desired frequency) with a width that is determined from other considerations.

Other window shapes are possible but implementation can be messy. For example, for a low pass (or high pass for that matter) an exponential window is convenient and is often used.

Then you take the inverse FFT but you should also remember the limitations of the discrete Fourier transformation.
 

Hi,

suppose the incoming signal is 1KHz(which is known) then no window is required?
We don't know your sampling frequency nor do we know how many samples you process with the FFT, thus we don't know what size in time your measurement data window is. --> impossible to answer.

https://en.m.wikipedia.org/wiki/Spectral_leakage

Klaus
 

The example I considered (1KHz) was a hypothetical one. My question is with respect to the link I posted in #1, where 50 Hz was clearly and distinctly visible along with the harmonic counterparts. In that case I just pick up the 10th bin and take IFFT. Also I do not understand C_Mitra's remark that "single point filtering is useless" . This can be elaborated, why?
 

Hi,

the most common FFT algorithm is limited to a input sample count of 2^n (where n is an integer number). --> 2, 4, 8, 16, 32, 64...
Is your algorithm able to use other input count values?

if I understand correct, then you want to perform an FFT, pick only the 1kHz bin and perform an IFFT. The result is just the 1kHz signal that is included in the input signal.

If so, then why don´t you use a simple FIR filter. It consumes less processing power and less other ressources like RAM...it runs in real time (sample in, result out, not block wise like the FFT)

Klaus
 

The FFT can be used for filtering. However, you need to look into overlap-add or overlap-save issues.

--edit, there are also sidelobing issues.
 

A rectangular window will convolve the "single line" response with a sin(x)/x pattern. An appropriate smooth window (e.g. hanning) gives maximal stop band attenuation for arbitrary frequencies.
 
Also I do not understand C_Mitra's remark that "single point filtering is useless" ...

Sorry for not being clear enough. This is a property of the discrete Fourier transform: with a finite number of points to analyze, we have a restriction on the frequency.

When you pick up a bin, you are implicitly selecting a range and this depends on the number of points selected for the FFT.

How do you select a single frequency out of a discrete set (the FFT result is only a finite set of point)?

Analytically, the FFT is valid even if there are a finite number (denumerable) of removable singularities (recalling from memory).
 

I was going through this link https://www.codeproject.com/Articles/317054/Simple-FFT-and-Filtering-Tutorial-with-Matlab
which explains on FFT filtering. I was curious ( as a newbie) as why windowing is required for filtering. Does it not suffice to simply consider the bin value and take IFFT?

Before you ask another question do the homework:

1) generate a sample with a sinewave signal
2) do the FFT without windowing
3) do the FFT with applied windowing function to the sample
4) compare the spectra from point 2) and 3)
 

Hi fillip
I did the homework suggested and I found that through windowing works only if the sampling is incoherent in time with respect to inputs. Under ideal conditions, when sampled at the zero crossing point (assuming no phase reversal), results are encouraging without windows. At this point I would appreciate a layman's explanation as to why windowing really works?
 

Hi,

Under ideal conditions, when sampled at the zero crossing point (assuming no phase reversal), results are encouraging without windows.
I don't understand exactly what tests you made and what results you've got.
But whether you need a windowing function is not a question of time_of_sampling but a question of signal_frequencies.

I assume your tests are with frequencies only that perfectly fit (with integer numbers) in the measurement window.
Like 5.00 fullwaves
--> do a test with 5.2 fullwaves with and without windowing.

I don't know about your system configuration and what you want to achieve...
But if you generate your frequencies synchronously to the sampling clock then you are able to guarantee that all frequencies fit into the measurement window. Then you may omit the windowing and get perfect results. If possible ... I recommend this.

Klaus
 

Under ideal conditions, when sampled at the zero crossing point (assuming no phase reversal), results are encouraging without windows...

I am not aware of the ideal conditions, but the given sequence (a time series) should be de-trended.

The result is a complex signal but most people use the power spectrum.

You can adjust the phase by rotating the complex vector in the complex plane.
 

May be the "ideal conditions" apply within the limited scope of the homework exercise, for a real world filtering problem they only exist in special cases.

Even then you can save much synchronization effort by using a suitable window.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top