Csound Csound-dev Csound-tekno Search About

Re: Oversampling overkill

Date1999-09-24 16:18
FromJosep M Comajuncosas
SubjectRe: Oversampling overkill
Hi Thomas,
your idea is used everywhere ... even in the cheap portable CD players. Upsampling
is a not too demanding operation  and it will allow a gentler antialiasing filter
prior to downsampling for example.
But designing such a filter calls for some care, and Csound certainly does not have
powerful filter design routines by now. Even filter2 is a crap ... you don´t have
control over the way the filter structure is implemented (direct form and so on...),
and it is a limit of about 40 coefficients I think ... not to say the result is
truncated to single precission floats.
And I´m afraid you won´t find too much audio editors that can accept sampling rates
much bigger than 96 kHz !
So I would suggest you to take care of the usual FM parameters ... it is really
instructive ;-))

Thomas Huber escribió:

> Recently I came up with the following idea:
> You get aliasing when doing FM-synthesis with high modulation
> index, because the process creates harmonics above the Nyquist
> limit which are the 'mirrored' back into the audio band. The
> same when doing nonlinear operations that are not bandlimited, as
> i.e. an tanh distorter.
>
> Now my kinda coool idea is to turn up the sampling rate to, let's say,
> 441'000 (441 kHz), the filter all audio signals with a lowpass with a
> cutoff of 22kHz, then resample the output to a normal sampling rate
> of i.e. 44'100 Hz. I think that this could drastically reduce aliasing
> effects.
>
> Now I don't want to have Gigabytes of audio data with Megaherz sampling
> rates, so I tried to link the downsampler (I want to use 'sox' for that
> task) to csound via a unix-pipe (on a linux system):
>
> csound -d -W -ostdout any.orc any.sco | sox -r441000 -c2 -twav - -r44100 out.wav
>
> First problem is that 'sox' tells me that 441000 is a bogus sampling rate.
> This is a minor problem, I think (just edit the source).
> But the bigger problem is that csound doesn't like writing to a pipe:
>
> soundfile write returned a bytecount of 3072, not 8192
> (disk may be full...
>  closing the file ...)
> 0 8192-byte soundblks ....
>
> Of cource, the disk isn't full at all.
> I think the problem is, that when writing to a pipe, only so much
> can be written as the reader of the pipe (here: 'sox') is reading out.
>
> Any tips ?
>
> Thomas

--
Josep M Comajuncosas
C/ Circumval.lacio 75  08790 Gelida - Penedes
Catalunya - SPAIN tel. 93 7792243
e-mail:          gelida@intercom.es
ET Informatica de Sistemes
e-mail: jcomajuncosas@campus.uoc.es
  http://members.tripod.com/csound/