Questions about FFT (and applying it to determine power spectral de... (2024)

TL, DR section:

Question 1: Why isn't the scaling of ( 2 / numberOFdataPOINTS ) applied within the FFT algorithm.

Question 2: Is there any reason to use abs(fftSignal).^2 over fftSignal .* conj(fftSignal) to convert from amplitude spectral density to power spectral density?

Question 3: Which portion of the Fourier Space corresponds to the power spectral density, and what is the best way to zero pad the results to maintain resolution in this portion?

-----------------------------------------------------------------------------------------------------------------------------------------------

Intro

I've been trying to develop a script to show what the Autocorrelation Function (ACF) and Power Spectral Density (PSD) of Gaussian White Noise (GWN or WN) looks like. I expected the ACF to only show a strong correlation when there is no time shift, and this is the result I obtain when using the xcorr function. I also expect the PSD of the GWN to look like a (roughly) straight line for all frequencies that has an amplitude of the variance of the GWN divided by two. However, when I try and determine the PSD by taking the Fourier Transform (using the FFT function) of the ACF I do not get the expected result. I was hoping that someone could shed some light on the use of the FFT function because several sources use the same scaling factors without really explaining where they come from (and in different orders).

The following bullet points indicate what I think I know about the FFT algorith, but please correct me if anything is wrong.

1.) The values returned by FFT are the complex fourier coefficients

> ftSignal = fft(signal)

2. Taking the absolute value of the FFT results gives the magnitude of the fourier coefficients

> ftMag = abs(ftSignal)

-----------------------------------------------------------------------------------------------------------------------------------------------

Question 1:

I couldn't find it in the FFT documentation, but this website indicates what equation the FFT algorithm is using (Go to "click here" for a course outline. Then navigate to "week 7", then to "Numerical calculation of Fourier Series Coefficients (FFT)"). The author suggests that the algorithm that MATLAB uses returns the coefficients, but that they are off by a factor of (2 / numPts). Should the output of the Fourier Transform always be scaled by (2 / numPts) to generate the true coefficients?

> realFtSignal = (2 / length(signal)) * fft(signal);

In most of the mathworks documentation that I have viewed sometime between when the FFT is calculated and when it is plotted this scaling is introduced. For instance, in the FFT documentation the values returned from fft(signal) are immediately scaled by the number of data points; however, only after converting to magnitude is it scaled by the factor of 2. In the PSD estimation documentation is scaled by (2 / numPts) after converting to the magnitude. If the scaling always needs to be done, why is it not inculed in the FFT function itself? Also, why wasn't it most appropriate to apply the scaling right after doing the FFT in both articles (as in, why wait until after converting to magnitude)? (I am VERY confused about this 2 / N scaling as it is mentioned in many places, but is absent from the documentation leading me to wonder if this has been corrected in later releases of MATLAB)

-----------------------------------------------------------------------------------------------------------------------------------------------

Quetion 2:

I've seen it stated that without squaring, the magnitude of the fft is simply the amplitude spectral density; if we want the power spectral density then we need to square the magnitude. Is this correct?

Assuming the above is correct, is there any computational efficiency (time or accuracy) gained by using abs(x)^2 vs x .* conj(x)? Or was it simply different programming style associated with whoever wrote the documentation?

-----------------------------------------------------------------------------------------------------------------------------------------------

Question 3:

In the documentation, the second half of the values returned from the FFT are kept, while the first half of the values are discarded. Why is it that the Fourier transform produces a symmetric result that necessitates this? Is this equivalent to doing fftshift(ftSignal) and keeping just the first half?

Now I know that the algorithm performs best if the number of frequency bins is a multiple of 2. Therefore, we can do the following:

> nfft = 2^nextpow2(length(signal)); > ftSignal = fft(signal, nfft);

to ensure that the signal is zero padded before finding the FFT. However, will this affect the scaling that was discussed in question 1? Which of the following 2 commands would be correct:

> ftSignal = (2 / length(signal)) * fft(signal, nfft);

or

> ftSignal = (2 / nfft) * fft(signal, nfft);

I'm thinking the first one, because padding with zeros shouldn't affect the number of nonzero terms in the summation, but I just wanted to doublecheck to be sure.

These two articles on stack exchange discuss the benefits of padding the signal with zeros to be double its length (the next power of 2 of double its length, actually). They claim that doing so will leave the half of the PSD that is kept with the same resolution as the ACF that it was determined from. Is this an acceptable way to improve resolution? Or will this have other costs associated with it (like degraded numerical accuracy)?

I realize this has been a really long question, and I appreciate any time that you take to help me out!

Questions about FFT (and applying it to determine power spectral de... (2024)

References

Top Articles
1 Corinthians, CHAPTER 1 | USCCB
Bible Gateway passage: 1 Corinthians 15 - Revised Standard Version Catholic Edition
Express Pay Cspire
Spectrum Gdvr-2007
My E Chart Elliot
Yi Asian Chinese Union
Farmers Branch Isd Calendar
7543460065
Espn Expert Picks Week 2
Zachary Zulock Linkedin
R/Altfeet
Hope Swinimer Net Worth
Are They Not Beautiful Wowhead
Theresa Alone Gofundme
Uky Linkblue Login
Spider-Man: Across The Spider-Verse Showtimes Near Marcus Bay Park Cinema
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Sulfur - Element information, properties and uses
Craigslist Pearl Ms
Piedmont Healthstream Sign In
Blackboard Login Pjc
2011 Hyundai Sonata 2 4 Serpentine Belt Diagram
Violent Night Showtimes Near Johnstown Movieplex
Craigslist Brandon Vt
manhattan cars & trucks - by owner - craigslist
Best Restaurants Ventnor
Ipcam Telegram Group
Robert A McDougal: XPP Tutorial
Ff14 Laws Order
Persona 4 Golden Taotie Fusion Calculator
Jambus - Definition, Beispiele, Merkmale, Wirkung
Workboy Kennel
Sedano's Supermarkets Expands to Orlando - Sedano's Supermarkets
Craigslist Albany Ny Garage Sales
Helloid Worthington Login
Kelsey Mcewen Photos
Space Marine 2 Error Code 4: Connection Lost [Solved]
Mandy Rose - WWE News, Rumors, & Updates
Cox Outage in Bentonville, Arkansas
Nearest Ups Office To Me
Me Tv Quizzes
18 terrible things that happened on Friday the 13th
R/Moissanite
Energy Management and Control System Expert (f/m/d) for Battery Storage Systems | StudySmarter - Talents
Nami Op.gg
Avance Primary Care Morrisville
Kenner And Stevens Funeral Home
Satucket Lectionary
Mybiglots Net Associates
Gas Buddy Il
Upcoming Live Online Auctions - Online Hunting Auctions
Wvu Workday
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 5465

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.