How can I tell if a USB sound card input reaches or exceeds clipping level? - Page 1
Forum section: electronics / projects

author: Chris Wilson
author_rank: Super Contributor
timestamp: November 17, 2019, 02:52:18 pm
content: I want to lock the frequency output of a USB sound card toa GPS 1 pulse per second time sample from either my Trimble Thunderbolt or another GPS unit according to these instructions using Spectrum Lab. But I do not know how to see if the pulse exceeds the cards clipping input level, can anyone give me some guidance please? many thanks!The PPS signal must be routed to the soundcard 'line' input, using a voltage divider close to the soundcard's analog 'line' input to avoid overloading it. It may be possible to feed the GPS receiver's serial NMEA data stream into the same soundcard. This allows to retrieve also the calendar date and time from the GPS receiver, not just the time sync pulse (beware, an ancient GPS receiver -not a Garmin- only emitted the UTC time, but not the date). To use the same input line for both PPS + serial NMEA data, both signals must not 'overlap' in time, see sample oscillogram below. The Garmin GPS 18x LVC(!) fulfils this requirement, after setting the baudrate for the NMEA output to 19200 bits per second. This can be achieved with Garmin's 'Sensor Configuration Software', SNSRCFG_320.exe or later. Lower bitrates like 9600 bits/second are be possible if you can manage to turn off all 'unnecessary' NMEA sentences like $GPRMC, $GPGSV, etc. With the GPS 18x LVC configured for GPRMC + GPGGA only (which is sufficient for this purpose), 9k6 serial ouput was ok, and was error-free decodable with a soundcard running at 32000 samples/second (to reduce CPU load for a timestamped VLF 'live' stream).If a combined PPS+NMEA signal shall be used, the amplitude of the PPS signal must be at least two times larger than the NMEA signal - see the example below, from the GPS 18x LVC, with NMEA output at 19200 bits/second. The 'single large pulse' on the left is the PPS signal, the 'data burst' in the center are the NMEA sentences, emitted each second. Note the absence of overlap between the sync pulse (PPS signal) and NMEA data burst, and the significantly lower amplitude of the NMEA signal, which is essential for the software to work properly:

author: magic
author_rank: Super Contributor
timestamp: November 17, 2019, 03:20:14 pm
content: 2V RMS is quite common in consumer audio. 1Vpp will likely be OK for any soundcard. 100mVpp is still above noise floor.It also depends on line-in volume setting, most soundcards have built-in input PGAs, so check that.As for how to check it - just record and see what it looks like in any audio editor like (free) Audacity.

author: DaJMasta
author_rank: Super Contributor
timestamp: November 17, 2019, 04:01:07 pm
content: It seems so complicated to do things this way... if you've got a USB sound card, you're basically guaranteed to have something that's capable of a basic serial connection and a GPIO - maybe even the USB controller the sound card uses can do it. Just seems like such overkill required in processing vs. just doing it the intended way.That said, if you're going through the trouble to decode a serial line from a sound input... why not just combine it with the PPS signal? Resistor combiner with a divider resistor, just have the two signals overlaid on top of each other. Your sound card can show you when it clips, so just make the bottom leg of the divider a potentiometer or have the ability to switch it around to get the level you're looking for. DC coupling would be easiest to decode if your PPS signal is just an alternation every second, but if it's a fairly short pulse, a DC blocking cap would work fine, provided it's not so short that your sample rate misses it.

author: Someone
author_rank: Super Contributor
timestamp: November 17, 2019, 09:34:24 pm
content: Quote from: DaJMasta on November 17, 2019, 04:01:07 pmIts a part of a bigger idea for calibrating local references (in this case a sound card sampling clock):https://www.qsl.net/dl4yhf/speclab/frqcalib.htmHardware with time stamped gpio transitions are much less common than soundcards.

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 17, 2019, 10:23:53 pm
content: How about use a FX2 board that can sample 16 channels at up to 12MHz?