DSPRelated.com
Forums

FFTs of FFTs

Started by jaso...@gmail.com June 24, 2006
Jerry Avins wrote:
> dbd wrote: > ... > > If you are really calculating the magnitude spectrum of the first fft, > > as you said, the DC term of the magnitude spectrum of the first fft is > > the square root of the square of the sum of the inputs to the first > > fft. ... > > Not so. Depending on scaling, the DC term is the sum of the inputs, > their arithmetic mean, or something between. There is no squaring, > rooting, or other non-linear operation involved. > > Jerry
Jerry, Mr Burnst presented code:
>> S = flipud(specgram(signal, 512, 11025, hamming(512))); >> S = abs((S .* conj(S) / 512)).^2;
There seem to be (at least) three topics in this thread: 1) MrBurnst's stated magnitude spectrum statement to which I began by responding. 2) MrBurnst's original code which Martin Eisenberg noted is not really the magnitude spectrum. 3) The hypothetical subject FFTs of FFTs into which most seem to have log between the fft's The code: S = flipud(specgram(signal, 512, 11025, hamming(512))); S = abs(S / 512)); would give a magnitude spectrum via squares and square roots. MrBurnst's code includes even more multiplies and squares. The log is nonlinear. Nonlinearities seem to abound. Magnitude spectrum implys squares and square roots. Your response to my post seems to refer to simply the complex ffts of complex ffts. What an interesting new idea for the subject "FFTs of FFTs"! If we want to start in on that subject maybe we need a new thread! But what should we call it? Dale B. Dalrymple
First of all, thanks to all of you, I'm really learning a lot in this
group!
As I said, I'm trying to implement a paper mentioned in this "thread"
before,
http://www.csis.ul.ie/dafx01/proceedings/papers/marchand.pdf

their proposed procedure is to "[...] consider the magnitude spectrum of
the
Fourier transform of the magnitude spectrum � limited to positive
frequencies � of the Fourier transform of the signal."

The code I first posted was a little (to say the least) flawed, so here is
where I'm at now (in matlab):

% ************************************************************
% this returns the windowed complex spectrum of the signal
S = flipud(specgram(signal, 512, 11025, hamming(512)));

% this should then be it's magnitude spectrum
S = abs(S).^2 / 512;

temp = [];
for i=1:size(S,2)
	
    % take current frame
    curr = S(:,i);
    
    % substract its mean
    curr = curr - mean(curr);
    
    % compute fft (zero-padded to 2048 points)
    S2 = fft(curr, 2048);
    
    % compute the magnitude spectrum of that
    S2 = abs(S2).^2 / 2048;
    
    % substract its mean
    S2 = S2 - mean(S2);
    
    % take the first half
    S2 = S2(1:1025);

	% look for the position of the maximum
    temp = [temp max(find(S2 == max(S2)))];
    
end

plot(temp);

%*************************************


this seems to work, allthough I haven't quite figured out how to 
conovert the values in "temp" to a frequency measure for pitch description
...
dbd wrote:
> Jerry Avins wrote: >> dbd wrote: >> ... >>> If you are really calculating the magnitude spectrum of the first fft, >>> as you said, the DC term of the magnitude spectrum of the first fft is >>> the square root of the square of the sum of the inputs to the first >>> fft. ... >> Not so. Depending on scaling, the DC term is the sum of the inputs, >> their arithmetic mean, or something between. There is no squaring, >> rooting, or other non-linear operation involved. >> >> Jerry > > Jerry, > > Mr Burnst presented code: >>> S = flipud(specgram(signal, 512, 11025, hamming(512))); >>> S = abs((S .* conj(S) / 512)).^2; > > There seem to be (at least) three topics in this thread: > 1) MrBurnst's stated magnitude spectrum statement to which I began by > responding. > 2) MrBurnst's original code which Martin Eisenberg noted is not really > the magnitude spectrum. > 3) The hypothetical subject FFTs of FFTs into which most seem to have > log between the fft's > > The code: > S = flipud(specgram(signal, 512, 11025, hamming(512))); > S = abs(S / 512)); > would give a magnitude spectrum via squares and square roots. > > MrBurnst's code includes even more multiplies and squares. > > The log is nonlinear. > > Nonlinearities seem to abound. Magnitude spectrum implys squares and > square roots. Your response to my post seems to refer to simply the > complex ffts of complex ffts. What an interesting new idea for the > subject "FFTs of FFTs"! If we want to start in on that subject maybe we > need a new thread! But what should we call it?
I didn't address any of those issues. Unfortunately, I wasn't careful to exclude them from the scope of my remarks. The gist of what I tried to convey is that the DC term of a FT is related to the sum or average of the samples, not to RMS. MrBurnst, Consider that unless all (real) samples are zero, the RMS must be a positive value. The average DC of two samples, 1 and -1 is zero. The RMS is sqrt(2). Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
dbd wrote:
> > Your response to my post seems to refer to simply the > complex ffts of complex ffts.
those are the most fundamental FFTs to talk about.
> What an interesting new idea for the > subject "FFTs of FFTs"! If we want to start in on that subject maybe we > need a new thread! But what should we call it?
google around, we've discussed the topic before. one thing i learned only from comp.dsp: the unitary DFT (the one with 1/sqrt(N) in it and inverse), like the unitary continuous Fourier Transform, is an isomorphism (a structure preserving mapping of something to another thing of the same kind) and is also *quantitatively* circular with period = 4. that means you can create, from an arbitrary element in that class of "things" that DFTs work on, an eigenvector that has unity gain eigenvalue (that is, you transform the thing and you get thge same thing as a result). given any x0[n], construct x1[k] = DFT{ x0[n] } x2[k] = DFT{ x1[n] } x3[k] = DFT{ x2[n] } we know that x0[k] = DFT{ x3[n] } . then, x[n] = x0[n] + x1[n] + x2[n] + x3[n] is such a thing that DFT{ x[n] } = x[k] the thing gets mapped to itself. r b-j