# Trying to understand the single-sided FFT

조회 수: 206 (최근 30일)
L'O.G. 2022년 4월 21일
편집: RH 2023년 11월 28일
For a single-sided FFT, is it correct to multiply the FFT by 2, if so why? Also, I have seen some examples that take the absolute value and sometimes not. Would you take the absolute value in taking a single-sided FFT and then the real and imaginary components as in the following example?
fw = 2*abs(fft(ft,nfft)/length(ft));
real_fw = real(fw);
imag_fw = imag(fw);
where nfft is defined in the standard way following MathWorks's example.

댓글을 달려면 로그인하십시오.

### 답변 (3개)

Bruno Luong 2022년 4월 22일
편집: Bruno Luong 2022년 4월 22일
Multiplication by 2 for single side is just a convention. To me it doesn't have any solid backup. The convention is stated in page 10-11 here:
It's like "oh, we plot half of the spectrum so otherside of the frequency there is the same amplitude, so just multiply the one we keep by 2".
To respect parseval theorem (Energy conservation), I rather multiply by sqrt(2):
facq = 100;
A=randn(1,21);
N=length(A);
dT = 1/facq;
t = (0:N-1)*dT;
df = facq/N;
Energy_time = sum(A.^2)
Energy_time = 31.8902
EfftA = fft(A)/sqrt(N);
Nh = floor(N/2);
Nh1 = Nh + mod(N,2);
% double-side
dfreq = df*(-Nh:Nh1-1);
doubleside_fftA = fftshift(EfftA);
Energy_ds = sum(abs(doubleside_fftA).^2)
Energy_ds = 31.8902
% single-side
sfreq = df*(0:Nh);
singleeside_fftA = EfftA(1:Nh+1);
singleside_fftA(2:Nh1) = singleeside_fftA(2:Nh1)*sqrt(2);
Energy_ss = sum(abs(singleside_fftA).^2)
Energy_ss = 29.9955
figure
subplot(3,1,1)
plot(t,A);
subplot(3,1,2)
plot(dfreq,abs(doubleside_fftA));
subplot(3,1,3)
plot(sfreq,abs(singleside_fftA));
##### 댓글 수: 2없음 표시없음 숨기기
Chunru 2022년 4월 22일
> It's like "oh, we plot half of the spectrum so otherside of the frequency there is the > same amplitude, so just multiply the one we keep by 2".
> To respect parseval theorem (Energy conservation), I rather multiply by sqrt(2):
Indeed, in the document it is mentioned that the factor of 2 is for auto/cross spectrum (which is power not amplitude), and hence power of +ve and -ve frequency can add up.
It's true, in Fourier analysis, that one can add up the power at two freq, but not the amplitude at two freq
RH 2023년 11월 28일
편집: RH 2023년 11월 28일
It does have a solid foundation. You can show, by direct computation, that the inverse dft signal is a signal of the form (X(k=0) + X(N/2)(-1)^n) + sum_{k=1}^{N/2-1) 2 abs(X(k))cos(2*\pi * f_k n + phase(X(k)))
This immediately shows why you multiply by the factor two. I can post a detailed computation if you are interested, it is not hard.

댓글을 달려면 로그인하십시오.

Chunru 2022년 4월 22일
Assume X(k) = FFT(x(n)).
Then one estimate of Power Spectrum Density (PSD) of x(n) can be given as P(k) = X(k)^2 / N for general complex signal x(n).
For real signal, X(k)=X*(-k), the PSD vlaues at positive and negative frequency are the same. Very often, we concern only positive frequency, the power sensity of both + and - frequencies are combined so that there is a factor of 2.
Therefore, when we are of interested in PSD of real signal, we use P(k) = 2 * X(k)^2 / N (for +ve freq).
##### 댓글 수: 2없음 표시없음 숨기기
L'O.G. 2022년 4월 22일
편집: L'O.G. 2022년 4월 22일
Thanks, but I am not interested in and didn't ask about the power spectrum density. You also didn't address everything.
Chunru 2022년 4월 22일
It usually make no sense to use 2|X(k)|/M. The P(k) = 2 * X(k)^2 / N is the power spectum density estimation that you may have confused with 2|X(k)|/M.
BTW, I cannot address everything like anyone.

댓글을 달려면 로그인하십시오.

Walter Roberson 2022년 4월 22일
편집: Walter Roberson 2022년 4월 22일
For a single-sided FFT, is it correct to multiply the FFT by 2, if so why?
No, it is not.
When you use the analytic fourier transform of a real-valued signal, then the single-sided fourier transform is twice the analytic fourier transform restricted to positive frequencies.
But that is the analytic fourier transform, not the discrete fast fourier transform -- and FFT means "Fast Fourier Transform" not "Fourier Transform".
For the discrete fourier transform, you have to extract the real part of the fft() output before multiplying. https://dsp.stackexchange.com/questions/43366/difference-between-single-sided-and-double-sided-amplitude-spectrum
Would you take the absolute value in taking a single-sided FFT and then the real and imaginary components as in the following example?
No, you would not. abs() is guaranteed not to have any imaginary component afterwards (or, to put it another way, that the imaginary component would be all zero.) There would not be any point in taking the imaginary component of the output of abs()
##### 댓글 수: 3이전 댓글 1개 표시이전 댓글 1개 숨기기
Walter Roberson 2022년 4월 22일
I wrote the wrong thing at that point. It is the positive frequency information that you need to extract, which is the first half of the fft() results (possibly omitting the first entry, as that entry corresponds to frequency 0)
2 * F(2:ceil(end/2))
Chunru 2022년 4월 22일
The analytic signal is complex. Its Fourier transform of it has two sided specrum defined (but the negative part IS 0).
When dealing with spectrum of a real signal. The spectrum magnitude is symetric on +ve and -ve freq. Therefore one sided spectrum can be used to represented the whole spectrum. If one is talking about power spectrum, then conventially we multiply by 2 on the positive freqency so that the total power (integration under the spectrum) accounts both the +ve and -ve freq. This can be handy when one is to find the total power over certain bandwidth (say f1 to f2). The integration of P(f) over f1 to f2 give the signal power over that freq range. This is meaningful because in analysing real signal, we rarely talking about -ve freq.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

R2021b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by