Re: Problem with Matlab code...
What I'm trying to achieve with the summation is a time domain waveform that is made up of all the frequencies that I can extract from the real portion of the FFT result.
Here is my understanding, please correct me if I've got it all wrong!
As the sampling frequency is 44.1K, therefore the highest frequency I can include in the time domain is fs/2 = 22.05K
As there are 2048 samples, then the center frequency of adjacent FFT bins will be separated by fs/2048 = 21.5332 Hz.
Meaning I will generate a time domain data set, 2048 samples in length, containing 1024 sine waves, each with a frequency that corresponds to a center frequency of one of the 1st 1024 FFT bins, each one spaced by 21.5332 Hz.
The time domain waveform shown in the plot is not what I expected the summation of these waves to look like. Note the plot is time domain, not frequency.
Vince.
Quoting shwaip
Well...you're calculating what you're claiming to be the FFT over a series of ones of length N.
But it looks to me like you're summing over frequency (i=br:br:fs/2), where you should be summing over n (n=0:N-1). They may be equivalent, but I've _never_ seen that version.