THz-TDS Fast Fourier Analysis in MATLAB

In summary, the data that is obtained after executing fftshift(fft(V)/npoints) is the spectrum, but it is disorganized due to the internal behavior of the FFT algorithm. To short the data, 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 to consider is what you want to obtain. I assume that you want to obtain the power spectrum. The power spectrum should be >> abs(fftshift(fft(V)/npoints)); and I hope you'll
  • #1
Pene1
2
0
Hello,

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
 
Physics news on Phys.org
  • #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
regards
 
  • #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?


nriqone said:
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
regards
 
  • #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

>>PowerSpectrum=abs(X)=sqrt(real(X).^2+imag(x).^2)/nptos;

>>PoweSpectrum(as MSA)=(real(X).^2+imag(x).^2)/nptos^2;
 
  • #5
,

Hello,

Thank you for sharing your project with us. It sounds like you are working on analyzing Terahertz time-domain-spectroscopy data using fast Fourier analysis in MATLAB. This is a common technique used in many scientific fields to convert time-domain data into frequency-domain data for further analysis.

Based on the information you have provided, it seems like you are on the right track with your approach. Converting the delay length to time and then using MATLAB's fast Fourier transform function (fft) on your voltage data should give you the desired results. However, it is important to make sure that your data is properly formatted and that the parameters you are using for the FFT are appropriate for your data set.

I would recommend double-checking your data and making sure that the units for delay length and voltage are consistent and correctly entered into MATLAB. You may also want to experiment with different FFT parameters, such as the window function or sampling rate, to see if that improves your results.

As for using both vectors in the array for the transform, it depends on the specific data set and what you are trying to analyze. In some cases, using both vectors may be necessary, while in others, only one may be needed. I would suggest consulting with a colleague or a mentor who has experience with this type of analysis to get some guidance on which approach would be best for your specific project.

I hope this helps and wish you the best of luck with your analysis. Please don't hesitate to reach out if you have any further questions or concerns. Best regards.
 

FAQ: THz-TDS Fast Fourier Analysis in MATLAB

How does THz-TDS Fast Fourier Analysis work in MATLAB?

The THz-TDS Fast Fourier Analysis in MATLAB uses the Fast Fourier Transform (FFT) algorithm to convert a time domain signal into its frequency components. This allows for quick and efficient analysis of terahertz signals and can be used for data processing and visualization.

What are the advantages of using MATLAB for THz-TDS Fast Fourier Analysis?

MATLAB offers a user-friendly interface and powerful tools for data analysis, making it an ideal platform for THz-TDS Fast Fourier Analysis. It also has a wide range of built-in functions and libraries specifically designed for signal processing, making it easier to perform complex operations and visualize results.

Can THz-TDS Fast Fourier Analysis in MATLAB handle large datasets?

Yes, MATLAB has the ability to handle large datasets, including terahertz signals. It also has options for parallel computing, allowing for faster processing of large datasets.

How accurate is THz-TDS Fast Fourier Analysis in MATLAB?

The accuracy of the analysis depends on the quality of the input data and the parameters used for the analysis. However, MATLAB has been extensively tested and is widely used in scientific research, providing reliable and accurate results.

Is THz-TDS Fast Fourier Analysis in MATLAB suitable for beginners?

While some programming experience may be helpful, MATLAB has a user-friendly interface and a vast amount of resources and tutorials available for beginners. It also has built-in functions and tools specifically designed for signal processing, making it a suitable platform for beginners to learn and perform THz-TDS Fast Fourier Analysis.

Similar threads

Replies
12
Views
1K
Replies
6
Views
2K
Replies
8
Views
861
Replies
2
Views
13K
Replies
2
Views
1K
Replies
2
Views
2K
Back
Top