How to Choose Values for N, N1, and N2 in MATLAB for Fourier Analysis?

AI Thread Summary
When using the fft function in MATLAB for Fourier analysis of a box signal, it's essential to define the period N, and the indices N1 and N2 correctly. The box signal can be represented as a vector with a series of ones, such as [0 0 0 0 1 1 1 0 0 0], which constitutes one period. Justifying the choice of N, N1, and N2 involves understanding the periodicity of the signal and any constraints outlined in the fft documentation, as not all values are permissible. The ratio of ones to zeros in the signal does not impose specific constraints, but the overall choice must align with the requirements of the fft function. Proper justification for these values is crucial for accurate Fourier analysis.
Huumah
Messages
27
Reaction score
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
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?
 
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
 
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.
 

Similar threads

Back
Top