I’m currently unhappy with the speed of rsound’s resampling. This is a pretty 
straightforward interpolation operation; if you’re not already familiar, 
imagine mapping an old vector ‘o' of size M onto a new vector ’n’ of size N 
where each point ‘i’ in the new vector is obtained by linearly interpolating 
the two points of the old vector nearest to i*(M/N).

Currently, it takes about 10 seconds to resample 60 seconds of audio, which I 
believe could be much much better. I bet that TR would help a lot here, but 
I’ve been poking around, and I don’t see any typed access to s16vectors or 
cpointers. I’m guessing that importing the ffi/unsafe functions with wrappers 
would be considerably slower...

… well, I shouldn’t guess. I should try.

AAGH! Yep, I was right. it goes 7x slower after naive conversion to TR. I could 
probably do better by working with the optimization coach, but I’m guessing 
that interposing the contract boundary on every read and write to the s16vector 
is a big slowdown that could easily be avoided. So: is there a good way to use 
TR for access to cpointers?

I’ve attached the code in case anyone wants to see it; I don’t really care 
about the first call to (time …); it’s appallingly slow (20x slower in TR), but 
that’s not the part I’m trying to speed up. It’s the second call to (time…), 
around
the resample call.

John



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: check-resample-speed.rkt
Description: Binary data

Reply via email to