PMOD I2S2 codec attenuation with Cyclone IV - Page 1
Forum section: electronics / general

author: jorgelml14
author_rank: Newbie
timestamp: April 11, 2021, 12:25:55 am
content: Hi, George here.Im currently working on my major proyect which is digital effects proccesor for guitar in fpga. Yesterday, I started sync the pmod i2s2 from digilent (cirrus 5343 ad and 4344 da) and my fpga cyclone iv and it seems to be working fine, I got audio from the output, the problem is that its attenuated. Aprox 2.3dBHere you have some signals I could record directly from the source (true bypass)(blue) and from the output of the pmod (red)Is that something expected from the codec? I mean, i could fix it with a line preamp, but is that attenuation expected?Thanks for the answers

author: asmi
author_rank: Super Contributor
timestamp: April 11, 2021, 01:24:08 am
content: If you are just passing through the data from ADC into DAC (so no onboard processing), you might want to check the analog part. I'm not an analog guy (not in a sound spectrum anyway), but I do seem to recall that the voltage on the output depends on the load resistance. I glanced over DAC's datasheet, and it seem to be expecting a fairly high load resistance, especially if load capacitance is also high, so you might want to make sure the load is within allowed range.Also if you work with a typical line signal of 1 Vpp, you are under-utilizing the ADC range as it's a bit over 0.5 * Vcc, so in your case (Vcc = 3.3 V) it can take up to 1.65 Vpp. Granted, with 24 bit ADCs this is not that important, but if you want to maximize your dynamic range, you might want to boost your signal a bit. Or if you can't be bothered with all of that, just boost your signal in the digital form before you pass it to a DAC as 1 Vpp is going to be quite far away from the saturation.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 11, 2021, 01:39:04 am
content: I suppose that you are comparing the amplitude of the input signal (that goes directly to the ADC input) with the amplitude of the output signal (direct DAC output)?First quick answer: you can't expect a perfect match - those are certainly not precision devices. Those are meant for audio purposes.More elaborate answer: just look at the datasheets, namely the "full-scale input voltage" of the ADC and the "full-scale output voltage" of the DAC. Assuming both the ADC and DAC use the same VA voltage (check that), considering respective min an max values, you should get something like approx. +/-1 dB difference. You notice a bit more with 2.3 dB. Have you checked the actual voltage right at the ADC input and at the DAC output? Are there no extra passive components that could explain the extra 1 dB loss?Either way, those chips are again not precision converters, and a 2 dB difference is even hardly noticeable by ear. So I wouldn't even bother. But certainly you can adjust that either with some amplification in front of the ADC or at the output of the DAC. Using fixed gain values, though, would be useless as there will always be dispersion between two different ICs.I again don't see the point.As a side note, if your input signal is from an electric instrument such as a guitar, you probably want some kind of front-end to the ADC anyway. You're not going to directly feed the ADC input with the output of the guitar, are you?

author: hamster_nz
author_rank: Super Contributor
timestamp: April 11, 2021, 07:30:47 am
content: I used the same ADCs and DACs on the board below. For around zero gain into a 10k load I used a transfer function of y = 13/8 * x. That was implemented as x + x/2 +x/8Note that on the PMOD I2S2 the ADC is fed by a voltage divider made of two 5.1k resistors, so the DAC's input is half that of line level.(Schematics for the PMOD are athttps://reference.digilentinc.com/_media/reference/pmod/pmodi2s2/pmodi2s2_sch.pdf)

author: hamster_nz
author_rank: Super Contributor
timestamp: April 11, 2021, 07:59:25 am
content: Since the datasheets are on the shelf I had a quick look....Input divider = 0.5The ADC full scale is 0.57 * VA peak to peakThe DAC full scale is 0.65 • VA peak to peak (into a high enough impedance)So with an input of 1V peak to peak the output will be 1.0 * 0.5 * 0.65 / 0.57 = about 0.57VDoes that agree with your findings?

author: jorgelml14
author_rank: Newbie
timestamp: April 12, 2021, 11:31:20 pm
content: Thanks to everyone who answer this post! Really helped me a lot. As some of you said, there was a voltage divider in the input of the adc aprox vin/2. Because of that, I made a gain stage in fgpa to multiply the incoming data *1.8 aprox. That solve the problem with line input, but then i tried my guitar which has a 100k output, in front of the pmod it dropped a lot and losed high frecuencies because of the pasive circuit of my guitar. So i decided to implement a buffer from an old klon centaur pedal, and it made a big difference in the tone and volumen!. Here you have some images from my results when applying 440 hz into the circuit buffered in true bypass mode (red) and with the pmod (blue).Thanks again!