--nextPart5311871.liKWqO9BQg
Content-Type: multipart/mixed;
boundary="Boundary-01=_vn3zLKtcBTq+EHr"
Content-Transfer-Encoding: 7bit--Boundary-01=_vn3zLKtcBTq+EHr
Content-Type: Text/Plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inlineOn Wednesday 21 April 2010 23:02:19 Arnold Krille wrote:
I did some thinking...
Attached is a small python script that generates some sinus data at 0.5, 0.=
49=20
and 0.25 the sampling rate, phase shifted pi/2 to the sampling clock. But t=
he=20
phase shift can be adapted in the first lines.
Then it does fft on these. While the nyquist frequency shows up as amplitud=
e 0=20
(for phase =3D pi/2) and 2 (for phase 0), the others remain at amplitude 1 =
no=20
matter what the phase is.
Sounds strange, especially when you see the perceived amplitude-modulation =
for=20
f=3D0.49, but in the end its up to the analog filters to create a smaller t=
han=20
nyquist frequency sinus from the steps returned by the dac...
It is also clear, why f=3D0.5, phase=3D0 shows an amplitude of 2: All the=20
frequencies are endlessly mirrored to the left and right. And at f =3D=20
0.5*samplingrate, the mirror and the original are the same.
So sorry for the fuss I tried to spread. Should have done this little exerc=
ise=20
earlier.
Have fun,
Arnold
--Boundary-01=_vn3zLKtcBTq+EHr
Content-Type: text/x-python;
charset="UTF-8";
name="samplingtest.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="samplingtest.py"
#!/usr/bin/env python
import numpy
import matplotlib.pyplot as plt
n = 100
phase = numpy.pi/2.
data = []
for f in [0.5, 0.49, 0.25, 0.01]:
tmp = []
for i in range(n):
tmp.append(numpy.cos(i * f * 2*numpy.pi + phase))
data.append(tmp)
#plt.plot(data)
plt.subplot(221)
for d in data:
plt.plot(d)
freqs = None
for d in data:
if freqs is None:
freqs = []
for i in range(n/2 +1):
freqs.append(i*1./n)
tmp = numpy.fft.rfft(d)
plt.subplot(212)
plt.plot(freqs,abs(tmp)*2/n)
plt.subplot(222)
plt.plot(freqs,numpy.angle(tmp))
plt.show()
--Boundary-01=_vn3zLKtcBTq+EHr--
--nextPart5311871.liKWqO9BQg
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEABECAAYFAkvPee8ACgkQuYLL1cDjHx0JLACfb2jfLDuurHLcM4cg5Gi5KwoV
bJsAnjOVJ1AzBcP9Nld8DTagZY7p4CGf
=YMxX
-----END PGP SIGNATURE-----
--nextPart5311871.liKWqO9BQg--
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.