- added flip spectrum switch

git-svn-id: http://moon:8086/svn/matlab/trunk@55 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
2015-05-02 10:07:54 +00:00
parent 97f5e83720
commit d99b383b1e
+9 -5
View File
@@ -1,9 +1,9 @@
function [sym_out, H, W] = ofdm_rx(filename, foff, SNR, with_cir, show_H)
function [sym_out, H, W] = ofdm_rx(filename, foff, flip_spec, SNR, with_cir, show_H)
%
% [sym_out, H, W] = ofdm_rx(filename, foff, SNR, with_cir, show_H)
% Example: ofdm_rx('drm-15435-if.wav', -174.65, 400, 0, 1)
% Example: ofdm_rx('xv.wav', 0, 400, 0, 1)
% or ofdm_rx('yv.wav', 0, 400, 0, 1)
% [sym_out, H, W] = ofdm_rx(filename, foff, flip_spec, SNR, with_cir, show_H)
% Example: ofdm_rx('drm-15435-if.wav', -174.65, 0, 400, 0, 1)
% Example: ofdm_rx('xv.wav', 0, 0, 400, 0, 1)
% or ofdm_rx('yv.wav', 0, 0, 400, 0, 1)
close all;
@@ -45,7 +45,11 @@ end
if with_cir
x = filter(h_cir, 1, x);
end
x = x - mean(x);
if flip_spec
x = conj(x);
end
x = x./max(abs(x));
xout = [real(x) imag(x)];
wavwrite(xout,fs,nbits,'ofdm_rx.wav');