[EDIT: 20180307, expanded some details] Globaly no, windowing does NOT affect Parseval's theorem (because theorems are only affected, more precisely not applicable, when their hypotheses are not met), in the sense that the equality in energy relates a signal (windowed $x_w$ or not, $x$, resp.) and its Fourier transform (from a windowed signal, $X_w$ or not $X$, resp.). In mathematical terms, you have $\|x\|^2 = \|X\|^2$
and $\|x_w\|^2 = \|X_w\|^2$, but in general, $\|x\|^2 \neq \|X_w\|^2$. The question is: can we correct that, simply? Globaly no again, but approximately so, yes.
First, let us take a little step back. Parseval's theorem, sometimes called Rayleigh's identity or energy theorem, is part of a more generic theorem, the Plancherel theorem, itself related to the Bessel inequality: in an Hilbert space, if $e_{1},e_{2},\ldots$ is an orthonormal sequence, and $\left\langle \cdot,\cdot\right\rangle$ is the scalar product, then:
$$\sum _{k=1}^{\infty }\left\vert \left\langle x,e_{k}\right\rangle \right\vert ^{2}\leq \left\Vert x\right\Vert ^{2}\,.$$
The main message here is that, even for orthogonal transforms, energy preservation is not granted.
There are many flavors of Fourier transforms: continuous, discrete time, discrete, Fourier series, and many others. For the first ones it happens that, their properties entail that, for (many) Fourier transforms, the Bessel equality is indeed an equality (with mild hypotheses on the function).
This is quite important in applications, and their associated algorithms. In simpler words: whenever one removes stuff from the Fourier domain (filtering, deconvolution, restoration, etc.), s(h)e removes the same stuff in the original domain (time, space). Energy conservation, even approximately, plays a great role in algorithmic stability, inverses, etc.
Coming back to windows, their uses in signal processing are legion: apodization data, limiting artifacts, providing approximate stationarity to non-stationary signals, reducing leakage, yielding running/short-time transforms, allowing parallel processing, etc.
So, the present question is, for is the window for, and what are its effects? The span is large. A uniform window is likely to have little effect. A very concentrated window would have a tremendous influence, because it will only concentrate on some signal samples, important of not.
Simply put: take a uniform window, it does not affect samples, and Parseval-Plancherel is preserved. take a null window except on one sample, the energy could vary a lot, depending on where the window is located. At one extremity, if you applied a zero window, the signal would be zero, with zero energy, so you does retain the energy of the original signal. Somehow, the window effect is related to both the window shape, and signal's properties.
Now, when one is sliding windows, like in time-frequency/multirate filter bank processing, each sample at the end sees the window passing, and get an equal share of amplitude. For properly chose windows (with unit energy), correction factors is more easily applied.
For a single signal frame, the outcome will be signal/window dépendant a lot. Let us concentrate on discrete signals $x$ and a given window $w$.
For the FFT side, the window is uniform, and the relationship between the signal energy and the FFT version is linear, as shown in the following graph:
clear;close all;
nSample = 16^2;
nRealization =16^2 ;
nRandWindow = 2^6;
matrixResultSignalEnergy = zeros(nRealization,1);
matrixResultFourierEnergy = zeros(nRealization,1);
matrixResultFourierEnergyRandWindow = zeros(nRealization,1);
for iRealization = 1:nRealization
data = randn(nSample,1);
dataFFT = fft(data);
matrixResultSignalEnergy(iRealization) = norm(data).^2;
matrixResultFourierEnergy(iRealization) = norm(abs(dataFFT)).^2/nSample;
for iRandWindow = 1:nRandWindow
randWindow = rand(nSample,1);
randWindow = randWindow/norm(randWindow);
matrixResultFourierEnergyRandWindow(iRealization,iRandWindow) = norm(abs(fft(data.*randWindow))).^2/nSample;
end
end
figure(1);clf;hold on
plot(matrixResultSignalEnergy,matrixResultFourierEnergy,'x');
xlabel('Signal energy');
ylabel('Fourier energy');
grid on;axis tight
figure(2);clf;hold on
% errorbar(matrixResultSignalEnergy,(matrixResultFourierEnergy),std(matrixResultFourierEnergy));
errorbar(matrixResultSignalEnergy,mean(matrixResultFourierEnergyRandWindow,2)*nSample,std(matrixResultFourierEnergyRandWindow')/sqrt(nSample),'.');
grid on;axis tight
grid on;axis tight
Details follow. For a uniform window, the dependence is strictly linear:
So, no big deal. But for non uniform windows, what can happen? For a Gaussian random data, and a window drawn from a positive random, unit energy uniform distribution, you get:
So, the slightly dispersed cloud tells you that there is not single factor you can apply in general to preserve energy with a window, although the relation is close to linear.
In practice, you could employ a more flat window, which reduces the portion of samples (at the edge) that are distorted with the window. Raided cosine windows can be useful in this option.
From an alternative side, DSP people have developed techniques to compensate the amplitude or energy variations, as described in: