# Calculating N for DFT

We want to compute an N-point DFT of a one-second duration compact disc (CD) audio signal x[n], whose sample rate is $$f_s = 44.1Khz$$ with a DFT sampling of 1 Hz.

(a) What is the number of necessary x[n] time samples N?

(b) what is the time duration of the x[n] sequence measured in seconds?

I said:

$$f_s = 44100 hz$$ $$f_o = 1 hz$$

(a) $$N = f_s / f_o = 44100 / 1 = 44100?$$

(b) $$T_s * N = (1/f_S) * N = (1/44100) * 44100 = 1 sec?$$

Could I call $$f_0$$ the fundamental frequency of the DFT and assert that this frequency (1 hertz) corresponds exactly to a time period equal to the length of the x[n] sample range (1 second)?

Is that the definition of the fundamental frequency of DFT...that its the frequency corresponding to the entire sample time period of x[n] of length N...which also happens to be the smallest frequency increment of DFT of which there are exact N frequency buckets that add up to the sampling frequency.

• for one second of one channel of a CD would be 44100 samples. then $N \ge$ 44100. i might suggest rounding up to the next power of 2 to $N=$ 65536 and zero-padding the difference. – robert bristow-johnson Apr 19 '19 at 3:57
• thanks for the suggestion, Incidentally, do fft library function generally right pad zeros until it gets a power of 2 size? I was just using dft... but fft seems easier since its a built in library function. – pico Apr 19 '19 at 13:12
• there are a few different FFT libs, so the answer to your question is neither "yes" nor "no" in general. specifically for FFTW (which is considered the state-of-the-art), the answer is "no". Listed in their feature set: "Arbitrary-size transforms. (Sizes with small prime factors are best, but FFTW uses O(N log N) algorithms even for prime sizes.)" And using just the DFT that you can code yourself is fine if you're doing it for a small $N$, but it becomes a real problem once $N\ge4096$. – robert bristow-johnson Apr 19 '19 at 19:23