This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Request Help with Lyrtech Board Input A/D and Output D/A Scaling

The Lyrtech information states that the input range is 7 Vpp and the output range is 3.1 Vpp for their A/D and D/A inputs and outputs respectively.

I want to convert an input digital word to the input voltage and also convert a voltage (internal DSP calculation) into the proper digital word to be sent out.

My input equation is

uin = voltageScaling * (double) (dmaxAdcBuffer >> 8) - kVoltageLimit;

dmaxAdcBuffer is declared as a Uint32.  I think that the data should be in the upper 24 bits as it's left justified.  kVoltageLimit = 3.5 and voltageScaling = (2 * kVoltageLimit) / (16777216).  Note that 16777216 = 2 to the 24.

I am implementing 4th order discrete state-space equations which basically act as a lowpass filter with unity gain.  Ideally, the output should be equal to the input with some delay.

My output equation is

dmaxDacBuffer = ((Uint32)floor ((yout1 + kVoltageLimit) / voltageScaling)) << 8;

 

I am wondering if I am off base in my scaling.  If so, any help in the right direction would be appreciated.

  • Are you off base in your scaling? I cannot tell, because I do not know what your input signal amplitude range is or if the input is a signed or unsigned value.

    I think your second sentence has the terms backwards. It does not make sense to me the way it is stated.

    Your input equation does do scaling and shifting and offsetting, and if all of that is what you want to happen, then you are not off base. The name "uin" could imply an unsigned number, yet the equation could be interpreted as converting an unsigned input into a -VL to +VL double-precision input sample. Is this what you want?

    The unity gain seems to still be an issue if the input is scaled to 3.5VVp-p while the output is constrained to 3.1Vp-p. Do you disagree with that assessment?