[a55674]: comp / comp_chirpzt.m  Maximize  Restore  History

Download this file

66 lines (45 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
function c = comp_chirpzt(f,K,deltao,o)
Ls = size(f,1);
W = size(f,2);
q = 1;
if 0
%Use the decimation scheme
% q fft of length
q = ceil(Ls/K);
Lfft = 2^nextpow2(2*K-1);
fext = zeros(q*W,K);
for w=0:W-1
fext(1+w*q*K:w*q*K+Ls) = f(:,w+1);
end
f = fext.';
Ls = K;
k = (0:K-1).';
W2 = exp(-1i*q*deltao*(k.^2)./2);
preChirp = W2(1:K).*exp(-1i*k*q*o);
postChirp = zeros(K,q);
for jj=0:q-1
postChirp(:,jj+1) = exp(-1i*jj*(k*deltao+o)).*W2(1:K);
end
else
%Reference: fft of the following length
Lfft = nextfastfft(Ls+K-1);
n = (0:max([Ls,K])-1).';
W2 = exp(-1i*deltao*(n.^2)./2);
preChirp = W2(1:Ls).*exp(-1i*o*(0:Ls-1).');
postChirp = W2(1:K);
end
chirpFilt = zeros(Lfft,1);
chirpFilt(1:K) = conj(W2(1:K));
chirpFilt(end:-1:end-Ls+2) = conj(W2(2:Ls));
chirpFilt = fft(chirpFilt);
ff = bsxfun(@times,f,preChirp);
c = ifft(bsxfun(@times,fft(ff,Lfft),chirpFilt));
if q>1
ctmp = c;
c = zeros(K,W,assert_classname(f));
for w=0:W-1
c(:,w+1) = sum(ctmp(1:K,1+w*q:(w+1)*q).*postChirp,2);
end
else
c = bsxfun(@times,c(1:K,:),postChirp);
end

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks