- export corrected version of passband signal as wav file

git-svn-id: http://moon:8086/svn/matlab/trunk@56 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
2015-05-02 10:46:24 +00:00
parent d99b383b1e
commit 7dc26d6d0b
+10
View File
@@ -32,6 +32,7 @@ if (ndim == 2)
x = x.*exp(-j*(2*pi*(foff/fs_)*(0:len-1)'));
elseif (ndim == 1)
fprintf('Mode: Passband\n');
x = xwav - mean(xwav);
x = xwav.*exp(-j*(2*pi*(0.25-foff/fs_)*(0:len-1)'));
hlp = FIRCalcLowpass(12000/fs_, 15);
x = filter(hlp, 1, x);
@@ -54,6 +55,15 @@ x = x./max(abs(x));
xout = [real(x) imag(x)];
wavwrite(xout,fs,nbits,'ofdm_rx.wav');
% Modulate on carrier
xup = upsample(x, 4);
hlp = FIRCalcLowpass(0.25, 129);
xup = filter(hlp, 1, xup);
y = exp(j*2*pi.*(0:length(xup)-1)'*0.25) .* xup;
wavwrite(y,4*fs,nbits,'ofdm_rx_passband.wav');
x = awgn(x, SNR, 'measured');
K = fix((length(x))/(N+Ng))-1;