Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8419121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:31:27+00:00 2026-06-10T02:31:27+00:00

I am using the FFT function in Matlab in an attempt to analyze the

  • 0

I am using the FFT function in Matlab in an attempt to analyze the output of a Travelling Wave Laser Model.

The of the model is in the time domain in the form (real, imaginary), with the idea being to apply the FFT to the complex output, to obtain phase and amplitude information in the frequency domain:

%load time_domain field data
data = load('fft_data.asc');

% Calc total energy in the time domain
N = size(data,1);
dt = data(2,1) - data (1,1);
field_td = complex (data(:,4), data(:,5));


wavelength = 1550e-9;
df = 1/N/dt;
frequency = (1:N)*df;
dl = wavelength^2/3e8/N/dt;
lambda = -(1:N)*dl +wavelength + N*dl/2;

%Calc FFT
FT = fft(field_td);
FT = fftshift(FT);
counter=1;
phase=angle(FT);
amptry=abs(FT);
unwraptry=unwrap(phase);

Following the unwrapping, a best fit was applied to the phase in the region of interest, and then subtracted from the phase itself in an attempt to remove wavelength dependence of phase in the region of interest.

for i=1:N % correct phase and produce new IFFT input
    bestfit(i)=1.679*(10^10)*lambda(i)-26160;
    correctedphase(i)=unwraptry(i)-bestfit(i);
    ReverseFFTinput(i)= complex(amptry(i)*cos(correctedphase(i)),amptry(i)*sin(correctedphase(i)));
end

Having performed the best fit manually, I now have the Inverse FFT input as shown above.

pleasework=ifft(ReverseFFTinput);

from which I can now extract the phase and amplitude information in the time domain:

newphasetime=angle(pleasework);
newamplitude=abs(pleasework);

However, although the output for the phase is greatly different compared to the input in the time domain

blue=output of phase in time domain after inverse FFT back

the amplitude of the corrected data seems to have varied little (if at all!),

enter image description here
enter image description here

despite the scaling of the phase. Physically speaking this does not seem correct, as my understanding is that removing wavelength dependence of phase should ‘compress’ the pulsed input i.e shorten pulse width but heighten peak.

My main question is whether I have failed to use the inverse FFT correctly, or the forward FFT or both, or is this something like a windowing or normalization issue?

Sorry for the long winded question! And thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:31:28+00:00Added an answer on June 10, 2026 at 2:31 am

    You’re actually seeing two effects.

    First the expected one goes. You’re talking about “removing wavelength dependence of phase”. If you did exactly that – zeroed out the phase completely – you would actually get a slightly compressed peak.
    What you actually do is that you add a linear function to the phase. This does not compress anything; it is a well-known transformation that is equivalent to shifting the peaks in time domain. Just a textbook property of the Fourier transform.

    Then goes the unintended one. You convert the spectrum obtained with fft with fftshift for better display. Thus before using ifft to convert it back you need to apply ifftshift first. As you don’t, the spectrum is effectively shifted in frequency domain. This results in your time domain phase being added a linear function of time, so the difference between the adjacent points which used to be near zero is now about pi.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding use of FFT. Using function getBand(int i) with Minim
I am using the FFT function in NumPy to do some signal processing. I
I'm using a FFT on audio data to output an analyzer, like you'd see
I did fft in matlab and in java using jtransforms library but the results
I am using the FFT to evaluate a polynomial at certain points so that
I am trying to implement a 2D FFT using 1D FFTs. I have a
I'm using the threaded version of FFTW (a FFT library) to try to speed
Using CI for the first time and i'm smashing my head with this seemingly
I am developing app with finding audio frequency by using FFT. In my app,
I'd like to generate some code using MATLAB Embedded Coder that runs an fft2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.