Audio Library

Status
Not open for further replies.
If nobody beats me to the punch I will submit updates for those examples using AudioSynthWaveform soonish, in the meantime they compile for me if I include
Code:
[COLOR="#0000CD"]#[/COLOR]define ORIGINAL_AUDIOSYNTHWAVEFORM
before the Audio Library include line
Code:
[COLOR="#0000CD"]#[/COLOR]define ORIGINAL_AUDIOSYNTHWAVEFORM
#include <Audio.h>
#include <Wire.h>
#include <SD.h>
Mind you I am not going to just add that to any examples I find AudioSynthWaveform in, I like the new version.

Edit: Sorry, left off the # which must preceed define for a #define to define anything
 
Last edited:
Sorry about that. I didn't update the examples that I have used. I will get them in shape and try to have a pull request ready by sometime tomorrow.

Pete
 
frequency response of Teensy 3.0/3.1 Audio Adaptor board?

I'm interested in the T3.0/3.1 audio adaptor board http://www.pjrc.com/store/teensy3_audio.html if it can work for my somewhat odd application.

I want to measure and record low frequencies, around 10 Hz. Does anyone know the frequency response of the line-in or mic inputs? I checked the SGTL5000 datasheet and could not find it. I see that the chip itself supports sample rates from 8 kHz to 96 kHz, and there is a 5-band equalizer function starting at 115 Hz, and there is a spec for "Line-In -> ADC -> I2S Frequency response: 0.11 dB (typ.)" but over what frequency range? I think it very unlikely it has response at DC so what are the -3dB and -10 dB points on the low end? Thanks!

(For these low frequencies, the T3's built-in ADC may be a better choice, but the SGTL5000 has programmable mic gain and the ADC claims 85 dB SNR which seems good if it works low enough in frequency).
 
Last edited:
Using a TPA2016 with the Audio Adapter

The TPA2016 is a 2.8 watt stereo amplifier that can be controlled with I2C. I want to set gain and mute channels on the amp when using it with the audio adapter. Can I share the I2C bus with the audio adapter? Do I need to go to wire1 on the Teensy 3.1? If I can share the bus how do I handle wire.begin which appears in both the audio library and in the TPA2016 library? Thanks for your help :)

EDIT:
Should try before I post :) At least on the simple test of changing gain everything "just worked".
 
Last edited:
@JBeale

TL;DR look at the picture, and read last sentence below...

I am working up a Teensy 3.1/Audio Adapter based 'audio sweeper' for my employer so I needed to know that too. I've a sketch I'm working on which outputs a sine wave something not too far off 894mV PP on both lines out on Audio Adapter, and also on the DAC, and then it reads the SGTL5000 inputs (as lines in) into peak holding objects for an appropriate amount of time, sends results by Serial and changes the frequency to the next frequency in a table of frequencies adequate to cover 10Hz to 22050Hz in 276 steps without losing too much detail - current batch of code isn't tidiest and I intend some improvements to timing etc or I would just post it as it is right now; if nobody insists on seeing it sooner I will post it when I am really really proud of it ;)

Picture is Audio Adapter line out to Audio Adapter Line in measuring the peak result of sending a sine wave at a fixed amplitude across that frequency range; It is very very very similar per channel.
 

Attachments

  • snapshot-raw-could-use-to-calibrate.jpg
    snapshot-raw-could-use-to-calibrate.jpg
    180.4 KB · Views: 232
@robsoles Thank you very much for that graph, that's what I wanted to know! Looks like 10 Hz is roughly 6 dB down from the 1 kHz value, so there is still a fair amount of signal there. So you are doing a loopback measurement, does the signal plot use the SGTL5000 line out or the Teensy3.1 DAC? Or is the per-channel comment saying the two signal sources are nearly the same? I know the T3.1 DAC has ouput to DC, of course, in which case the low-frequency rolloff would be due just the input. Not sure if the audio adaptor output goes down to DC or not; they might have rolled it off to prevent some problems with DC going through headphones etc.

Note to Paul: I think it would be handy to see such a graph on the audio board product page :).
 
Last edited:
I've rewritten the AudioAnalyzeFFT256 object's averaging and magnitude computation.

