steve_bank
Diabetic retinopathy and poor eyesight. Typos ...
The Discrete Fourier Transform
There is plenty of code on the met, but little of it are usable. I went through this exercise in the 80s while reading Brigam's book. The main reason I got my first computer ad learned C was to go through exercises like this. I heard it said the best way to learn something is to code it.
The actual transform occurs in one line, the summation of the Fourier series. The transform is in exponential form. The rest of code is to a,e the transform usable.
Ye FFT is essentially a correlation integral. The transform is blind. The meaning comes from the scale factors in this case electrical time and frequency.
At each frequency in the transform a the sine-cosine is broken into n bits, and each bit is coelrted to a pint in tine in the time record.
An important aspect is samplmg. The smapling theorm staes that yiu meed to sample at at leat at 2x the highest sampled frequency. In practice it is usually higher than that. I don't know what the current digital audio sampling frequency is for a 2okz bandwidth.
Another aspect of sampling is aliasing. If you run the transform at 10, 1010,2010 hz with a sampling frequency of 2000 hz the transform frequency will be 10 in all cases.
Higher sampling frequency also means lower noise. The abrupt steps in t sample record transform to noise. More samples means smaller changes from sample to sample. Quantization noise.
If the sample record at the ends are not exactly zero the abrupt change again transforms to noise. Window functions modify the ends of record. Windowing reduces amplitude accuracy in trade for better frequency resolution.
An n point transform generates 2 mirror spectrums centered at n/2. The transform only needs to run from zero to 1/n. Runs faster. The ergy is split between the two mirror spectrums, so the true amplitude of a line is 2x the transform output.
The inverse transform goes from a complex frequency spectrum back to a tome domain signal.
There is an uncertainty aspect to the Fourier Trasform.
Time resolution is dt = 1 /fs where dt is the sampleinterval and fs is the sampling frequency. Frequency resolution df = fs/n. As fs goes up increasing time resolution df goes down. For a d fixed n.
The DFT is suitable for some application, the Fast Fourier Transform is used for general applications. The FFT is an optimization of the DFT making use of redundant calculations. The Cooley Tukey paper is included.
Sclab script for plotting is included if you compile and run the code. Scilab has fubctis that read ausio files and calculates a frequency spectrum. You could build your own basic voice password recognition system. Scilab is free.
Things you can do with it.
A single pule of variable width, a single or sum of two sines, and amplitude modulation can bw creted.
Create two sines and see how close they can be and resolved while varying fs,n, and applying a window.
Look at a pulse transform as pulse width is made smaller and larger,
Force an alias.
A 2^12 transform is under a second on my machine. 2^14 10 seconds,2^16 2 minutes.
For the mathematically inclined some light reading.
Window Functions
Tukey's and Cooley's paper
Brigham
Fourier Uncertainty Principle
Sampling Theorem
There is plenty of code on the met, but little of it are usable. I went through this exercise in the 80s while reading Brigam's book. The main reason I got my first computer ad learned C was to go through exercises like this. I heard it said the best way to learn something is to code it.
The actual transform occurs in one line, the summation of the Fourier series. The transform is in exponential form. The rest of code is to a,e the transform usable.
Ye FFT is essentially a correlation integral. The transform is blind. The meaning comes from the scale factors in this case electrical time and frequency.
At each frequency in the transform a the sine-cosine is broken into n bits, and each bit is coelrted to a pint in tine in the time record.
An important aspect is samplmg. The smapling theorm staes that yiu meed to sample at at leat at 2x the highest sampled frequency. In practice it is usually higher than that. I don't know what the current digital audio sampling frequency is for a 2okz bandwidth.
Another aspect of sampling is aliasing. If you run the transform at 10, 1010,2010 hz with a sampling frequency of 2000 hz the transform frequency will be 10 in all cases.
Higher sampling frequency also means lower noise. The abrupt steps in t sample record transform to noise. More samples means smaller changes from sample to sample. Quantization noise.
If the sample record at the ends are not exactly zero the abrupt change again transforms to noise. Window functions modify the ends of record. Windowing reduces amplitude accuracy in trade for better frequency resolution.
An n point transform generates 2 mirror spectrums centered at n/2. The transform only needs to run from zero to 1/n. Runs faster. The ergy is split between the two mirror spectrums, so the true amplitude of a line is 2x the transform output.
The inverse transform goes from a complex frequency spectrum back to a tome domain signal.
There is an uncertainty aspect to the Fourier Trasform.
Time resolution is dt = 1 /fs where dt is the sampleinterval and fs is the sampling frequency. Frequency resolution df = fs/n. As fs goes up increasing time resolution df goes down. For a d fixed n.
The DFT is suitable for some application, the Fast Fourier Transform is used for general applications. The FFT is an optimization of the DFT making use of redundant calculations. The Cooley Tukey paper is included.
Sclab script for plotting is included if you compile and run the code. Scilab has fubctis that read ausio files and calculates a frequency spectrum. You could build your own basic voice password recognition system. Scilab is free.
Things you can do with it.
A single pule of variable width, a single or sum of two sines, and amplitude modulation can bw creted.
Create two sines and see how close they can be and resolved while varying fs,n, and applying a window.
Look at a pulse transform as pulse width is made smaller and larger,
Force an alias.
A 2^12 transform is under a second on my machine. 2^14 10 seconds,2^16 2 minutes.
For the mathematically inclined some light reading.
Window Functions
Window function - Wikipedia
en.wikipedia.org
Tukey's and Cooley's paper
BSTJ 37: 1. January 1958: The Measurement of Power Spectra from the Point of View of Communications Engineering - Part I. (Blackman, R.B.; Tukey, J.W.) : Free Download, Borrow, and Streaming : Internet Archive
Bell System Technical Journal, 37: 1. January 1958 pp 185-282. The Measurement of Power Spectra from the Point of View of Communications Engineering - Part I....
archive.org
Brigham
Fourier Uncertainty Principle
Sampling Theorem
Nyquist–Shannon sampling theorem - Wikipedia
en.wikipedia.org