Simple volume, scaling and multiplication?

Software questions and issues with the FV-1

Moderator: frank

Post Reply
jwhitmore
Posts: 19
Joined: Tue Mar 10, 2020 6:37 am

Simple volume, scaling and multiplication?

Post by jwhitmore »

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?
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Re: Simple volume, scaling and multiplication?

Post by frank »

1. Link to schematic and PCB layout. Since you made your own board we have no reference and cannot check if there is a h/w issue without them.

2. How are you programming the EEPROM with the code? What are the exact steps from writing to burning, list all steps, do not skip one as we will assume you are skipping it if not listed.

3. Voltages on pins of chip, make sure they are all correct.
Frank Thomson
Experimental Noize
jwhitmore
Posts: 19
Joined: Tue Mar 10, 2020 6:37 am

Re: Simple volume, scaling and multiplication?

Post by jwhitmore »

Frank thanks a million for your response, you got me thinking. I was assuming that my problems were a simple software issue and in one case that turned out to be the case, but your pointing the finger a Hardware got me thinking. I dug out an old dual boot laptop with an old windows partition and the Spin FV-1 Development board and tested my code on that platform.

Again my volume pot didn't work, but that was my misunderstanding of the datasheet. I was temporarily storing the value of the POT in an unused register, address '8' :( . What I read as "unused" is what I might have called "unimplemented read as zero" :( The usable registers are up starting at address 32. My Bad ! :(

The other problem of my multiplying to scale the amplitude is working on the spin dev board. So I'm going to resolder my board with ceramic caps on one channel and Polarised on the other take the scope out and learn something, hopefully. Anyhow thanks a million for your time and pointing me in the right direction.

John
Post Reply