Still doing testing here, but so far the output is greatly improved. :)

I know there's a long list of other bugs. Next I'm going to try looking into why certain WAV files don't play. If you have any WAV files that don't play, please let me know?
 
I tried to save in memory half a second of recording, stop recording and print after. With DEFAULT analog reference I get the right (a bit noisy) audio back (this time I do not lose samples). With INTERNAL, I still get zero output...

I'm still having this problem with the internal reference for the adc. As soon as the adc reference changes
Code:
		ADC0_SC2 = ADC_SC2_REFSEL(1); // 1.2V ref
I get zero output. Has anybody noticed a similar behavior?

Thanks,
Enrico
 
@JBeale: Very welcome. It is solely Audio Adapter outputs looped back to Audio Adapter inputs, my comment referring to left and right channels. I am yet to rate the DAC on Teensy beyond observing that it isn't too outrageously different (amplitude/Vpp) compared to Audio Adapter outputs when probed with an oscilloscope, not compared properly coz only probed one at a time on there and I haven't set up decoupling or buffering for it yet so I'll do that before rating it. If I read (and remember) all the appropriate parts of the SGTL5000 datasheet then the ADC has a high pass filter that we can bypass with the right access (I will submit an addition pull request soonish) and the only mention of a high pass filter in the DAC is related to DAP Bass enhance and, again, is optional.

Actually, reviewing my code I noticed that I put .dac_vol(97) in setup() because the difference between the output peak values and the input peak values was pretty big for my liking. I saved a new copy of it and modified it to use .dac_vol(100) and to sweep from 1Hz to 22049 - the PC based piece of software I am working on as the partner to this is what gave me the last graph and it is geared around the sweep starting at 10Hz so badly that I don't want to muck around making it plot this data starting from 1Hz, I am sure the majority of people who want to see it plotted will be able to plot it themselves but if anybody really insists I could get around to plotting it I guess.

Code:
Step, Frequency, LIN_L_Dpp, LIN_R_Dpp, LOUT_L_Dpp, LOUT_R_Dpp, DAC_OUT_Dpp, AudioSynthSine_Dpp
0,1,18245,18174,17871,17871,17871,17871
1,2,1375,1398,17871,17871,17871,17871
2,3,2865,2909,17871,17871,17871,17871
3,4,4654,4720,17871,17871,17871,17871
4,5,6578,6664,17871,17871,17871,17871
5,6,8500,8603,17871,17871,17871,17871
6,7,10343,10453,17871,17871,17871,17871
7,8,12055,12167,17871,17871,17871,17871
8,9,13611,13723,17871,17871,17871,17871
9,10,15014,15116,17871,17871,17871,17871
10,11,16271,16372,17871,17871,17871,17871
11,12,17400,17491,17871,17871,17871,17871
12,13,18402,18481,17871,17871,17871,17871
13,14,19287,19358,17871,17871,17871,17871
14,15,20065,20123,17871,17871,17871,17871
15,16,20767,20814,17871,17871,17871,17871
16,17,21382,21416,17871,17871,17871,17871
17,18,21932,21955,17871,17871,17871,17871
18,19,22412,22428,17871,17871,17871,17871
19,20,22860,22865,17871,17871,17871,17871
20,21,23257,23254,17871,17871,17871,17871
21,22,23611,23602,17871,17871,17871,17871
22,23,23930,23914,17871,17871,17871,17871
23,24,24215,24193,17871,17871,17871,17871
24,25,24477,24447,17871,17871,17871,17871
25,26,24702,24668,17871,17871,17871,17871
26,27,24901,24861,17871,17871,17871,17871
27,28,25076,25036,17871,17871,17871,17871
28,29,25231,25187,17871,17871,17871,17871
29,30,25382,25333,17871,17871,17871,17871
30,31,25517,25461,17871,17871,17871,17871
31,32,25652,25591,17871,17871,17871,17871
32,33,25819,25754,17871,17871,17871,17871
33,34,25940,25876,17871,17871,17871,17871
34,35,26071,25997,17871,17871,17871,17871
35,36,26175,26100,17871,17871,17871,17871
36,37,26287,26213,17871,17871,17871,17871
37,38,26378,26300,17871,17871,17871,17871
38,39,26449,26372,17871,17871,17871,17871
39,40,26512,26432,17871,17871,17871,17871
40,41,26532,26449,17871,17871,17871,17871
41,42,26598,26512,17871,17871,17871,17871
42,43,26686,26601,17871,17871,17871,17871
43,44,26735,26649,17871,17871,17871,17871
44,45,26798,26709,17871,17871,17871,17871
45,46,26866,26776,17871,17871,17871,17871
46,48,26999,26908,17871,17871,17871,17871
47,49,26994,26902,17871,17871,17871,17871
48,50,27049,26958,17871,17871,17871,17871
49,51,27110,27017,17871,17871,17871,17871
50,53,27218,27124,17871,17871,17871,17871
51,54,27200,27107,17871,17871,17871,17871
52,56,27270,27168,17871,17871,17871,17871
53,57,27258,27156,17871,17871,17871,17871
54,59,27308,27209,17871,17871,17871,17871
55,60,27341,27240,17871,17871,17871,17871
56,62,27402,27303,17871,17871,17871,17871
57,63,27418,27316,17871,17871,17871,17871
58,65,27476,27372,17871,17871,17871,17871
59,67,27531,27425,17871,17871,17871,17871
60,68,27520,27416,17871,17871,17871,17871
61,70,27575,27467,17871,17871,17871,17871
62,72,27601,27494,17871,17871,17871,17871
63,74,27615,27505,17871,17871,17871,17871
64,76,27637,27530,17871,17871,17871,17871
65,78,27655,27547,17871,17871,17871,17871
66,80,27686,27580,17871,17871,17871,17871
67,82,27727,27620,17871,17871,17871,17871
68,84,27741,27628,17870,17870,17870,17870
69,86,27770,27662,17871,17871,17871,17871
70,89,27758,27646,17871,17871,17871,17871
71,91,27786,27673,17871,17871,17871,17871
72,93,27819,27709,17871,17871,17871,17871
73,96,27819,27709,17871,17871,17871,17871
74,98,27851,27743,17870,17870,17870,17870
75,101,27887,27776,17871,17871,17871,17871
76,104,27891,27779,17871,17871,17871,17871
77,106,27873,27762,17871,17871,17871,17871
78,109,27904,27792,17871,17871,17871,17871
79,112,27934,27822,17871,17871,17871,17871
80,115,27928,27816,17871,17871,17871,17871
81,118,27927,27816,17871,17871,17871,17871
82,121,27968,27856,17870,17870,17870,17870
83,124,27959,27847,17871,17871,17871,17871
84,127,27952,27843,17870,17870,17870,17870
85,131,27998,27884,17871,17871,17871,17871
86,134,27973,27860,17871,17871,17871,17871
87,138,28005,27893,17871,17871,17871,17871
88,141,27995,27879,17871,17871,17871,17871
89,145,28030,27919,17871,17871,17871,17871
90,149,28015,27899,17871,17871,17871,17871
91,153,28030,27918,17870,17870,17870,17870
92,157,28048,27932,17871,17871,17871,17871
93,161,28051,27937,17870,17870,17870,17870
94,165,28031,27915,17871,17871,17871,17871
95,169,28059,27945,17871,17871,17871,17871
96,174,28072,27959,17871,17871,17871,17871
97,178,28069,27954,17871,17871,17871,17871
98,183,28064,27951,17871,17871,17871,17871
99,188,28072,27962,17870,17870,17870,17870
100,193,28100,27982,17871,17871,17871,17871
101,198,28078,27960,17871,17871,17871,17871
102,203,28106,27991,17870,17870,17870,17870
103,208,28093,27977,17869,17869,17869,17869
104,214,28084,27971,17869,17869,17869,17869
105,219,28114,27994,17870,17870,17870,17870
106,225,28118,28002,17871,17871,17871,17871
107,231,28121,28006,17870,17870,17870,17870
108,237,28111,27994,17870,17870,17870,17870
109,243,28120,28005,17870,17870,17870,17870
110,249,28135,28022,17871,17871,17871,17871
111,256,28131,28015,17871,17871,17871,17871
112,263,28139,28022,17871,17871,17871,17871
113,269,28137,28022,17870,17870,17870,17870
114,276,28158,28042,17871,17871,17871,17871
115,284,28138,28025,17871,17871,17871,17871
116,291,28150,28032,17870,17870,17870,17870
117,299,28152,28032,17871,17871,17871,17871
118,307,28162,28046,17870,17870,17870,17870
119,315,28164,28050,17870,17870,17870,17870
120,323,28180,28058,17871,17871,17871,17871
121,331,28170,28053,17871,17871,17871,17871
122,340,28179,28062,17870,17870,17870,17870
123,349,28184,28064,17871,17871,17871,17871
124,358,28184,28066,17871,17871,17871,17871
125,367,28183,28063,17869,17869,17869,17869
126,377,28200,28088,17870,17870,17870,17870
127,387,28194,28077,17866,17866,17866,17866
128,397,28199,28080,17870,17870,17870,17870
129,407,28198,28082,17871,17871,17871,17871
130,418,28209,28093,17871,17871,17871,17871
131,429,28213,28097,17869,17869,17869,17869
132,440,28224,28104,17870,17870,17870,17870
133,451,28231,28118,17871,17871,17871,17871
134,463,28238,28119,17871,17871,17871,17871
135,475,28235,28116,17870,17870,17870,17870
136,488,28247,28133,17871,17871,17871,17871
137,500,28249,28132,17870,17870,17870,17870
138,513,28255,28140,17870,17870,17870,17870
139,527,28267,28148,17871,17871,17871,17871
140,541,28273,28156,17871,17871,17871,17871
141,555,28278,28161,17870,17870,17870,17870
142,569,28285,28171,17870,17870,17870,17870
143,584,28298,28182,17870,17870,17870,17870
144,599,28316,28193,17871,17871,17871,17871
145,615,28315,28196,17870,17870,17870,17870
146,631,28323,28206,17868,17868,17868,17868
147,647,28329,28213,17870,17870,17870,17870
148,664,28351,28229,17869,17869,17869,17869
149,682,28359,28240,17871,17871,17871,17871
150,699,28372,28252,17870,17870,17870,17870
151,718,28380,28263,17870,17870,17870,17870
152,736,28394,28276,17871,17871,17871,17871
153,756,28406,28289,17871,17871,17871,17871
154,775,28416,28296,17869,17869,17869,17869
155,796,28434,28320,17871,17871,17871,17871
156,816,28438,28321,17866,17866,17866,17866
157,838,28466,28346,17871,17871,17871,17871
158,859,28480,28361,17871,17871,17871,17871
159,882,28493,28378,17866,17866,17866,17866
160,905,28509,28391,17871,17871,17871,17871
161,929,28528,28415,17868,17868,17868,17868
162,953,28543,28429,17869,17869,17869,17869
163,978,28565,28446,17870,17870,17870,17870
164,1003,28581,28466,17871,17871,17871,17871
165,1029,28599,28484,17870,17870,17870,17870
166,1056,28636,28520,17871,17871,17871,17871
167,1084,28655,28539,17871,17871,17871,17871
168,1112,28683,28566,17870,17869,17869,17869
169,1141,28705,28586,17868,17868,17868,17868
170,1171,28728,28610,17869,17869,17869,17869
171,1201,28747,28628,17871,17871,17871,17871
172,1233,28786,28667,17870,17870,17870,17870
173,1265,28806,28689,17871,17871,17871,17871
174,1298,28811,28695,17867,17867,17867,17867
175,1332,28878,28762,17871,17871,17871,17871
176,1366,28902,28782,17871,17871,17871,17871
177,1402,28932,28814,17871,17866,17866,17866
178,1439,28973,28855,17864,17864,17864,17864
179,1476,28971,28849,17871,17871,17871,17871
180,1515,29027,28902,17871,17871,17871,17871
181,1554,29061,28944,17871,17871,17871,17871
182,1595,29096,28979,17867,17867,17867,17867
183,1636,29106,28987,17863,17863,17863,17863
184,1679,29179,29058,17871,17871,17871,17871
185,1723,29202,29080,17869,17869,17869,17869
186,1768,29230,29093,17870,17870,17870,17870
187,1814,29283,29161,17869,17869,17869,17869
188,1861,29320,29201,17871,17871,17871,17871
189,1910,29337,29217,17871,17871,17871,17871
190,1960,29379,29260,17865,17865,17865,17865
191,2011,29389,29267,17871,17871,17871,17871
192,2063,29458,29337,17871,17871,17871,17871
193,2117,29498,29375,17871,17871,17871,17871
194,2172,29518,29398,17870,17870,17870,17870
195,2229,29556,29436,17870,17870,17870,17870
196,2287,29577,29457,17870,17870,17870,17870
197,2347,29604,29486,17869,17869,17869,17869
198,2408,29623,29502,17867,17867,17867,17867
199,2471,29651,29530,17870,17870,17870,17870
200,2535,29666,29543,17870,17870,17870,17870
201,2601,29666,29546,17852,17852,17852,17852
202,2669,29692,29571,17869,17869,17869,17869
203,2739,29698,29575,17871,17871,17871,17871
204,2810,29696,29573,17870,17870,17870,17870
205,2884,29687,29566,17870,17870,17870,17870
206,2959,29684,29561,17871,17871,17871,17871
207,3036,29662,29541,17871,17871,17871,17871
208,3115,29637,29517,17869,17869,17869,17869
209,3197,29622,29502,17867,17867,17867,17867
210,3280,29587,29465,17871,17871,17871,17871
211,3366,29537,29413,17870,17870,17870,17870
212,3453,29508,29388,17869,17869,17869,17869
213,3543,29457,29334,17871,17871,17871,17871
214,3636,29397,29274,17871,17871,17871,17871
215,3731,29331,29207,17870,17870,17870,17870
216,3828,29255,29138,17871,17871,17871,17871
217,3928,29164,29046,17870,17870,17870,17870
218,4030,29093,28974,17871,17871,17871,17871
219,4136,29004,28886,17825,17825,17825,17825
220,4243,28907,28787,17867,17867,17867,17867
221,4354,28815,28699,17871,17871,17871,17871
222,4468,28627,28512,17866,17866,17866,17866
223,4584,28629,28512,17869,17869,17869,17869
224,4704,28541,28423,17871,17871,17871,17871
225,4826,28461,28343,17860,17860,17860,17860
226,4952,28365,28249,17870,17870,17870,17870
227,5082,28303,28187,17871,17871,17871,17871
228,5214,28254,28136,17866,17866,17866,17866
229,5350,28207,28089,17871,17871,17871,17871
230,5490,28172,28053,17871,17871,17871,17871
231,5633,28166,28051,17869,17869,17869,17869
232,5780,28209,28094,17871,17871,17871,17871
233,5931,28262,28149,17870,17870,17870,17870
234,6085,28291,28175,17847,17847,17847,17847
235,6244,28430,28314,17870,17870,17870,17870
236,6407,28535,28419,17871,17871,17871,17871
237,6574,28660,28541,17870,17870,17870,17870
238,6745,28814,28697,17870,17870,17870,17870
239,6921,28943,28824,17863,17863,17863,17863
240,7102,29118,28994,17871,17871,17871,17871
241,7287,29258,29137,17871,17871,17871,17871
242,7477,29392,29268,17866,17866,17866,17866
243,7672,29444,29323,17842,17842,17842,17842
244,7872,29597,29474,17871,17871,17871,17871
245,8078,29642,29519,17867,17867,17867,17867
246,8288,29663,29537,17870,17870,17870,17870
247,8505,29658,29538,17869,17869,17869,17869
248,8726,29614,29494,17869,17869,17869,17869
249,8954,29414,29294,17870,17870,17870,17870
250,9188,29415,29293,17871,17871,17871,17871
251,9427,29232,29112,17869,17869,17869,17869
252,9673,29062,28942,17870,17870,17870,17870
253,9925,28862,28743,17858,17858,17858,17858
254,10184,28655,28535,17802,17802,17802,17802
255,10450,28375,28260,17871,17871,17871,17871
256,10722,28309,28192,17870,17870,17870,17870
257,11002,28248,28135,17871,17871,17871,17871
258,11289,28284,28171,17870,17870,17870,17870
259,11584,28411,28296,17870,17870,17870,17870
260,11886,28618,28501,17871,17871,17871,17871
261,12196,28862,28746,17870,17870,17870,17870
262,12514,29114,28993,17871,17871,17871,17871
263,12840,29337,29217,17871,17871,17871,17871
264,13175,29516,29394,17870,17870,17870,17870
265,13519,29584,29464,17871,17871,17871,17871
266,13871,29585,29464,17870,17870,17870,17870
267,14233,29530,29409,17845,17845,17845,17845
268,14604,29330,29212,17870,17870,17870,17870
269,14985,29109,28986,17871,17871,17871,17871
270,15376,28790,28673,17871,17871,17871,17871
271,15777,28517,28397,17871,17871,17871,17871
272,16189,28445,28328,17871,17871,17871,17871
273,16611,28492,28378,17871,17871,17871,17871
274,17044,28847,28729,17871,17871,17871,17871
275,17489,29250,29129,17870,17870,17870,17870
276,17945,29474,29356,17869,17869,17869,17869
277,18413,29477,29356,17870,17870,17870,17870
278,18893,29313,29194,17730,17730,17730,17730
279,19386,28179,28063,17869,17869,17869,17869
280,19892,26357,26251,17871,17871,17871,17871
281,20410,23294,23200,17871,17871,17871,17871
282,20943,19427,19349,17870,17870,17870,17870
283,21489,15323,15264,17870,17870,17870,17870
284,22049,11949,11896,12394,12394,12394,12394
I've been working with (0.894/3.3)*65535 as '0dB' but to graph the data in this table I would be very tempted to treat the highest value in the column of interest (column 3 or 4) as '0dB' and plot all values according around that.

