mirror of https://github.com/pvnis/srsRAN_4G.git
Normalized PSS correlation result. Use real part only. Extended sync_test to more bandwidth
parent
3dfb1824b4
commit
7658ced99d
@ -0,0 +1,6 @@
|
||||
function [ y ] = addnoise( x, snr_db )
|
||||
v = 10^(-snr_db/10);
|
||||
y=x+sqrt(v)*(randn(size(x))+1i*randn(size(x)))/sqrt(2);
|
||||
y=y/sqrt(mean(y.*conj(y)));
|
||||
end
|
||||
|
@ -1,18 +1,16 @@
|
||||
function [ fs eps p_m w2] = find_pss( x, N_id_2, fft_size)
|
||||
function [ w2] = find_pss2( x, N_id_2, fft_size)
|
||||
c=lte_pss_zc(N_id_2);
|
||||
cc=[zeros(fft_size/2-31,1); c; zeros(fft_size/2-31,1)];
|
||||
cc=[0; cc(fft_size/2+1:fft_size); cc(2:fft_size/2)];
|
||||
ccf=conj(ifft(cc));
|
||||
|
||||
w2=conv(x,ccf);
|
||||
%plot(10*log10(abs(w2)));%./mean(abs(w2))));
|
||||
plot(abs(w2))
|
||||
%axis([0 length(w2) 0 20])
|
||||
[m i]=max(abs(w2));
|
||||
p_m = m/mean(abs(w2));
|
||||
ccd=[0; cc(fft_size/2+1:fft_size); cc(2:fft_size/2)];
|
||||
ccf=sqrt(fft_size)*conj(ifft(ccd));
|
||||
|
||||
w2=real(conv(x,ccf))/62;
|
||||
plot(w2)
|
||||
[m i]=max(w2);
|
||||
en=var(x,1);
|
||||
p_m = m/en;
|
||||
|
||||
fprintf('Frame starts at %d, m=%g, p=%g, p/m=%g dB\n',i, ...
|
||||
mean(abs(w2)), m, 10*log10(m/mean(abs(w2))));
|
||||
|
||||
fprintf('Frame starts at %d, energy=%g, p=%g, p/en=%g dB\n',i, ...
|
||||
en, m, m/en);
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue