# [Moved] Reasons to Choose a Specific FFT Formula

Status
Not open for further replies.

#### sona_

##### Junior Member level 1
hello
m a newbie on delsig..can anyone tell
(1) why formula chosen is y = 4*sin(2*pi*tone_bin/Nfft*t);for sine wave
(2) why is t chosen as t = [0:Nfft-1] why not t = [0:Nfft];
thanks all

#### barry

##### Advanced Member level 5
Because 0:nfft will be 1 greater than desired. zero is, in fact, a number. If you count from zero to one, that's two numbers, not 1.

sona_

### sona_

Points: 2

#### sona_

##### Junior Member level 1
yes...got the answer...and what about the formulae for sine wave

#### barry

##### Advanced Member level 5
yes...got the answer...and what about the formulae for sine wave

#### sona_

##### Junior Member level 1
the input as y = 4*sin(2*pi*tone_bin/Nfft*t); why is the frequency chosen as tone bin/nfft

#### barry

##### Advanced Member level 5
the input as y = 4*sin(2*pi*tone_bin/Nfft*t); why is the frequency chosen as tone bin/nfft

I have no idea. You start out asking about FFTs, and then you post a single equation which has nothing to do, as far as I can tell, with computing an fft.

You have obviously posted one line from a more complex calculation. I'm afraid I've left my mind-reading hat at home.

#### sona_

##### Junior Member level 1
ya i would have posted the complete program..actually i was talking about delsig toolbox in which all sine wave assume the same formulae...one of the example is (which quantizes the sine wave using delsig toolbox)

Code dot - [expand]1
2
3
4
5
6
7
8
9
10
nLev = 8;          % Number of quantizer levels
M = nLev-1      % Number of steps
Nfft = 2^13;    % Record length
tone_bin = 31;  % prime wrt Nfft
t = [0:Nfft-1];
y = 4*sin(2*pi*tone_bin/Nfft*t);
v = ds_quantize(y, nLev);
numOfSamples = 400;
n=1:numOfSamples;
plot(t(n), y(n), 'b');

Last edited by a moderator:

#### sona_

##### Junior Member level 1
i guess since we want the frequency to be around a certain bin say 31 in above case hence we select tone bin as the frequency to be selected over the entire nfft length...pl correct if i am wrong

Status
Not open for further replies.