Just FYI; here are the audio objects and the way they are connected in my sketch
Code:
AudioInputI2S stereoIn;
AudioMixer4 mixer_P; // to calibrate stereo_R against stereo_L if necessary.
AudioPeak peakIn[2];

AudioSynthWaveform synthSine;
AudioFilterBiquad filters_L(L_filters);
AudioFilterBiquad filters_R(R_filters);
AudioFilterBiquad filters_A(A_filters);

AudioMixer4 mixer_L;
AudioMixer4 mixer_R;
AudioMixer4 mixer_A;

AudioOutputI2S stereoOut;
AudioOutputAnalog monoOut;
AudioPeak peakOut[4];

AudioConnection cIn_L(stereoIn,0,peakIn[0],0);
AudioConnection cIn_P(stereoIn,1,mixer_P,0);
AudioConnection cIn_R(mixer_P,0,peakIn[1],0);

AudioConnection cFlt_L(synthSine,0,filters_L,0);
AudioConnection cFlt_R(synthSine,0,filters_R,0);
AudioConnection cFlt_A(synthSine,0,filters_A,0);
AudioConnection cPkRaw(synthSine,0,peakOut[3],0);

AudioConnection cMix_L(filters_L,0,mixer_L,0);
AudioConnection cMix_Ls(synthSine,0,mixer_L,1);
AudioConnection cMix_R(filters_R,0,mixer_R,0);
AudioConnection cMix_Rs(synthSine,0,mixer_R,1);
AudioConnection cMix_A(filters_A,0,mixer_A,0);
AudioConnection cMix_As(synthSine,0,mixer_A,1);

