Chaosruler972
Still Fresh
- Joined
- Apr 3, 2018
- Messages
- 9
- Age
- 32
I started working on a function
I easily wrote 48K -> 96K (which was simply repeating the each sample)
44.1K -> 48K/96K is a little trickier since linear interpolation won't work, the ratio is clearly not int-divisible therefore I can't really play with the samples
Like a good software developer I immediately used google to see if it was done or good algorithms were found before, and I found several that do not have NEON implantation, but might affect audio quality due to fast but not so precise interpolation, I found out that NE10 got some great fft modules and rfft modules, and on the frequency channel, changing 44.1Khz to 96K is going to be child-play and will result in better sound quality (and of course reversing it to time channel), if the pyra was an audiophile device, there would be no question that I'd want to fft that, since I could also apply cool filters on the frequency channel, however if I do that on the pyra, it might result in slower decoding but better than the most general way that 44.1K->96K is resolved), but by my calculation (since I don't have a pyra dev unit and I resort to emulation) it shouldn't pass 3% CPU load (and is real-time audio decoding, ergo 15ms for 1 second)
like EvilDragon already mentioned, 96K is a really high sample rate (one of the highest of generally acceptable sample rates on ARM devices), which is exactly why hardware decoding is available on such devices, however since the drivers are not ready we do want some fast decoder, so I will next week add my code for 48K->96K (really simple one) to some repo in pyragit including my tests
the question is, do we want fft -> convert -> rfft or do we want area interpolation like it seems to be generally acceptable to convert audio samples with non-linear interpolation applicable solution?
I think it might be cool to have advanced software decoding with correlation of fast hardware decoding, it might give the pyra several modes (audiophile mode/general purpose mode), but it's going to be tough to tell the audio agent to switch between 3rd party libraries and the drivers - what do you think?
P.S: the popular way to solve it is by upsampling once, than use some buffer (which is preallocated at init) that was initalized with ratio between movements of left sample and right sample as opposed to the output dimensions, and use those factors to move "n" pixels left or right on the chosen sample "chunk", each sample will be multiplied by it's factor and summed together will result the new sample, since each sample has it's own ratio there will be an output for each sample, since it's sample location based, it's easily done at init and kept there for use later, since the location and ratios are preallocated and precomputed, it's really really fast (2ms), this solution is also linear because for each sample we have in the output, we know which factors were used to result it, therefore if one sample factor was x% and the other was y%, we can simply multiply the output by x%/y% to compute the source samples (up to rounding and dot fixing due to int16 as oppsed to float operations)
I easily wrote 48K -> 96K (which was simply repeating the each sample)
44.1K -> 48K/96K is a little trickier since linear interpolation won't work, the ratio is clearly not int-divisible therefore I can't really play with the samples
Like a good software developer I immediately used google to see if it was done or good algorithms were found before, and I found several that do not have NEON implantation, but might affect audio quality due to fast but not so precise interpolation, I found out that NE10 got some great fft modules and rfft modules, and on the frequency channel, changing 44.1Khz to 96K is going to be child-play and will result in better sound quality (and of course reversing it to time channel), if the pyra was an audiophile device, there would be no question that I'd want to fft that, since I could also apply cool filters on the frequency channel, however if I do that on the pyra, it might result in slower decoding but better than the most general way that 44.1K->96K is resolved), but by my calculation (since I don't have a pyra dev unit and I resort to emulation) it shouldn't pass 3% CPU load (and is real-time audio decoding, ergo 15ms for 1 second)
like EvilDragon already mentioned, 96K is a really high sample rate (one of the highest of generally acceptable sample rates on ARM devices), which is exactly why hardware decoding is available on such devices, however since the drivers are not ready we do want some fast decoder, so I will next week add my code for 48K->96K (really simple one) to some repo in pyragit including my tests
the question is, do we want fft -> convert -> rfft or do we want area interpolation like it seems to be generally acceptable to convert audio samples with non-linear interpolation applicable solution?
I think it might be cool to have advanced software decoding with correlation of fast hardware decoding, it might give the pyra several modes (audiophile mode/general purpose mode), but it's going to be tough to tell the audio agent to switch between 3rd party libraries and the drivers - what do you think?
P.S: the popular way to solve it is by upsampling once, than use some buffer (which is preallocated at init) that was initalized with ratio between movements of left sample and right sample as opposed to the output dimensions, and use those factors to move "n" pixels left or right on the chosen sample "chunk", each sample will be multiplied by it's factor and summed together will result the new sample, since each sample has it's own ratio there will be an output for each sample, since it's sample location based, it's easily done at init and kept there for use later, since the location and ratios are preallocated and precomputed, it's really really fast (2ms), this solution is also linear because for each sample we have in the output, we know which factors were used to result it, therefore if one sample factor was x% and the other was y%, we can simply multiply the output by x%/y% to compute the source samples (up to rounding and dot fixing due to int16 as oppsed to float operations)
Last edited: