Link to the linear pitch shifter code for reference:
http://www.spinsemi.com/knowledge_base/pitch_sft.html
Moderator: frank
Code: Select all
A1 : 29.4ms
A2 : 3.87ms
A3 : 951us
A4 : 237us
A5 : 59.1us
A6 : 13.3us
B1 : 8.47ms
B2 : 1.91ms
B3 : 475us
B4 : 118us
B5 : 29.1us
B6 : 3.83us
Code: Select all
Freq W' Constant
5,4 0,000518 0,99897
41,1 0,003940 0,99215
167,4 0,016049 0,96841
671,5 0,064379 0,87903
2693 0,258188 0,58959
11966,5 1,147273 -0,06859
18,8 0,001802 0,99640
83,3 0,007986 0,98415
335,1 0,032127 0,93775
1348,8 0,129314 0,77099
5469,2 0,524353 0,31203
41554,9 3,984023 -0,59872
The need for a different approach for low frequency allpass is understandable as the necessary recursive gain would require heavy attenuation in order to avoid clipping (as seen in the "Pitch Shift Code Sample"). I wonder if the "less efficient" allpass solution could be the Transposed Direct Form II allpass which Sean Costello mentions in this thread:The opcode set has been optimized to execute subsets of code for various common audio tasks; the all-pass filter for example, is executed by only 2 operations, but must do this from delay memory with the RDA and WRAP operations. When used in a reverb, where perhaps a dozen all-pass filters may be required, this is very efficient. If however, you wish to implement an all-pass filter with a delay of only 1 sample, the RDA/WRAP scheme could be used, but only if the coefficients in the all-pass are not too extreme. Coding low frequency all-pass filters will require a less efficient set of operations using registers for storage.
Code: Select all
rdax temp1, -k
rdax ap1, 1
wrax temp2, k
rdax temp1, 1
wrax ap1, 0Yes that is how I went about setting the APF coefficients. Thanks so much for the tool/calculator! I found that the system would way too easily start self-oscillating for filters with very low shift frequencies (big coefficients). This regardless of what APF type used.RRing wrote: ↑Sun Sep 13, 2020 7:35 am In the analog form you would choose a set of three(or more) frequency points that will overlap the responses to maximise uniformity in phase response over a range. The RC values are chosen such that XC = R at the frequency point chosen for a given stage. The XC = R is the point where gain is down 3dB(power) or 6dB (voltage). It is also the frequency where the phase shift is 45 deg. My spreadsheet has you input the frequency desired for the 45 deg shift point. Working backwards if you had a stage with RC values of 174k and 10nF. the XC would equal 10k at 91.5Hz.... where F = 1/2PiRC
does this help?