AudioConnection cOut_L(mixer_L,0,stereoOut,0);
AudioConnection cPeak_L(mixer_L,0,peakOut[0],0);
AudioConnection cOut_R(mixer_R,0,stereoOut,1);
AudioConnection cPeak_R(mixer_R,0,peakOut[1],0);
AudioConnection cOut_A(mixer_A,0,monoOut,0);
AudioConnection cPeak_A(mixer_A,0,peakOut[2],0);
And here is the line printing the data I posted above
Code:
    Serial.printf("%u,%u,%u,%u,%u,%u,%u,%u\n",steps,(unsigned short)freq,peakIn[0].Dpp(),peakIn[1].Dpp(),peakOut[0].Dpp(),peakOut[1].Dpp(),peakOut[2].Dpp(),peakOut[3].Dpp());
freq is a float so it can be calculated instead of tabled, AudioSynthWaveform doesn't do fractions of frequencies so the frequency is cast as an unsigned short for it as well.
 
I've just committed a fix for the WAV file parsing bug.

If you were having trouble playing certain WAV files, please give it another try and let me know how it works?
 
Paul, is there a limit in the length of the song ? I have a short and a long version of the file I posted above, the long version is about 2 minutes and it doesn't play, is this normal ?
 
Thanks. Got the files. I'm looking into it now.

