diff --git a/ofdm/ofdm_rx.m b/ofdm/ofdm_rx.m index c2fd3ae..dc08088 100644 --- a/ofdm/ofdm_rx.m +++ b/ofdm/ofdm_rx.m @@ -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');