RadioBanter

RadioBanter (https://www.radiobanter.com/)
-   Homebrew (https://www.radiobanter.com/homebrew/)
-   -   90 degree phase shifter (https://www.radiobanter.com/homebrew/23246-90-degree-phase-shifter.html)

Ashhar Farhan June 16th 04 06:06 AM

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

Alan Peake June 16th 04 08:32 AM



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

OK, thanks for that - I've just downloaded it.
Alan


Alan Peake June 16th 04 08:32 AM



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

OK, thanks for that - I've just downloaded it.
Alan


Laura Halliday June 16th 04 09:05 PM

Alan Peake wrote in message . ..
Ashhar Farhan wrote:

you don't really have to know a lot of DSP to play around with this
particular beast. very simply, you collect the audio samples in a
first-in first-out buffer of about 250 slots. Each time a new sample
is added at one end, a sample is retired at the other end.

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?
Alan


It does if the "magic constants" are right. Consider
the complex frequency response of a Hilbert Transformer
and work out the impulse response. Unlike linear-phase
FIR filters, the impulse response of a Hilbert
Transformer isn't symmetric.

There are whole books on the subject. I have a copy
of _Hilbert Transforms in Signal Processing_ by Hahn,
which goes in to all of this in more than a little
detail. The challenge is turning the theoretical
impulse response (which is infinite) in to something
you can realize on finite hardware.

Laura Halliday VE7LDH "Que les nuages soient notre
Grid: CN89mg pied a terre..."
ICBM: 49 16.05 N 122 56.92 W - Hospital/Shafte

Laura Halliday June 16th 04 09:05 PM

Alan Peake wrote in message . ..
Ashhar Farhan wrote:

you don't really have to know a lot of DSP to play around with this
particular beast. very simply, you collect the audio samples in a
first-in first-out buffer of about 250 slots. Each time a new sample
is added at one end, a sample is retired at the other end.

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?
Alan


It does if the "magic constants" are right. Consider
the complex frequency response of a Hilbert Transformer
and work out the impulse response. Unlike linear-phase
FIR filters, the impulse response of a Hilbert
Transformer isn't symmetric.

There are whole books on the subject. I have a copy
of _Hilbert Transforms in Signal Processing_ by Hahn,
which goes in to all of this in more than a little
detail. The challenge is turning the theoretical
impulse response (which is infinite) in to something
you can realize on finite hardware.

Laura Halliday VE7LDH "Que les nuages soient notre
Grid: CN89mg pied a terre..."
ICBM: 49 16.05 N 122 56.92 W - Hospital/Shafte


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
RadioBanter.com