So far, all the documentation I've found says the "fmt" chunk of a WAV file is 16 bytes if the encoding is PCM. These have 18 bytes....
 
I've committed code to (hopefully) handle extended format WAV headers. The two files from #364 are now able to play. :)

Please let me know how this works for you?
 
I suspect the SGTL5000 is DC-coupled internally and the high-pass comes from the external input and output capacitors.

The latest version of Freescale's data sheet (http://cache.freescale.com/files/analog/doc/data_sheet/SGTL5000.pdf?pspll=1) mentions that SGTL5000.PNG
the LINE in and MIC input impedance parameter values have been updated (29 kohm and 2.9 kohm). With the 1 uF LINE_IN coupling capacitors (0.1 uF on MIC) on the reference design, this would give a cutoff of 1/(6.28*29k*1u) = 5 Hz for LINE_IN (and 500 Hz for MIC).

Paul -- what coupling capacitance does the audio adapter use ? I am interested because I want to (ab)use the IC for other purposes and also need good LF response.

@JBeale

TL;DR look at the picture, and read last sentence below...

I am working up a Teensy 3.1/Audio Adapter based 'audio sweeper' for my employer so I needed to know that too. I've a sketch I'm working on which outputs a sine wave something not too far off 894mV PP on both lines out on Audio Adapter, and also on the DAC, and then it reads the SGTL5000 inputs (as lines in) into peak holding objects for an appropriate amount of time, sends results by Serial and changes the frequency to the next frequency in a table of frequencies adequate to cover 10Hz to 22050Hz in 276 steps without losing too much detail - current batch of code isn't tidiest and I intend some improvements to timing etc or I would just post it as it is right now; if nobody insists on seeing it sooner I will post it when I am really really proud of it ;)

