Csound Csound-dev Csound-tekno Search About

[Csnd] getting alias noise

Date2008-02-13 17:10
FromAtte André Jensen
Subject[Csnd] getting alias noise
Hi

Is there a way to resample (say from 44.1k to 11.25k) an arate signal 
*while retaining* the resulting alias noise?

-- 
peace, love & harmony
Atte

http://atte.dk       | http://myspace.com/attejensen
http://anagrammer.dk | http://modlys.dk

Date2008-02-13 18:14
From"Steven Yi"
Subject[Csnd] Re: getting alias noise
AttachmentsNone  

Date2008-02-13 19:25
FromAnthony Kozar
Subject[Csnd] Re: getting alias noise
The "fold" opcode may be what you are looking for:

http://csounds.com/manual/html/fold.html

Atte André Jensen wrote on 2/13/08 12:10 PM:

> Hi
> 
> Is there a way to resample (say from 44.1k to 11.25k) an arate signal
> *while retaining* the resulting alias noise?



Date2008-02-13 21:28
FromAtte André Jensen
Subject[Csnd] Re: Re: getting alias noise
Steven Yi wrote:

> This code will take every idownsamp and repeat it for idownsamp number
> of samples.  Just have to be careful that ksmps > idownsamp.

Ok, I get it (I think).

However I decided to go with fold since it allows fractional values 
*and* does everything in one line (two if stereo). It's now in BlueShare 
  called AliasNoise.

But thanks for the great example + explanation. I didn't know about 
vaset/vaget before...

-- 
peace, love & harmony
Atte

http://atte.dk       | http://myspace.com/attejensen
http://anagrammer.dk | http://modlys.dk

Date2008-02-13 21:33
FromAtte André Jensen
Subject[Csnd] Re: Re: getting alias noise
Anthony Kozar wrote:

> The "fold" opcode may be what you are looking for:

Exactly, thanks for pointing that out.

I have one question, however. It sound to me like frequencies above 1/2 
the new freq are removed (as they would be when actually resampling), 
but when the manual says "ADDS artificial foldover to an audio signal" I 
get the impression that this isn't the case.

Can anyone confirm either one of these?

-- 
peace, love & harmony
Atte

http://atte.dk       | http://myspace.com/attejensen
http://anagrammer.dk | http://modlys.dk

Date2008-02-14 21:18
FromAnthony Kozar
Subject[Csnd] Re: Re: Re: getting alias noise
I am definitely getting foldover with this CSD file:



sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

instr 1
  asig  oscili  15000, 1000, 1
  a1    fold    asig, p4
        out     a1
endin



f1 0 32768 10 1 1 1

i 1 0 2  1                 ; no foldover
i 1 + .  [44100 / 2300 ]   ; 3rd harmonic becomes 1600 Hz
i 1 + .  [44100 / 1900 ]   ; get 1000, 1800, 800 Hz
e





Atte André Jensen wrote on 2/13/08 4:33 PM:

> I have one question, however. It sound to me like frequencies above 1/2
> the new freq are removed (as they would be when actually resampling),
> but when the manual says "ADDS artificial foldover to an audio signal" I
> get the impression that this isn't the case.
> 
> Can anyone confirm either one of these?