Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fft]

The fast Fourier transform is an efficient algorithm to compute the discrete Fourier transform (DFT) and its inverse.

62
votes
2answers
18k views

Why is it a bad idea to filter by zeroing out FFT bins?

It's very easy to filter a signal by performing an FFT on it, zeroing out some of the bins, and then performing an IFFT. For instance: ...
67
votes
6answers
126k views

Why should I zero-pad a signal before taking the Fourier transform?

In an answer to a previous question, it was stated that one should zero-pad the input signals (add zeros to the end so that at least half of the wave is "blank") What's the reason for this?
4
votes
4answers
2k views

About Discrete Fourier Transform vs. Discrete Fourier Series

I am new to the field of signal processing. I am wondering what is the difference between DFS(Fourier Series) vs. DFT(Fourier Transform). For common applications, usually we get a segment(length <...
53
votes
7answers
81k views

How do I implement cross-correlation to prove two audio files are similar?

I have to do cross correlation of two audio file to prove they are similar. I have taken the FFT of the two audio files and have their power spectrum values in separate arrays. How should I proceed ...
23
votes
4answers
4k views

Which time-frequency coefficients does the Wavelet transform compute?

The Fast Fourier Transform takes $\mathcal O(N \log N)$ operations, while the Fast Wavelet Transform takes $\mathcal O(N)$. But what, specifically, does the FWT compute? Although they are often ...
18
votes
3answers
9k views

Tips for improving pitch detection

I'm working on a simple web app that allows the user to tune his/her guitar. I'm a real beginner in signal processing, so don't judge too hard if my question is inappropriate. So, I managed to get ...
5
votes
4answers
2k views

Intuition for sidelobes in FFT

I was wondering if there's a intuitive way to understand why sidelobes appear when performing an FFT on a signal of fixed length?
5
votes
2answers
8k views

FFT frequency resolution

I'm having some problems understanding the FFT. Is the frequency resolution in the spectrum calculated as $\frac{\textrm{sampling rate}}{\textrm{number of FFT points}}$ or $\frac{\textrm{sampling ...
31
votes
9answers
12k views

Is there an algorithm for finding a frequency without DFT or FFT?

I was looking in the Android app store for a guitar tuner. I found a tuner app that claimed it was faster than other apps. It claimed it could find the frequency without using the DFT (I wish I still ...
26
votes
5answers
6k views

Is there a technical term for this simple method of smoothing out a signal?

Firstly, I am new to DSP and have no real education in it, but I am developing an audio visualization program and I am representing an FFT array as vertical bars as in a typical frequency spectrum ...
18
votes
3answers
43k views

What effect does a delay in the time domain have in the frequency domain?

If I have a signal that is time limited, say a sinusoid that only lasts for $T$ seconds, and I take the FFT of that signal, I see the frequency response. In the example this would be a spike at the ...
10
votes
3answers
2k views

MATLAB: $\tt fft$ and $\tt ifft$ scaling

In MATLAB, the outputs of the fft and/or ifft functions often require additional processing before being considered for analysis....
20
votes
1answer
24k views

What is the difference between PSD and squared magnitude of frequency spectrum?

The power spectrum of a signal can be calculated by taking the magnitude squared of its Fourier transform. Being an audio person, the signal of interest for me would be a time series. How does this ...
19
votes
4answers
5k views

How to distinguish voice from snoring?

Background: I'm working on an iPhone application (alluded to in several other posts) that "listens to" snoring/breathing while one is asleep and determines if there are signs of sleep apnea (as a pre-...
15
votes
1answer
17k views

What is the phase and magnitude response of white noise?

I would like to create white noise in the frequency domain, and then transform it to the time domain using python. To understand the problem, I simply generated white noise in the time domain, and ...
14
votes
2answers
19k views

Why does spectral leakage arise in an FFT?

I've tried googling and wikipedia-ing it, but I haven't gotten any answers beyond 'it's because the frequency of the input signal is sitting between two bins'. I understand that this is the reason, ...
13
votes
5answers
7k views

FFT of sine wave not coming as expected i.e single point

The cyan plot is a spectrum of 50 Hz, and the magenta one is a 50.1 Hz sine wave (having amplitude 0.7). Both are sampled at 1024 samples/s. I performed a 1024 point FFT to get this spectrum. Why is ...
11
votes
2answers
18k views

Image Reconstruction:Phase vs. Magnitude

Figure 1.(c) shows the Test image reconstructed from MAGNITUDE spectrum only. We can say that the intensity values of LOW frequency pixels are comparatively more than HIGH frequency pixels. Figure 1.(...
4
votes
3answers
18k views

Number of DFT (FFT) Points Required for a Specific Frequency Resolution for an Oversampled Signal

I have a bandpass signal centered at 2 MHz and bandwidth of 50 kHz (the signal frequency varies from 2 MHz - 25 kHz to 2 MHz + 25 kHz). This signal is being sampled at 10 MHz. I want a frequency ...
11
votes
3answers
1k views

Why do I have frequency leakage in DFT after zero padding if frequency resolution is fine?

Let's consider this example: Fs=1000; Ns=500; t=0:1/Fs:(Ns-1)*1/Fs; f1=10; f2=400; x=5+5*sin(2*pi*f1*t)+2*sin(2*pi*f2*t); X=fft(x); In this scenario, frequency ...
16
votes
4answers
8k views

How do you calculate spectral flatness from an FFT?

Ok, the spectral flatness (also called Wiener entropy) is defined as the ratio of the geometric mean of a spectrum to its arithmetic mean. Wikipedia and other references say the power spectrum. Isn'...
4
votes
2answers
6k views

Hermitian symmetry in OFDM systems

I am trying to understand the usage of Hermitian symmetry in OFDM systems and have a couple of questions regarding this. What is the reason of using the Hermitian symmetry in OFDM? How can we arrange ...
4
votes
1answer
3k views

Non-Uniform FFT with FFTW?

Can FFTW perform the FFT on data which is not uniform in time? I can't seem to find a straight-forward answer to this question anywhere online.
27
votes
3answers
27k views

Picking the correct filter for accelerometer data

I am fairly new to DSP, and have done some research on possible filters for smoothing accelerometer data in python. An example of the type of data Ill be experiencing can be seen in the following ...
13
votes
3answers
15k views

Fast Cosine Transform via FFT

I want to implement the Fast Cosine Transform. I read on wikipedia, that there is a fast version of the DCT which is similarly computed to the FFT. I tried to read the cited Makhoul* paper, for the ...
12
votes
4answers
17k views

Efficiently calculating autocorrelation using FFTs

I'm trying to calculate an autocorrelation on a platform where the only accelerated primitive I have available is the (I)FFT. I'm having a problem though. I prototyped it in MATLAB. I am, however, ...
2
votes
2answers
3k views

What should be the correct scaling for PSD calculation using $\tt fft$

I would to calculate the PSD of a signal using FFT however the result do not match with periodogram command. What did was as follow : ...
10
votes
2answers
3k views

What statistic is used to determine presence of a signal in noise?

This is a detector problem I believe: I am being stumped by what appears to be a simple problem. Basically, I have a band of interest. If signal energies exist within this band of interest, then I ...
0
votes
2answers
6k views

FFT Pitch Detection methods: Autocorrelation or other?

I've seen many posts here that state that an FFT is almost all you need to get the fundamental frequency from an input stream. The problem is that, with sound, this doesn't work; we need to look for ...
10
votes
6answers
4k views

Is there an algorithm to compute the phase for a single frequecy?

If you have a function $f(t)=A \cdot \sin(\omega t+\phi)$, and reference sin wave $\sin(\omega x)$ what would be a fast algorithm to compute $\phi$? I was looking at Goertzel algorithm, but it doesn'...
2
votes
1answer
632 views

removal of blackman harris window results in signal higher than expected

We are capturing data using a PX14400 adc. The samples are 16bit unsigned integer, 200M samples/sec, I data only. 100MHz bandwith. We have a cw signal at 51MHz, -11.4dBm. The -11.4dBm is measured ...
3
votes
2answers
1k views

FFT analysis for Vibration Signal

I am working on balancing an air-spindle. For the unbalance analysis I use an accelerometer (NI device). I have the voltage signal from the accelerometer corresponding to the vibration of spindle at a ...
7
votes
1answer
3k views

What transform can I use to “zoom” in a specific portion of a signal's spectrum?

If I recall correctly, there is a variation of the DFT that can be used to analyze a specific band of the spectrum of a signal. How is it called?
3
votes
3answers
3k views

recover image by only magnitude of image fourier transform

I have a image and I want calculate fft2 of it, after it I want recover image only by magnitude of it. how can I achieve this work? ...
2
votes
1answer
4k views

Implementing inverse FFT using forward FFT

I am trying to implement an inverse FFT using the forward FFT. For clarity: Let S[t] be a signal in time, and S[w] the transformed signal. As per this site, it seems one can reverse S[w], use the ...
1
vote
1answer
65 views

Limitation on the shift theorem of DFT due to frequency resolution?

The shift theorem states that shifting a sine wave in time domain by t is equivalent to multiplying the corresponding DFT coefficient of the signal by a complex exponential e^(-jwt). Described by the ...
1
vote
1answer
549 views

For 2D signals can it be said that the frequency response is the same as the Fourier transform?

Say I have a signal: [1, 1 , 1; 1 100 1; 1 1 1];, I wanted its frequency response, then can I take its FFT? Why does MATLAB have two functions to do the same ...
16
votes
1answer
4k views

Find similar Music using FFT Spectrums

I have been experimenting some weeks to find a way to match/find similar Songs in a Library containing different Genres of Music. My first try was to Detect Features like Tempo or how much Bass there ...
4
votes
2answers
28k views

Power spectral density vs. FFT bin magnitude

What's the difference between these? Both are measurements of some form of signal power, but surely there's some difference between the power they are measuring?
16
votes
3answers
6k views

Why are magnitudes normalised during synthesis (IDFT), not analysis (DFT)?

In most examples and FFT code that I've seen, the output (frequency magnitudes) of the forward DFT operation is scaled by N -- i.e. instead of giving you the magnitude of each frequency bin, it gives ...
13
votes
4answers
2k views

Recommendation for book - Writing DSP code in C

I am looking for some good book, that simply show how you actually write a code in C, to do all the main DSP methods . FFT. Low-pass and high-pass filters. Auto-correlation. Noise processing. And ...
11
votes
2answers
9k views

Why do we say that “zero-padding doesn't really increase frequency resolution”

Here is a sinusoid of frequency f = 236.4 Hz (it is 10 milliseconds long; it has N=441 points at sampling rate ...
8
votes
5answers
3k views

Piano pitch detection

I'm working on a piano tuning program and part of it requires real-time pitch detection. Here is the scheme I have so far which works to some degree but could probably use some refinement. I'm ...
14
votes
3answers
4k views

FFT with asymmetric windowing?

Common non-rectangular window functions all seem to be symmetric. Is there ever a case when one would want to use a non-symmetric window function before an FFT? (Say if the data on one side of the ...
8
votes
3answers
8k views

baffled by fft phase spectrum!

A very simple MATLAB experiment: f = 200; fs = 1000; t = 0: 1/fs : 1; x = cos(2*pi*f*t); plot(angle(fftshift(fft(x)))); And here's the output: Now, made ...
6
votes
1answer
2k views

Failed to implement Goertzel algorithm in Python

After some questioning on stackoverflow, I tried to implement a Goertzel algorithm in Python. But it doesn't work : https://gist.github.com/4128537 ...
12
votes
3answers
15k views

When to use the DTFT vs the DFT (and their inverses) in analysis?

In many of my readings, whenever some author speaks about working in the frequency (transform) domain (of a digital signal), they often times take the DFT, or the DTFT, (and of course their ...
8
votes
3answers
6k views

How do window size, sample rate influence FFT pitch estimation?

I am trying to create a pitch-detection program which extracts the frequencies of peaks in a power spectrum obtained from an FFT (fftpack). I am extracting the peak ...
4
votes
4answers
10k views

Choosing the right overlap for a window function

On Wikipedia there is quite a list of window functions. However, when you are doing a lot of STFTs, you often have to have some overlap to get better results. Generally an overlap factor of 2 (i.e., ...
5
votes
5answers
199 views

Remove a known wav file from recorded file

I looked at many similar questions but still cannot find an answer to my problem. I'm playing an audio file N, while recording a man talking (b). The problem is that the microphone gets the played ...