Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Improvements #2

Open
das-Iro opened this issue Oct 24, 2012 · 1 comment
Open

Performance Improvements #2

das-Iro opened this issue Oct 24, 2012 · 1 comment

Comments

@das-Iro
Copy link

das-Iro commented Oct 24, 2012

Hi,

Tanks for creating this, it hast been a great help understanding the PhaseVocoder and Apples APIs.

I used "Intruments" to see what makes smbPitchShift slow. Your change to the Apple Accelerate framework was a very big step.
More improvements are: replace double with float.
The audio is 16 bit precise float has 24 bit precision, and is sufficient.
This goes for the C math functions as well. atan -> atanf; cos -> cosf etc..

After moving to float, the biggest thing will be cosf. This is caused by recomputing the window function twice each call. And can be eliminated to a vector multiplication.

Apple supplies 3 window functions.
vDSP_blkman_window
vDSP_hamm_window
vDSP_hann_window
The last one is equivalent to the current Implementation. The window function should only be computed in the init, or passed like the FFTSetup.
The first for loop would be reduced to:
vDSP_vmul(gInFIFO, 1, window, 1, gFFTworksp, 1, fftFrameSize);

After this the Phase Vocoder should be much faster. ( 4x or even more )

@tkzic
Copy link
Owner

tkzic commented Nov 9, 2012

Dear Arne,

Wow. This is huge. Thank you so much for doing the optimization research and work. I have been busy teaching this year and not able to work on the audiograph project. But I very much appreciate your observations and would like to include them in the next version of software when I can get back to it.

Thank you and best wishes.

Tom

From: Arne Jünemann
Sent: Tuesday, October 23, 2012 8:38 PM
To: tkzic/audiograph
Subject: [audiograph] Performance Improvements (#2)

Hi,

Tanks for creating this, it hast been a great help understanding the PhaseVocoder and Apples APIs.

I used "Intruments" to see what makes smbPitchShift slow. Your change to the Apple Accelerate framework was a very big step.
More improvements are: replace double with float.
The audio is 16 bit precise float has 24 bit precision, and is sufficient.
This goes for the C math functions as well. atan -> atanf; cos -> cosf etc..

After moving to float, the biggest thing will be cosf. This is caused by recomputing the window function twice each call. And can be eliminated to a vector multiplication.

Apple supplies 3 window functions.
vDSP_blkman_window
vDSP_hamm_window
vDSP_hann_window
The last one is equivalent to the current Implementation. The window function should only be computed in the init, or passed like the FFTSetup.
The first for loop would be reduced to:
vDSP_vmul(gInFIFO, 1, window, 1, gFFTworksp, 1, fftFrameSize);

After this the Phase Vocoder should be much faster. ( 4x or even more )


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants