Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Lab 2 Digicom
- close all
- % Read in sample file (example here)
- fd = fopen('usrp_samples.dat','r') ;
- s = fread(fd,153600*2,'int16') ;
- fclose(fd) ;
- s2 = s(1:2:end) + sqrt(-1)*s(2:2:end) ;
- % close all
- %test = N_f;
- N_f = ind2; %needs to be changed for every new ind
- sss_e = [];
- ss0 = s2((N_f-72-1024-1023):(N_f-72-1024));
- pss0 = s2((N_f - 72-1023): (N_f - 72));
- p_f = fft(pss0, 1024);
- p_f2(1:36) = p_f(1:36);
- p_f2(37:72)= p_f(1024 + (-35:0) );
- s_f = (fft(ss0,1024));
- figure;
- stem(abs(fftshift(s_f)))
- title 's_f'
- sss_e(1:36)= s_f((1024-35):1024);
- sss_e(37:72)= s_f(2:37);
- figure;
- stem(abs(sss_e));
- figure;
- plot(sss_e,'o')
- axis([-10*power(10,5) 10*power(10,5) -10*power(10,5) 10*power(10,5)])
- pss2_f_extracted = [];
- i=6;
- pss2_f_extracted = zeros(1,72);
- for j=1:1:1024
- if (abs(pss2_f(j))~= 0)
- pss2_f_extracted(i) = pss2_f(j);
- i=i+1;
- end
- end
- %pss2_f_extracted(end:end+5) = 0
- H_n = abs(conj(pss2_f_extracted).* sss_e);
- figure; stem(20*log10(abs(H_n))); axis([0 72 0 250])
- % c)
- %h_pss = cconv(conj(pss_2f),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement