- updated
git-svn-id: http://moon:8086/svn/matlab/trunk@154 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
@@ -27,6 +27,9 @@ function iridium (name)
|
|||||||
[x, fs] = audioread(name);
|
[x, fs] = audioread(name);
|
||||||
xc = (x(:,1) + i*x(:,2))';
|
xc = (x(:,1) + i*x(:,2))';
|
||||||
|
|
||||||
|
h_rc = fir_rrc(fs, 4/fs, 0.4, 65);
|
||||||
|
xc = filter(h_rc, 1, xc);
|
||||||
|
|
||||||
close all;
|
close all;
|
||||||
N = length(x);
|
N = length(x);
|
||||||
|
|
||||||
@@ -38,7 +41,7 @@ xc_cfo = xc .* lo;
|
|||||||
#xc_cfo = xc_cfo .* conj(xc_cfo);
|
#xc_cfo = xc_cfo .* conj(xc_cfo);
|
||||||
phi_cfo_uw = phi_unwrap(angle(xc_cfo));
|
phi_cfo_uw = phi_unwrap(angle(xc_cfo));
|
||||||
dphi_cfo = [0 diff(phi_cfo_uw)];
|
dphi_cfo = [0 diff(phi_cfo_uw)];
|
||||||
foff = dphi_cfo*48000;
|
foff = dphi_cfo*fs;
|
||||||
found = find_preamble(dphi_cfo)
|
found = find_preamble(dphi_cfo)
|
||||||
|
|
||||||
alpha_mean = 0.1;
|
alpha_mean = 0.1;
|
||||||
@@ -58,7 +61,7 @@ subplot(3,1,3)
|
|||||||
plot(1:N, dphi_cfo, "-o", 1:N, dphi_mean, 'r-'); legend('dphi'); grid;
|
plot(1:N, dphi_cfo, "-o", 1:N, dphi_mean, 'r-'); legend('dphi'); grid;
|
||||||
|
|
||||||
start=found(1)
|
start=found(1)
|
||||||
ende=start + 128
|
ende=start + 400
|
||||||
step=2
|
step=2
|
||||||
|
|
||||||
figure
|
figure
|
||||||
@@ -66,7 +69,7 @@ plot(real(xc_cfo(start:step:ende)), imag(xc_cfo(start:step:ende)), 'x'); grid;
|
|||||||
|
|
||||||
function found = find_preamble(phi)
|
function found = find_preamble(phi)
|
||||||
thr = 0.5;
|
thr = 0.5;
|
||||||
nsmp = 16;
|
nsmp = 120;
|
||||||
last = phi(1);
|
last = phi(1);
|
||||||
count = 0;
|
count = 0;
|
||||||
found = [];
|
found = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user