How Can MATLAB Be Used to Analyze Signal Duration and Frequencies Using DFT?

  • Context: Engineering 
  • Thread starter Thread starter marco02
  • Start date Start date
  • Tags Tags
    Dft Exercise Matlab
Click For Summary
SUMMARY

This discussion focuses on using MATLAB to analyze signal duration and frequencies through the Discrete Fourier Transform (DFT). The user calculates the duration of a signal using the formula T=N/fs, where N is the number of samples (512) and fs is the sampling frequency. The user employs MATLAB commands such as fft and fftshift to plot the Fourier transform and identify frequencies from the resulting peaks. The discussion also highlights the importance of recognizing that Fourier transform plots display both positive and negative frequencies.

PREREQUISITES
  • Understanding of MATLAB programming and syntax
  • Familiarity with Discrete Fourier Transform (DFT) concepts
  • Knowledge of signal processing principles, particularly sinusoidal signals
  • Experience with MATLAB plotting functions
NEXT STEPS
  • Explore MATLAB's fft function and its parameters in detail
  • Learn about signal sampling and the Nyquist theorem
  • Investigate techniques for identifying multiple frequencies in complex signals
  • Study the implications of negative frequencies in Fourier analysis
USEFUL FOR

Signal processing engineers, MATLAB users, and researchers analyzing frequency components in signals will benefit from this discussion.

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

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 1 ·
Replies
1
Views
12K
  • · Replies 1 ·
Replies
1
Views
3K