Picture is Audio Adapter line out to Audio Adapter Line in measuring the peak result of sending a sine wave at a fixed amplitude across that frequency range; It is very very very similar per channel.
 
@robsoles: thanks, great info. I plotted your data and it looks good from 2Hz up. The 1 Hz value looks like a glitch of some sort but I can ignore that.
I would be interested in control of a high-pass input filter on the SGTL5000. I see some control bits in Table 21. CHIP_ADCDAC_CTRL 0x000E on p. 34 of the datasheet called ADC_HPF_BYPASS and ADC_HPF_FREEZE so maybe with the right settings you could turn off the high-pass filter and get true DC input response from the ADC... interesting. Maybe I would need to bypass any external input coupling caps on the board, though.
 
Paul -- what coupling capacitance does the audio adapter use ? I am interested because I want to (ab)use the IC for other purposes and also need good LF response.

1 uF. The audio adapter pretty follows Freescale's recommended schematic.

You could solder a short in place of the capacitor, and use an external capacitor like 10 uF or larger.
 
Hi Paul,
Im using your teensy 3.1 with the audio adaptor, my intention is to reproduce a stereo song from SD card. I used your example PlayWavFromSdCard, previously I stored a .WAV song in the SD card, and modified your example for the name of my song. When i try to upload i never hear the song by the headphones.

could you please give some considerations for the .WAV file, does it has to have some characteristics like duration or size. How can i store the file in the SD with those characteristics in my PC?
 
juanGO: when did you last download the library ? Paul made some changes today that fixed the issues I was having with some waves.
 
Status
Not open for further replies.
Back
Top