Crossfade proflie

G

Guest

Guest
Archived from groups: rec.audio.tech (More info?)

Hi,

I want to crossfade between two digital sources of ambient sound without
a perceptable change in signal level mid-fade.

My test sources are identical copies of rain sound encoded as 44100 Hz
16 bit.

I have an application that mixes the two sources by applying a fade
multiplier to each source and adding the resultant signals to give the
output. I do this over about 10 seconds.

My theory says that using a sin^2 and cos^2 profile will result in
uniform audio volume throughought the fade. Source 1 starts off at zero
amplitude and ramps up using a linear multiplier based on sin^2 of the
fade time. Source 2 starts off at at full scale p-p and ramps down using
a cos^2 curve. (sin^2(theta) + cos^2(theta) = 1.0 by definition) All
operations are in linear space in the encoded sound.

My actual results show a -2dB amplitude mid-fade. Can someone confirm if
my approach is correct and perhaps my implementation flawed, or if the
approach is not correct.
 
G

Guest

Guest
Archived from groups: rec.audio.tech (More info?)

Jeremy Ardley wrote:
> My theory says that using a sin^2 and cos^2 profile will result in
> uniform audio volume throughought the fade. Source 1 starts off at
> zero amplitude and ramps up using a linear multiplier based on sin^2
> of the fade time. Source 2 starts off at at full scale p-p and ramps
> down using a cos^2 curve. (sin^2(theta) + cos^2(theta) = 1.0 by
> definition) All operations are in linear space in the encoded sound.
>
> My actual results show a -2dB amplitude mid-fade. Can someone confirm
> if my approach is correct and perhaps my implementation flawed, or if
> the approach is not correct.

I think there is a little mistake in your approach, as the loudness depends
on the squared amplitude of the signal. So you would have to apply sin and
cos profiles instead of sin^2 and cos^2. Then you should get something like
(signal*sin(theta))^2+((signal*cos(theta))^2=signal^2*(sin^2(theta)+cos^2(th
eta))=signal^2 for the overall loudness which should do the trick.
I hope that helps.

Greetings
Knut
 

ASK THE COMMUNITY