Electronics > Projects, Designs, and Technical Stuff
How can I tell if a USB sound card input reaches or exceeds clipping level?
(1/1)
Chris Wilson:
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:




magic:
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.
DaJMasta:
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.
Someone:

--- Quote from: DaJMasta on November 17, 2019, 04:01:07 pm ---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.
--- End quote ---
Its 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.htm
Hardware with time stamped gpio transitions are much less common than soundcards.
NiHaoMike:
How about use a FX2 board that can sample 16 channels at up to 12MHz?
Navigation
Message Index
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod