Commit 4163b70995a3e066bf9d27e5391c81e69bcbd2c0

Authored by Yujen Ku
1 parent 10659b0481
Exists in master

add credit

Showing 1 changed file with 7 additions and 0 deletions Inline Diff

form_raw_rx_dec.m View file @ 4163b70
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % Project code file for ECE 257B SP2018 %
3 % Author: Yu-Jen Ku, Xueshi Hou %
4 % Department of Electrical and Computer Engineering, %
5 % University in San Diego, California, USA %
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
function raw_rx_dec = form_raw_rx_dec(sample_start,raw_rx_dec,Delay,sample_time,raw_rx_dec_input,center_freq,showdetail) 1 8 function raw_rx_dec = form_raw_rx_dec(sample_start,raw_rx_dec,Delay,sample_time,raw_rx_dec_input,center_freq,showdetail)
if showdetail 2 9 if showdetail
disp( [ 'delay(in T_sample) = ' num2str(ceil(Delay/sample_time))] ); 3 10 disp( [ 'delay(in T_sample) = ' num2str(ceil(Delay/sample_time))] );
%fprintf('delay(in T_sample) = %d ', num2str(ceil(Delay/sample_time) )); 4 11 %fprintf('delay(in T_sample) = %d ', num2str(ceil(Delay/sample_time) ));
end 5 12 end
if length(raw_rx_dec) < sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1 6 13 if length(raw_rx_dec) < sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1
raw_rx_dec = [raw_rx_dec, zeros(1, sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1-length(raw_rx_dec) ) ]; 7 14 raw_rx_dec = [raw_rx_dec, zeros(1, sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1-length(raw_rx_dec) ) ];
end 8 15 end
9 16
raw_rx_dec(sample_start+ceil(Delay/sample_time):sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1) = ... 10 17 raw_rx_dec(sample_start+ceil(Delay/sample_time):sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1) = ...
raw_rx_dec(sample_start+ceil(Delay/sample_time):sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1) + ... 11 18 raw_rx_dec(sample_start+ceil(Delay/sample_time):sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1) + ...
raw_rx_dec_input*exp(1i*2*pi*( ceil(Delay/sample_time) - Delay/sample_time )*sample_time*center_freq); 12 19 raw_rx_dec_input*exp(1i*2*pi*( ceil(Delay/sample_time) - Delay/sample_time )*sample_time*center_freq);
13 20
% raw_rx_dec(sample_start+ceil(Delay/sample_time):sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1) = ... 14 21 % raw_rx_dec(sample_start+ceil(Delay/sample_time):sample_start+ceil(Delay/sample_time)+length(raw_rx_dec_input)-1) = ...