mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-14 01:37:25 -05:00
Round of Code Cleanup;
This commit is contained in:
@@ -136,3 +136,23 @@ upsample (dsd_state * state, float invalue)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//produce 6 short samples (48k) for every 1 short sample (8k)
|
||||
void upsampleS (short invalue, short prev, short outbuf[6])
|
||||
{
|
||||
|
||||
float c, d;
|
||||
|
||||
c = prev;
|
||||
d = invalue;
|
||||
|
||||
// basic triangle interpolation
|
||||
outbuf[0] = c = ((invalue * (float) 0.166) + (c * (float) 0.834));
|
||||
outbuf[1] = c = ((invalue * (float) 0.332) + (c * (float) 0.668));
|
||||
outbuf[2] = c = ((invalue * (float) 0.500) + (c * (float) 0.5));
|
||||
outbuf[3] = c = ((invalue * (float) 0.668) + (c * (float) 0.332));
|
||||
outbuf[4] = c = ((invalue * (float) 0.834) + (c * (float) 0.166));
|
||||
outbuf[5] = c = d;
|
||||
prev = d; //shift prev to the last d value for the next repitition
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user