[RX]
- 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:
@@ -32,6 +32,7 @@ if (ndim == 2)
|
|||||||
x = x.*exp(-j*(2*pi*(foff/fs_)*(0:len-1)'));
|
x = x.*exp(-j*(2*pi*(foff/fs_)*(0:len-1)'));
|
||||||
elseif (ndim == 1)
|
elseif (ndim == 1)
|
||||||
fprintf('Mode: Passband\n');
|
fprintf('Mode: Passband\n');
|
||||||
|
x = xwav - mean(xwav);
|
||||||
x = xwav.*exp(-j*(2*pi*(0.25-foff/fs_)*(0:len-1)'));
|
x = xwav.*exp(-j*(2*pi*(0.25-foff/fs_)*(0:len-1)'));
|
||||||
hlp = FIRCalcLowpass(12000/fs_, 15);
|
hlp = FIRCalcLowpass(12000/fs_, 15);
|
||||||
x = filter(hlp, 1, x);
|
x = filter(hlp, 1, x);
|
||||||
@@ -54,6 +55,15 @@ x = x./max(abs(x));
|
|||||||
xout = [real(x) imag(x)];
|
xout = [real(x) imag(x)];
|
||||||
wavwrite(xout,fs,nbits,'ofdm_rx.wav');
|
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');
|
x = awgn(x, SNR, 'measured');
|
||||||
K = fix((length(x))/(N+Ng))-1;
|
K = fix((length(x))/(N+Ng))-1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user