1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: THz-TDS Fast Fourier Analysis in MATLAB

  1. Nov 1, 2011 #1

    Basically I have some Terahertz time-domain-spectroscopy which I'm trying to analyse.

    The data that I have has Voltage and "Delay length" within the array.

    Apparently I can convert the delay length to a time using t=(delay length)/c. Then I can do a fast fourier transform in MATLAB to swap things to the frequency domain.

    The column with the voltage data I have is called 'V' and I just fft(V); however, the data Iget out is strange. My final plot should be amplitude on the y afis and frequency along the x axis.

    Has anyone done anything like this before? Am I supposed to use both vectors in the array to do the transform?

    Best wishes
  2. jcsd
  3. Nov 8, 2011 #2
    Hi Pene1 (curious name, by the way)

    I found this topic searching for other step in this long process of THz-TDS, but I might be able to help you at this step.

    The data that you obtain after executing fft(V) is the Spectrum, but with the frequencies disorganized due to the internal behavior of the FFT algorithm.
    In order to short them you should use the command:
    >> fftshift(fft(V)/npoints);
    After this you'll obtain the spectrum properly organized and with the correct magnitude (check the normalization by npoints)
    Another thing that you should consider is what you want to obtain. I assume that you want to obtain the power spectrum.
    This spectrum should be
    >> abs(fftshift(fft(V)/npoints));

    I hope you'll find this usefull
  4. Nov 9, 2011 #3
    Super helpful thanks; I do have another query... my fft gives complex numbers, I read somewhere that to get the power spectrun you multiply by the complex conjugate in order to get a real number - is that what you have done?

    I might be able to help with your step if you let me know what's troubling you?

  5. Nov 9, 2011 #4
    FFT is an application over a complex space. Don't worry about the imaginary part because physics uses to happen in ℝ^3 and you should take the modulo of the data (in matlab is the built in function "abs"). Unpleasantly there are several options to take the modulo or magnitude of the signal (I discovered it in Origin's Lab help).

    Luckily I solved my problem, but thank you in any case.
    Recently we started with a THz-TDS system from Ekspla and I wanted to reproduce their data to check my algorithm.
    This guys gave you the power spectrum normalized as MSA (Mean Squared Amplitude) or that is what I think after looking for more information.
    So that the power spectrum can be evaluated as follows:
    let me suppose that X=fftshift(fft(V))/nptos


    >>PoweSpectrum(as MSA)=(real(X).^2+imag(x).^2)/nptos^2;
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook