Files
matlab/ofdm/wiener_fd.m
T
jens b3924ead7d - added Wiener stuff
git-svn-id: http://moon:8086/svn/matlab/trunk@40 801c6759-fa7c-4059-a304-17956f83a07c
2015-04-29 19:23:29 +00:00

15 lines
442 B
Matlab

function [xs, g, PSDx, PSDy] = wiener_fd(x, y, sigma_noise)
N = length(x);
Y = fft(y);
X = fft(x);
PSDx = 1/N*abs(X).^2; % spectral power
PSDy = 1/N*abs(Y).^2; % spectral power
k = sqrt(sum(PSDx)./sum(PSDy))
% fourier transform of the wiener filter
G = PSDx./(PSDx + sigma_noise.^2);
% perform the filtering over the fourier
G = 1/k*G.*PSDx./PSDy;
xs = ifft(G.*Y);
g = ifft(G);