Engineering MATLAB Exercise on DFT

AI Thread Summary
The discussion revolves around a MATLAB exercise involving two signals and their analysis using the Discrete Fourier Transform (DFT). For Signal 1, the user calculates the duration and identifies frequencies from the Fourier transform plot, confirming that the peaks represent the correct frequencies. For Signal 2, which contains multiple sinusoidal signals, the user faces challenges in identifying and ordering the frequencies from eight peaks, with guidance suggesting that fewer identified frequencies should be filled with the sampling frequency in the unused boxes. The importance of understanding the Fourier transform's symmetry, where each frequency has a corresponding negative peak, is emphasized. Overall, the conversation highlights the process of analyzing signals using MATLAB and the need for clarity in frequency identification.
marco02
Messages
1
Reaction score
1
Thread moved from the technical forums to the schoolwork forums
Homework Statement
ddòd
Relevant Equations
lsd
Good morning, I have an exercise with two points that gives a Matlab mat file in which are contained the samples of two measured signals and the variable fs indicating the sampling frequency

A)Signal 1 consists of two sinusoidal signals of which you are asked to calculate: -the duration ⇒ I thought is found by doing T=N/fs where N is the number of samples (in my case 512); -the two frequencies (enter in ascending order). I used the following Matlab commands to plot the Fourier transform:

s1=datafile1;
N=512;
f=(-fs/2):(fs/N):(fs/2-fs/N);
S1=fftshift(fft(s))
plot(f,abs(S1))

I got this
wUhj4DL.png


Is it right then to take as frequencies the ones I see in the two peaks(positive and negative with the same modulus)?

B)Signal 2 consists of the superposition of a larger number of sinusoidal signals. You are asked to identify the frequencies present by placing them in the boxes in ascending order(there are 6 boxes). If the number of frequencies identified is less than the number of boxes available, enter the value of the sampling frequency in the unnecessary boxes.

In the second case I get this
Wzp8PYX.png


How do I choose the frequencies now if I have 8 peaks?
The mat file is provided below



Thanks to those who will help me
 

Attachments

Last edited by a moderator:
Physics news on Phys.org

Similar threads

Back
Top