Alan Peake wrote in message . ..
each of the 90 degree phase shift-ed samples is generated by simpy
multiplying all the samples in the pipe with a individual 'magic'
constants and adding them all up together. pretty basic stuff as far
as programming goes. the magic constants are themselves quite complex
to calculated, but that work has alread been done for you. The CD
accompanying EMRFD has those constants in a text file under the DSP
folder.
Does this approximate the Hilbert Transform?
yes it does. theoretically speaking, Hilbert transform is Finite
Impulse Response filter implmented with a specific set of
coefficients. the FIR itself is pretty simple. just an array of
incoming samples. each time a new sample is inserted, you generate a
new output by running a loop through the previous n samples.
pipe has space for n samples at a time.
HilbertTable has n number of coefficients.
for (each incoming sample)
{
add sample to the begining of the pipe, pushing out the oldest
sample from the other end;
ouputSample = 0;
for (i = 0; i n; i++)
outputSample = outputSample + (HilberTable[i] * pipe[i]);
output the sample;
}
This will give you 90 degrees phase shift.
i have written a dsp shell which will read samples from the sound card
and write them back to the sound card. you can get the source code
from
http://www.phonestack.com/farhan
- farhan