Fourier analysis in matlab

In summary, the fft function expects a periodic signal and allows you to specify the number of sample points (N) to use in the calculation. You must justify your choice of N by providing a reason for choosing that number.
  • #1
Huumah
28
0
Hi

I'm trying to use the fft function in MATLAB to compute the discrete Fourier transform of a box signal. I'm told to assume that the signal x[n] is periodic with period N and the vector contains one period.

x[n]= box [n]


I'm am going to use these commands to make my vector

x=zeros(1,N)

x(N1,N2)=1


But I'm asked to justify my choise of N, N1 and N2

And I can't really figure out what values to pick for N, N1, N2.

If my vector is for example [ 0 0 0 0 1 1 1 0 0 0]
does that count as one period?
 
Physics news on Phys.org
  • #2
Do you have a definition for "box signal"?

Do you know of any preferred conditions for the end points of the sample set? Do you know of any constraints placed on N (the number of sample points), by the fft function?
 
  • #3
The box signal is just like a rectangle plotted with stem. i really don't have the formula but it just a vector with a few ones in it.

No i get to choose all my N,N1 and N2 values. But i have to justify why i choose them.
It's just to test the fft function
 
  • #4
Huumah said:
The box signal is just like a rectangle plotted with stem. i really don't have the formula but it just a vector with a few ones in it.
So, no particular constraints on the ratio of 1's to 0's then?
No i get to choose all my N,N1 and N2 values. But i have to justify why i choose them.
It's just to test the fft function

This is why I asked about constraints. Look at the documentation for the fft function and see if you can spot any constraints mentioned there; you are not free to pick just any old value for N.
 
  • #5



Hello,

Thank you for reaching out regarding Fourier analysis in MATLAB. First, to address your question about the values for N, N1, and N2, these are simply variables used in the code to represent the length of the signal and the indices of the vector. The choice of these values will depend on the specific signal you are analyzing and what you are trying to achieve with the analysis. For example, N could be the length of your signal, N1 could represent the starting index, and N2 could represent the ending index. It is important to choose values that accurately represent your signal and allow you to perform the desired analysis.

In terms of justifying your choice of N, N1, and N2, it would be helpful to explain what you are trying to achieve with the analysis and how these values contribute to that goal. Additionally, you may want to consider the Nyquist-Shannon sampling theorem, which states that in order to accurately represent a signal, the sampling frequency must be at least twice the highest frequency component of the signal. This may impact your choice of N and the number of samples you need to include in your signal.

Regarding your example of a box signal, [0 0 0 0 1 1 1 0 0 0], this does count as one period since it repeats itself after 10 samples. However, keep in mind that the accuracy and resolution of your Fourier analysis will also depend on the number of samples included in your signal. In general, the more samples you have, the more accurate your analysis will be.

I hope this helps clarify some of your questions. Best of luck with your analysis!
 

1. What is Fourier analysis and why is it important?

Fourier analysis is a mathematical technique used to decompose a signal into its individual frequency components. It is important because many natural signals, such as sound and images, can be represented as a combination of different frequencies. Understanding the frequency components of a signal can help in tasks such as signal processing, noise reduction, and pattern recognition.

2. How is Fourier analysis performed in MATLAB?

In MATLAB, Fourier analysis can be performed using the fft function. This function takes in a signal as input and returns its discrete Fourier transform, which is a representation of the signal in the frequency domain. The fft function can also be used to perform inverse Fourier transforms to convert a signal back to the time domain.

3. What is the difference between discrete and continuous Fourier transforms?

A discrete Fourier transform (DFT) is used to analyze signals that are sampled at discrete intervals, such as digital signals. It produces a discrete set of frequency components. On the other hand, a continuous Fourier transform (CFT) is used for signals that are continuous, such as analog signals. It produces a continuous spectrum of frequency components.

4. Can Fourier analysis be applied to any type of signal?

Yes, Fourier analysis can be applied to any type of signal as long as it can be represented as a function of time. This includes signals from various fields such as engineering, physics, biology, and finance.

5. How can Fourier analysis be used in image processing?

In image processing, Fourier analysis can be used to enhance images by removing noise and other unwanted artifacts. It can also be used for feature extraction and pattern recognition in images. Additionally, Fourier analysis can be used for image compression, where the frequency components of an image are compressed to reduce its file size.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
753
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
993
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
163
  • Engineering and Comp Sci Homework Help
Replies
1
Views
938
Back
Top