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

Click For Summary

Discussion Overview

The discussion revolves around selecting appropriate values for N, N1, and N2 in MATLAB while using the fft function to compute the discrete Fourier transform of a box signal. The focus is on understanding the implications of these choices in the context of periodic signals and their representation in a discrete format.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • One participant seeks guidance on how to choose values for N, N1, and N2, expressing uncertainty about what constitutes one period of the box signal.
  • Another participant questions the definition of a "box signal" and inquires about any preferred conditions for the endpoints of the sample set and constraints on N as dictated by the fft function.
  • A participant describes the box signal as resembling a rectangle plotted with stem, indicating a lack of a formal formula but emphasizing that it consists of a vector with several ones.
  • There is a discussion about whether there are constraints on the ratio of ones to zeros in the box signal, with one participant suggesting that the choice of N, N1, and N2 must be justified based on the fft function's documentation.

Areas of Agreement / Disagreement

Participants express differing levels of understanding regarding the constraints and definitions related to the box signal and the fft function. There is no consensus on the specific values for N, N1, and N2 or the conditions that must be met for their selection.

Contextual Notes

Participants have not reached a clear agreement on the definitions and constraints surrounding the box signal and the fft function, which may affect their ability to justify their choices for N, N1, and N2.

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

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
17
Views
6K
Replies
3
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K