Simple volume, scaling and multiplication?
Posted: Mon Mar 08, 2021 12:05 pm
I'm only starting out with DSP so a lot of my questions have been very basic in nature, this one is no different. I have two problems which are both linked to volume, but both come back to changing or scaling that volume.
My first problem is that my guitar running through the FV-1 and a simple program, just sampling and writing has much lower volume then the guitar bypassing the FV-1. The program is basically:
ldax ADCR
wrax DACL,0
So read from the ADC and write to the DAC. I've got cables in the wrong place so I do mean to read from the Right and write to the Left. So that is giving me low volume, So the easy thing, thinks I, is to just increase the volume by multiplication:
ldax ADCR
sof 1.9, 0.0
wrax DACL,0
So that doesn't work at all. (The volume being low might well be down to my Hardware. I created my own board and have laid it out with both ceramic and Tantalum caps. I've no idea what the practical difference is, so decided the best way to maybe find out was to try it. At present, first time out I decided I'd run ceramic on the input and output channels. Aragh I missed a trick there I should have used ceramics on the left and Tantalum on the right to get a better idea of the difference. I'll change it at the weekend.)
So multiplication by a factor, scaling up, doesn't give me the output I'd have expected. The output audio is garbled, it's almost like it's filtering, and who knows maybe it is.
Another somewhat related problem is that I decided that I wanted to use on of the FV-1's Pots to adjust the output volume:
ldax POT0
wrax volume,0 ; store in volume
ldax ADCR
mulx volume ; Adjust volume with POT0
wrax DACL,0
There's one more instruction in there then there needs to be, I don't need to write the value of the pot out to a register, but I was messing with something else and left it there. I might not be optimum, but it shouldn't effect the actual output.
Having said that the audio output, as in the case of scaling up is the same when trying to scale down to zero with the pot. In both cases the audio is not what I'd expect, scaled in amplitude. It sounds like a bit crush is happening, and that's maybe what is happening. Maybe you can't change the amplitude of a digital sample at all, I'd have to add an external pot for that. I wonder could I share a pot between an external output volume circuit and the FV-1? OK can't think immediately why you'd want to do that. Change volume and filter cut off together. You'd probably need a dual pot. That's by the by. Scaling an audio sample's amplitude up and down, is that possible?
My first problem is that my guitar running through the FV-1 and a simple program, just sampling and writing has much lower volume then the guitar bypassing the FV-1. The program is basically:
ldax ADCR
wrax DACL,0
So read from the ADC and write to the DAC. I've got cables in the wrong place so I do mean to read from the Right and write to the Left. So that is giving me low volume, So the easy thing, thinks I, is to just increase the volume by multiplication:
ldax ADCR
sof 1.9, 0.0
wrax DACL,0
So that doesn't work at all. (The volume being low might well be down to my Hardware. I created my own board and have laid it out with both ceramic and Tantalum caps. I've no idea what the practical difference is, so decided the best way to maybe find out was to try it. At present, first time out I decided I'd run ceramic on the input and output channels. Aragh I missed a trick there I should have used ceramics on the left and Tantalum on the right to get a better idea of the difference. I'll change it at the weekend.)
So multiplication by a factor, scaling up, doesn't give me the output I'd have expected. The output audio is garbled, it's almost like it's filtering, and who knows maybe it is.
Another somewhat related problem is that I decided that I wanted to use on of the FV-1's Pots to adjust the output volume:
ldax POT0
wrax volume,0 ; store in volume
ldax ADCR
mulx volume ; Adjust volume with POT0
wrax DACL,0
There's one more instruction in there then there needs to be, I don't need to write the value of the pot out to a register, but I was messing with something else and left it there. I might not be optimum, but it shouldn't effect the actual output.
Having said that the audio output, as in the case of scaling up is the same when trying to scale down to zero with the pot. In both cases the audio is not what I'd expect, scaled in amplitude. It sounds like a bit crush is happening, and that's maybe what is happening. Maybe you can't change the amplitude of a digital sample at all, I'd have to add an external pot for that. I wonder could I share a pot between an external output volume circuit and the FV-1? OK can't think immediately why you'd want to do that. Change volume and filter cut off together. You'd probably need a dual pot. That's by the by. Scaling an audio sample's amplitude up and down, is that possible?