13 votes
Accepted

Bandwidth of an entire song

First of all, kudos to you: I appreciate the effort and thinking you've managed to articulate in your question. The DFT is a mathematical tool. As such, the parameters used to compute it can hide or ...
Jdip's user avatar
  • 6,030
11 votes
Accepted

Why do sinusoids have DFT magnitudes of N / 2 while we typically normalize by N?

The DFT is providing the coefficients of the basis functions given as samples of $e^{j\omega t}$ not cosines or sines. Review the formula for the inverse DFT which shows this relationship: $$x[n]= \...
Dan Boschen's user avatar
10 votes

Why do sinusoids have DFT magnitudes of N / 2 while we typically normalize by N?

To add to Dan’s answer, and focus on your “bonus” question: Keep in mind that DFT normalization/scaling is a matter of convention. Quoting the wikipedia article that you linked to in your question: ...
Jdip's user avatar
  • 6,030
7 votes

Why am I getting 2 frequency spikes in a mono tone signal?

You're experiencing a basic property of the DFT of a real input signal, that it is conjugate symmetric: Let $x[n], \, n = 0\cdots N-1$ be a real-valued sequence, then the DFT coefficients are ...
Jdip's user avatar
  • 6,030
7 votes

How Best to Characterise a Window Function

An oldie but a goodie it fred harris's "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform". It has a nice table showing different figures of merit for different ...
Peter K.'s user avatar
  • 25.7k
7 votes
Accepted

FFT: Sinewave frequency displacement when zero-padding

(I show only positive frequencies): which is part of the problem here :-) You would get the expected behavior if you used a complex sine, i.e. $x[n] = e^{j2\pi\frac{n}{N}}$ but a sine wave actually ...
Hilmar's user avatar
  • 44.6k
6 votes

How does the effect of windowing change with the phase of the input signal?

What's going on? I think the main issue is the use of detrend='constant' in the calls to signal.periodogram. If I change that to ...
Jason C's user avatar
  • 256
6 votes

Is 2D circular cross-correlation with FFT done as described in this source?

For the question's approach of shifting the h input image spatially using ifftshift before frequency-domain complex-conjugation, ...
Olli Niemitalo's user avatar
6 votes
Accepted

Why am I getting 2 frequency spikes in a mono tone signal?

Welcome! Actually, in your case windowing only affects the width of your pulse (as you see, your peaks are not impulsive). You can see the difference by just increasing the temporal length of your ...
northgeist's user avatar
5 votes

Why do sinusoids have DFT magnitudes of N / 2 while we typically normalize by N?

The answer lies in the meaning of "negative frequency". It couldn't be any other way but $1/N$ and the resulting $1/2$. Full article: What is the physical significance of negative ...
OverLordGoldDragon's user avatar
5 votes

How to measure aliasing?

Note: it's "Work In Progress", I intend to address some limitations, including "time aliasing". Interested hot visitors may wish to "Follow" the answer. Motivating the ...
OverLordGoldDragon's user avatar
5 votes
Accepted

Gaussian filter: Plotting DTFT and DFT (by hand) from the continuous-time impulsive response

Before anything, let me just rewrite your TF from linear frequency ($f$, in Hertz) to angular frequency ($\Omega = 2\pi f$, in rad/sec). The notation $\Omega$ is usually adopted in the field of DSP to ...
Rubem Pacelli's user avatar
5 votes

Why does spectrum magnitude decay away from DC for positive signals?

It's not. Consider: $$x_1[n] = \cos\left(\frac{2\pi n}{8}\right)$$ which is real-valued and now let's take its absolute value (to make it strictly positive) so now we have: $$x[n] = \left|\cos\left(\...
Ahsan Yousaf's user avatar
  • 1,533
5 votes

Why does spectrum magnitude decay away from DC for positive signals?

No such property exists in the general case. In Ahsan Yousaf's answer a counter-example was shown. However, that example is very special in the sense that the sequence is periodic (inside the length-$...
Matt L.'s user avatar
  • 90k
5 votes
Accepted

Question about zero padding example in Lyons book on Understanding DSP

On the left side of Figure 3-21(a) the discrete 16-sample input sequence is represented by the dots. (The lightly-shaded sinusoidal curve is shown for reference only!) On the right side of Figure 3-21(...
Richard Lyons's user avatar
5 votes

Question about zero padding example in Lyons book on Understanding DSP

@gschro, I understand your puzzlement. Find the equation for computing a DTFT, in a textbook or on the Internet, and carefully examine it. In that equation $omega$ is a continuous frequency variable ...
Richard Lyons's user avatar
5 votes
Accepted

Why are my frequency bins oscillating?

This is indeed spectral leakage and specifically the dependency of the leakage on phase. Here is an example of 30 Hz sine with with a random phase. These are 50 frames with a randomized phase. The &...
Hilmar's user avatar
  • 44.6k
4 votes

DFT of a sine, closed form solution and insights

The length $N$ DFT of the discrete-time sinusoid $$x[n]=\cos(\omega_0n+\phi),\qquad n=0,1,\ldots,N-1\tag{1}$$ is given by $$X[k]=\sum_{n=0}^{N-1}\cos(\omega_0n+\phi)e^{-j2\pi nk/N},\qquad k=0,1,\ldots,...
Matt L.'s user avatar
  • 90k
4 votes
Accepted

How does the effect of windowing change with the phase of the input signal?

Summary The problem is caused by detrend='constant' in the call to periodogram, which subtracts the mean of the input before ...
OverLordGoldDragon's user avatar
4 votes

Discrete Fourier Transform of the Gaussian

The (continuous-domain) FT of a Gaussian is a Gaussian, as OP knows. To get the DFT pair from a FT pair we need to sample and crop the time domain, which is equivalent to replicating and sampling the ...
Cris Luengo's user avatar
  • 2,494
4 votes

Why are my frequency bins oscillating?

The idea that you're looking for here is spectral leakage. As alluded to in the comments, the DFT bins will undergo different amounts of spectral leakage depending on the initial phase of the tone ...
Baddioes's user avatar
  • 768
3 votes

What is the reason my DFT of a convolution of signals with disjoint spectrums is not zero everywhere?

In short: As corrected by @Matt, the DFT pair convolution-product refers to a circular convolution, not to a linear one. For Fourier transform, the property convolution FT is the product of individual ...
mins's user avatar
  • 463
3 votes
Accepted

How to solve this even symmetry question?

What you have shown for a) is actually what you should be doing for b). For a) you simply need to show that your given $x_1[n]$ is conjugate symmetric or even in this case. Now for b) if we takeover ...
Ahsan Yousaf's user avatar
  • 1,533
3 votes
Accepted

Increasing STFT resolution by repeating the window? Ways to improve STFT resolution?

Linear = Heisenberg-bound. No amount of fancy tinkering of a linear method can ever break the bound, and STFT is linear. OP suggests ...
OverLordGoldDragon's user avatar
3 votes

Convolution error when using DFT for non-periodic functions

This seems to be because the significant non-zero component of the Gaussian before the region of interest $[0,5]$ is neglected from the fft calculation but not in ...
Peter K.'s user avatar
  • 25.7k
3 votes
Accepted

Why dft sine plot is so strange

There are two things you can try, depending on what you're aiming for. If you want to see a sharp peak at frequency $\omega = 1$, as in the code in your question, then you need to increase the DFT ...
MBaz's user avatar
  • 15.3k
3 votes
Accepted

Discrete Fourier Transform of the Gaussian

I'm not sure that the DFT of the Gaussian is the Gaussian is correct. As Cris says: The Gaussian is almost, but not quite exactly, band-limited, so sampling it will not produce an exact Gaussian in ...
Peter K.'s user avatar
  • 25.7k
3 votes

Signal power depending on FFT bin size

The PSD doesn't change – the D stands for Density, i.e. "how much power is there per bandwidth), and with an increased DFT length, there's less bandwidth per bin.
Marcus Müller's user avatar
3 votes

What is the difference between the DFS (Discrete Fourier Series) and DTFS (Discrete-Time Fourier Series)

That's primarily due to inconsistent naming. Typically the term "Discrete Time Fourier Transform" (DTFT) is used for signals that are discrete in time but continuous in Frequency, which is ...
Hilmar's user avatar
  • 44.6k
3 votes
Accepted

Show that the similarity between a signal at an analysis frequency with a phase offset with a reference signal is $\frac{N}{2}\text{cos}(\phi)$

Your result is correct, and the final expression is obtained as follows: $$ \frac12\sum_{n=0}^{N-1}\left[\cos\left(4\pi \frac{m}{N}n+\phi\right)+\cos\phi\right] =\\\qquad\qquad\frac12\sum_{n=0}^{N-1}\...
Matt L.'s user avatar
  • 90k

Only top scored, non community-wiki answers of a minimum length are eligible