I am using a Chirp-Z transform (aka. czt) to analyze a short length sample of a sinusoid. In scilab the code that I use to generate the signal is:
sampleRate = 4000000
points = 2^8
t = (0:(points-1))/sampleRate
y1 = sin(2*%pi*t*510000)
When I take the transform I get:
I expected to see only one non-zero magnitude sample. Obviously this is not the case. Why the sinc(x) waveform?
Here is my scilab code:
clear()
clc()
clf()
function a = angle(c)
// return the argument a in rad of complex number c
a = atan(imag(c), real(c))
endfunction
function [Y, f] = chirpZ(y, sampleRate, f1, f2, m)
w0 = 1
phi = 2*%pi*(f2-f1)/(m*sampleRate)
w = w0*exp(-%i*phi)
a0 = 1
theta = 2*%pi*f1/sampleRate
a = a0*exp(%i*theta)
Y = czt(y,m,w0,phi,a0,theta)
f = (((0:(m-1))*(f2-f1)/m) + f1)
endfunction
sampleRate = 4000000
points = 2^8
t = (0:(points-1))/sampleRate
y1 = sin(2*%pi*t*510000)
f1 = 300000
f2 = 700000
m1 = points
[y2, f2] = chirpZ(y1, sampleRate, f1, f2, m1)
y3 = y2/points
subplot(211)
plot(f2,abs(y3),'g.')
subplot(212)
plot(f2,angle(y3),'b.')
[mag1,ndx1] = max(abs(y3))
subplot(211)
plot(f2(ndx1),abs(y3(ndx1)),'r.')
subplot(212)
plot(f2(ndx1),angle(y3(ndx1)),'r.')



