www.pudn.com > tfarma10.rar > fft_evenodd.m, change:2003-08-07,size:1853b


function [xe, xo]= fft_evenodd(x)
% function [xe, xo]= fft_evenodd(x)
%   This file is part of the TFPM toolbox v0.5 (c)
%   michael.jachan@tuwien.ac.at and underlies the GPL.
% 
% Computes the even (xe) and odd (xo) parts of an fft-frame-signal
% x[n] as 
%
% xe[n]= (x[n] + x^*?[-n])/2,
% xo[n]= (x[n] - x^*?[-n])/2.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;tfpm;
N= 256;
x= j*[4 1 2 3 2 0 0 0].';
x= randn(N, 1)+j*randn(N, 1);
figure(97);plot(x);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x= x(:);
X= [x(1); flipud(x(2:end))];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(98);plot(X);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%xe= (x + conj(X))/2;
%xo= (x - conj(X))/2;

xe= (x + X)/2;
xo= (x - X)/2;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(98);
subplot(2, 1, 1);plot(xe);
subplot(2, 1, 2);plot(xo);

xe+xo-x
xe-xo-X


x= fft_causal(randn(233, 1));
[xe, xo]= fft_evenodd(x);
max(x-xe.*fft_u(length(x)))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%