Reputation: 475
I'm using Libgdx library for do FFT from accelerometer signal in an Android app.
I need to have my signal normalized because I find the dot product of two signal and I want its max value 1.
With "normalization" i mean that the Euclidean Norm of signal is 1. (Euclidean norm is square root of the sum of product of analogue components of vector. When I've found its value, for normalize signal I divide all components of vector by the norm value).
Dot product is in the frequency spectrum, so if I normalize the signal in time domain, the frequency spectrum representation is not euclidean normalized, then I'll do again the euclidean normalization. (I consider already after the FFT the normalization by 1/N scale factor, I think it not influence my problem, maybe).
Which are differences if I do Euclidean Normalization before and after FFT, or I do it only after FFT?
EDIT 1: Consider also that FFT in Libgdx library is Complex DFT, and I've real signal in input than the output signal is symmetric for 0 to (N/2)-1 and N/2 to N. I verify that Parseval's Theorem is verified if I apply no window (like Hamming's window). So, if I use 0 to N/2-1 components of signal, will I obtain a dot product between 0 and 1?
Upvotes: 0
Views: 5421
Reputation: 3466
Hm, seems nobody is answering this. Not sure why, but I will chime in briefly.
Let f[n] be the signal, F[k] be the Fourier transformed version (obviously discrete).
By Parseval's theorem, we have that:
norm(f[n]) = (1/N) norm(F[k])
where N is the number of samples. By homogeneity of Fourier transform, if g[n]=a f[n], then G[k] = a F[k].
Finally, combining these two, in order to get norm(F[k]) to be 1, what you need to do is divide by:
(1) norm(F[k]) = N norm(f[n])
Either in time or frequency domain.
Similar, if you want norm(f[n]) to be 1, what you need to do is divide by:
(2) norm(f[n]) = (1/N) norm(F[k])
And finally:
Which are differences if I do Euclidean Normalization before and after FFT, or I do it only after FFT?
It does not make a difference whether you divide before or after because Fourier transform is linear (and homogeneity property holds). However, if you want the time domain to have norm of 1, then you should use the constant in (2). On the other hand, to get the frequency domain to have norm of 1, you should use constant in (1).
Upvotes: 6