PEAK object only reading 1.6v PP max

Status
Not open for further replies.

flightlessturd

Active member
Hi,

I'm using the Audio Shield with voltages on the Line-in (L&R) between 1.6vpp and 2.8vpp (about 0v) and was hoping to use the PEAK object (via I2S) to read these values and use them to light various LEDs within this range. Unfortunately it seem the PEAK object will only analyse voltages between +/-0.8v.

Is there a reason for this and can it be changed?

Many thanks!
 
In the audio library, signals are always normalized to a 1.0 scale, where 1.0 is the maximum signal. It's not actual voltage.

If you're using the line inputs where the default range is 1.33V, then you'd need to multiply the normalized value by 1.33.

The input can support different voltage ranges, using sgtl5000.lineInLevel(). Details are in the design tool. Scroll down on the right-side documentation panel to "Signal Levels".

http://www.pjrc.com/teensy/gui/?info=AudioControlSGTL5000

Whatever setting you're using will require a different multiplier to scale the 1.0 normalized numbers to the actual voltages.
 
Hi Paul,

Thanks again for the quick replay.

Ahh! I forgot about the sgtl5000.lineInLevel(), many thanks for your time.

Having looked at it, theremight be an error in the documentation:

lineInLevel(both);
Adjust the sensitivity of the line-level inputs. Fifteen settings are possible:
0: 3.12 Volts p-p
1: 2.63 Volts p-p
2: 2.22 Volts p-p
3: 1.87 Volts p-p
4: 1.58 Volts p-p
5: 1.33 Volts p-p (default)

Looking at the scope I think setting "0" is 3.2 (perhaps 3.21) rather than 3.12v pp. Might be worth checking again?
 
Status
Not open for further replies.
Back
Top