Re: Sample-rate conversion
Re: Sample-rate conversion
- Subject: Re: Sample-rate conversion
- From: Jens Bauer <email@hidden>
- Date: Wed, 4 Feb 2004 14:39:57 +0100
Hi Stefan,
On Wednesday, Feb 4, 2004, at 11:27 Europe/Copenhagen, Stefan Werner
wrote:
On 04.02.2004, at 07:00, email@hidden wrote:
> I just wrote a program, which needs to convert a sample-rate from
approx. 3.5MHz resolution to 44100Hz resolution.
The signal that is sampled, is in the hearable range, but I ran into a
problem that some of you most likely recognize.
When I have a "pure tone", and it's converted, I can hear another
tone,
which is of a lower frequency, and the amplitude is somewhat lower.
Is there an easy/simple way of getting rid of these extra tones ?
I pull around 79 or 80 samples from the 3.5MHz signal add them up,
averaging them by dividing them by # of samples read (say 80), then I
multiply them by the playback volume, and store them in the left+right
channel (mono).
It could be that you're getting unwanted artifacts at the edges of
these 80/79 sample packets - maybe it'd help if you'd invole the
previous packet in your calculations.
That would probably be the easiest thing to try out.
Eg.. Make a buffer that holds the last fetched 80 sample packets, and
then analyze them, to synchronize ?
Also, to avoid aliasing artifacts in sampling, you should apply a
low-pass filter beforehand. BTW, do you know whether or not your 3.5
MHz sampled stream contains frequencies > 22050 Hz?
Uhm, I'd probably be most interested in the range (3500000 / 300) Hz
down to (3500000 / 2168) Hz, which would be 12kHz down to 1kHz.
I forgot to let you all know, that there is no noise between a
state-change on the source. The source is read from a file, which has
been calculated digitally, so I'd receive for instance 2168 hi signals
followed by 2168 lo signals (eg. the state would be low 2168 times in a
row)
I do not see these in the file I dumped.
There is a strange thing. I tried using Audio Hijack on the output
(before it gets into the oscilloscope), and using lowpass filters, I
got rid of very much noise. (This confuses me quite a bit, because
when
I output pure data, how can Audio Hijack make them cleaner??? -Is this
because I output square waves rather than sine waves?)
That's because you have an effective sample depth of 6 - 7 bit. Adding
a lowpass certainly can enhance the perceived sound quality here.
Depending on the frequency range you want to cover with your
application, you may want to consider converting to a lower sample
rate, but with a higher precision instead.
I must admit that my brain isn't picking this up, however, I believe
what you say! =)
Thankyou for the information. I'll have a look at it.
Love,
Jens
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.