Files
matlab/ofdm/txwin_eval.m
T
jens ca31e66851 - return correct window
git-svn-id: http://moon:8086/svn/matlab/trunk@31 801c6759-fa7c-4059-a304-17956f83a07c
2015-04-19 18:41:56 +00:00

10 lines
370 B
Matlab

function [p Nt wng] = txwin_eval(Nu, Ng, Alpha)
Nfft = Nu; % FFT size
CP = Ng; % Nb. samples in Cyclic Prefix
%Alpha = 1/32; % RX Alpha
Nt = 2*round(Nfft*Alpha/2); % Nb. samples in taper region
p = 1/2*(1+cos(pi*[-Nt+1/2:Nt-1/2]/Nt)); % Raised-Cosine in TD
p = [p(1:Nt), ones(1,Nfft+CP-Nt), p(Nt+1:2*Nt)]; % Add ones in middle
wng = [p(1:Nt), ones(1, Ng-Nt)];