Close

Hack Chat Transcript, Part 1

A event log for Signal Conditioning Hack Chat

Massage those signals

dan-maloneyDan Maloney 02/17/2021 at 21:070 Comments

Jon Foote11:57 AM
Hello, this is Jon, hoping I'm in the right place!

Indeed you are, welcome Jon!

Jon Foote11:58 AM
Thanks Dan, and thanks for putting this together.

morgan11:59 AM
hi Jon! long time, how's things?

Jon Foote11:59 AM
And thanks to @Aleksandar Bradic for the poster which is seriously DOPE

Aleksandar Bradic11:59 AM
ha :) thanks!

OK folks, let's get started. Welcome to the Hack Chat, I'm Dan and I'll be moderating along with @Dusan Petrovic . We want to welcome Jonathan Foote to the channel today to talk about signal conditioning. TBH it was hard for us to settle on a topic because Jon has such a wide range of interests, but we figured this could be a fun topic that we haven't talked about much on the Chat before.

Welcome Jon -- can you kick us off with a little about yourself?

Dusan Petrovic12:00 PM
Hello and welcome all!

Jon Foote12:01 PM
Sure! People ask me what I do and I say I'm a "recovering scientist"

Jon Foote12:01 PM
I played the academic game for a while after grad school -- I did a postdoc in Cambridge England

Jon Foote12:01 PM
Then I did a fellowship in Singapore

Jon Foote12:02 PM
The academic thing wasn't working out so well so I settled for a cushy job in industry

Dave Blundell12:02 PM
define "cushy" ?

Jon Foote12:03 PM
Sure -- as opposed to an academic gig which is like three jobs: teaching, service, publish or perish, a 9-5 counts as "cushy" lol

Daniel Lynch joined the room.12:03 PM

Jon Foote12:03 PM
Huge respect to those in the professor biz it's a lot of work and scary because tenure is not a given

Dave Blundell12:03 PM
My little brother is trying to decide whether he wants to stay in academia after his doctorate or venture into the world. It's different, for sure.

kalspelletich12:04 PM
Jon, What are you excited about to work on>?

Jon Foote12:04 PM
So I did a lot of fun things at the researh lab (called FXPAL, FX=Fuji Xerox, kind of a PARC wannabe)

Jon Foote12:04 PM
Like using some the things I had worked on in grad school for speech recognition and analyzing music and video

Jon Foote12:05 PM
Some of the patents on those have run out so it may be time to look at those again :)

Jon Foote12:05 PM
On fun invention I called the "beat spectrum" which was a way of analyzing the tempo and rhythmic structure of music

Jon Foote12:06 PM
Hang on I will drop a link

niel joined the room.12:06 PM

Leigh L. Klotz, Jr. joined the room.12:06 PM

Jon Foote12:06 PM

http://rotormind.com/projects/portfolio/Beat_Spectrum/

Rotormind

Jonathan Foote Portfolio

For a number of years I worked on an approach to analyze audio and video based on self-similarity. Comparing every part of a media file exhaustively with every other part results in a "similarity matrix" that both visualizes the time structure of the media and facilitates further analysis like segmentation or verse/chorus detection in popular music.

Read this on Rotormind

Leigh L. Klotz, Jr.12:06 PM
Hey Jon - is this related to the viz work you did that I helped review?

jeff joined the room.12:06 PM

Jon Foote12:06 PM
Hello, I see some names I recognize -- yes Leigh, it was

Leigh L. Klotz, Jr.12:07 PM
I was hoping so. I really enjoyed that and am here to see where you've taken it and your other signals work. Thanks for doing this!

Johnathan Carlson12:07 PM
Hey Jon. I know you did a VCV hackchat before and mentioning the Beat Spectrum project there- is music and synthesis your main focus?

Jon Foote12:07 PM
So after my time at the research lab I took a year off to do some less-formal work (among other things working with artists like @kalspelletich

Jon Foote12:08 PM
ANd I did some consulting to pay the rent, and 15 years later I'm still doing the same thing, so I've failed to both specialize and get back on the hamster wheel

M joined the room.12:08 PM

smatterchoo joined the room.12:09 PM

Johnathan Carlson12:09 PM
lol, nothing wrong with that anyway. Just means you get to see a broader spectrum of cool projects

Doctor Popular joined the room.12:09 PM

Jon Foote12:09 PM
So I've worked for a lot of startups doing some interesting things like a surgical robotic system that needed a lot of instrumentation for pressure, position, water flow (it uses a supersonic jet of h20 to remove tissue)

Doctor Popular12:09 PM
The Beat Spectrum visual looks amazing btw.

kalspelletich12:09 PM
How has the pandemic affected you and your output>?

bendersteed joined the room.12:09 PM

Jon Foote12:10 PM
so I have been collecting types of sensors and how to use them and massage the data so it's useful

morgan12:10 PM
what's your favorite/oddest sensor in your collection?

Leigh L. Klotz, Jr.12:10 PM
I remember working on mathematical morphology and convolutions for image processing. Now with all the interest in applying neural networks to morphology and convolutions (CNN), do you have any thoughts on using your beat spectrum as an input to an DNN?

Jon Foote12:10 PM
The pandemic has been a little tough mentally though I can't complain as I have food and shelter

Jon Foote12:11 PM
A lot of my clients kind of ghosted but they are coming back.

Jon Foote12:11 PM
Yeah with the neural network things, I've been trying to keep up with that. The latest hotness seems to be putting PURE TIME DOMAIN data into them and they still work if anything even better

Jon Foote12:12 PM
I will bet there is some layer that still looks like higher-order processing (spectral representation) or something but it's super interesting

Leigh L. Klotz, Jr.12:12 PM
So instead of a 2D input you give a 1D input and something learns the long and short time correlations.

Jon Foote12:13 PM
Exactly! This is cool because it made most of my Ph.D. completely obsolete lol

smatterchoo12:13 PM
that's AI for you :) Any recommendations on papers you're reading re timeseries data

Jon Foote12:13 PM
Yes, I'm trying to keep on top of it because it's clearly very powerful but it changes quickly and requires a huge amount of data + cpu

Jon Foote12:14 PM
Oh boy I'd have to research that. Maybe after that chat I don't have a link at hand

Jon Foote12:15 PM
But I think there's still a lot of room for old school DSP especially on micros

Jon Foote12:16 PM
There's this thing called "LPC" -- linear predictive coding -- that they used for speech analysis back in the day. Very lightweight, fast way to get an all-pole model of a signal, which gives you the resonant peaks

Johnathan Carlson12:16 PM
Yeah. Espicially since Micros are largely getting to the point where an FPU is cheap enough to be standard on most everything.

Jon Foote12:16 PM
Yes exactly. This might be fun for looking at music, particularly a single instrument.

Johnathan Carlson12:17 PM
For sure. I'm huge into eurorack and I've found it mildly entertaining watch as more modules are just a micro behind the panel than analog circuits

Jon Foote12:17 PM
I love the Eurorack community but have not actually dipped my toes

Jon Foote12:18 PM
because it looks hugely addictive!

Jon Foote12:18 PM
I want to shout out to VCV rack which is an Eurorack software synthesizer, FOSS

Jon Foote12:18 PM
great place to get your feet wet if you are interested in analog synthesis. Also it's free

Kevin Andersen12:19 PM
for eurorack I've found it very interesting to study Mutable Instruments hardware and firmware resources (eg https://mutable-instruments.net/modules/plaits/open_source/)

smatterchoo12:19 PM
I'm a computer science guy who recently started tinkering with sensors and I've been amazed at how noisy the signals are. for example for a class for high schoolers I was trying to show them how you can just put your thumb over a webcam and see your pulse, but there's crazy variability based on the pressure of your thumb.. Is there a good cookbook of processing techniques for this kind of thing?

Johnathan Carlson12:19 PM
It is. VCV has gotten hugely better though and the DIY scene a lot stronger, so while I wouldn't call it affordable, I don't know that's it's tons more expensive than any other hobby (photography, cars, etc.)

Johnathan Carlson12:19 PM
erm, I was unclear there- the DIY eurorack hardware scene

Jon Foote12:19 PM
@smatterchoo

Jon Foote12:20 PM
that's a great question, I don't know of any books, does anyone? A lot of tricks are pretty standard

Jon Foote12:20 PM
but a lot depends on the particular signal and sensor. Did you get the pulse to work?

Johnathan Carlson12:21 PM
I wouldn't say 'cookbook' but Signals & System from Oppenheim and https://ccrma.stanford.edu/~jos/sasp/ are a good start

smatterchoo12:21 PM
You can visualize it easily and then just give up on having an algorithm report the pulse rate. By the way the same issue exists in fingertip pulse oximetry where they solved it by just incorporating a spring loaded clamp and the sensor to keep the pressure relatively constant.

Jon Foote12:21 PM
Excellent, great resources. S&S was my textbook

Jon Foote12:22 PM
I worked on a pulse oxmeter for a client and the changes are very small compared to the noise. Used a TI chip specially designed to do that

Johnathan Carlson12:22 PM
S&S is still *the* textbook. I only took the class two semesters ago and it's what my prof used, and it seems what everyone is still using at every uni

shalom12:22 PM
Practical Signal Processing is an amazing book

Jon Foote12:22 PM
Good I hope things would have advanced a little

Daniel Lynch12:22 PM
Can confirm, regarding S&S at uni. Do folks still use "The Art of Electronics"?

Jon Foote12:23 PM
I keep finding these amazing tutorials -- like one for the Kalman filter (Hi Kal!)

Jon Foote12:23 PM
that I would have LOVED ti have while learning it

Milkey Mouse12:23 PM
Can you link the kalman filter tutorial? Sounds interesting

Jon Foote12:23 PM
Art of Electronics has a new edition out and it's superb

Johnathan Carlson12:23 PM
Yep. Unfortunately both S&S and AoE are pretty dense. I feel like they expect the math to just come naturally, as easy as reading a normal novel. So while I can't reccomend anything better I still don't love them

kalspelletich12:23 PM
haha, hi jon!

doctek12:23 PM
S&S is fine for academics, but little for the experimenter, IMHO.

Sophi Kravitz12:24 PM
I love AoE

Sophi Kravitz12:24 PM
hi Jon!

Kevin Andersen12:24 PM
I spent the holidays reading The Scientist and Engineers Guide to DSP. It was a great at explaining the theory and math, but lacked practical examples

Jon Foote12:24 PM
Yes I thnk theres a lot of room for more gentle texts

Jon Foote12:24 PM
And I think I lot of people are like me that if they don't have a good application it's hard to learn something

shalom12:25 PM
Think DSP is a nice compact read with a lot of python demos

Jon Foote12:25 PM
like the Kalman filter I was taught pure theory -- they didn't even mention it's how the Apollo navigated to the moon!

smatterchoo12:25 PM
Kevin Karplus at UCSC has a new intro book that is applications focused

Leigh L. Klotz, Jr.12:25 PM
If you're interested in DSP for communications, fldigi has a wide base of modems, all in C and C++. https://github.com/w1hkj/fldigi/

Kevin Andersen12:25 PM
I found AoE to be most useful as a lookup, but found it hard to learn about electronics through it. Eg. there are lots of amplifiers, but how do I find out which one if the best type for what I'm doing?

Johnathan Carlson12:25 PM
While not a text book by any means, I've been having sucesses teaching myself signals-y stuff using a mix of https://www.vult-dsp.com/vult-language and Purr-Data (a fork of Pure-Data) both of which can be loaded though the VCV Rack 'Prototype' module. Of course, that's focused on sound/music compared to DSP for like radio/images/etc. but I still think it's a good place to start.

Jon Foote12:26 PM
Great suggestions all, I will try to collate these!

Daniel Lynch12:26 PM
Regarding DSP and speech analysis, do you think there's a future for non-AI or non-learning-based approaches to speech recognition?

carl210r joined the room.12:26 PM

Jon Foote12:27 PM
I still have some friends in the speech recognition business and their general opinion is no -- neural networks are the way to go

We did a Hack Chat with Marc Lichtman last year, he authored a great guide to DSP using an SDR and Python:


https://hackaday.io/event/175347-learning-dsp-and-sdr-hack-chat

Hackaday

Learning DSP and SDR Hack Chat

Marc Lichtman will host the Hack Chat on Wednesday, November 11, 2020 at noon Pacific Time. Time zones got you down? Here's a handy time converter! "Revolution" is a term thrown about with a lot less care than it probably should be, especially in fields like electronics.

Read this on Hackaday

Jon Foote12:27 PM
Great -- SDR is something *I* want to learn!

And BTW, I will post a transcript at the end of the chat, if anyone needs to copy a link or something

Kevin Andersen12:28 PM
@smatterchoo this one? https://leanpub.com/applied_analog_electronics

Jon Foote12:28 PM
@Daniel Lynch do you have a speech recognition paradigm that's not learning based?

Jon Foote12:28 PM
Transcript would be great.

smatterchoo12:28 PM
(I don't want to clutter the chat by thanking everyone individually but thanks all, these are great references!)

Daniel Lynch12:28 PM
Ha, no. I wish! I'm just interested in stuff that's lightweight and fast.

shalom12:28 PM
SDR is a great way to experiment with signal processing... get a Pluto

Jon Foote12:28 PM
Hi @Sophi Kravitz who waved a little before!

Jon Foote12:29 PM
Also the Teensy does amazing DSP for audio

doctek12:29 PM
Are we still planning to discuss signal conditioning?

Jon Foote12:30 PM
there was a discussion on the Teensy board about implementing the Moog filter -- amazing

smatterchoo12:30 PM
@Kevin Andersen yep that's the one

Jon Foote12:30 PM
Signal conditioning -- depends on the signal, and the conditions (lol). Anything in particular?

doctek12:31 PM
Low level signal over a 1 to 5 foot distance to a 3.3V AtoD.

Jon Foote12:31 PM
General good practice is to keep noise sources awa: use filter caps, twisted pair, shielding

Johnathan Carlson12:31 PM
I'd like to know more about limiters, compression, mulit-band compresison, and noise removal. The last in that list espically strikes me as black magic.

doctek12:31 PM
Define good shielding, please.

Jon Foote12:32 PM
A2Ds can be tough because they are high-impedance and will pick up a lot

Johnathan Carlson12:32 PM
I'd also like to understand balanced audio better. I'm about ready to rip out my entire ... everything. So that I can replace my noisy ATX PSU powered subwoffers with something that doesn't hum.

@Jon Foote - are current loops used much anymore? 4-20 mA stuff? If so, mostly industrial sensors, I'd imagine?

Jon Foote12:32 PM
So for A2ds I usually use a mix of analog (filter caps, ferrites, maybe an active lowpass someplace) plus oversampling and DSP

doctek12:33 PM
True. Should a preamp be used? Where should filtering go?

Jon Foote12:33 PM
Yes current loops are still around and still great.

Jon Foote12:33 PM
I think more people should use them because they are really robust to noise

doctek12:33 PM
Any good reference with details?

Jon Foote12:34 PM
Boy this all depends on the particular signal -- impedance, bandwidth, so hard to give a general solution

Dave Blundell12:34 PM
I don't know whether it is prim and proper but I'll usually include a passive RC or opamp active filter tuned to 2.5-3x the expected sampling speed.

Dave Blundell12:34 PM
for ADC

morgan12:35 PM
oh neat, i've never encounter current loops before

Jon Foote12:35 PM
Probably want to keep frequencies below the Nyquist limit: 1/2 sample rate

doctek12:36 PM
What is power consumption like for a current loop?

Chris Ryding12:36 PM
Current loop 4-20mA output sensor modules are often used for industrial applications where the sensors are a "long" distance from the receiver. They are less susceptible to noise and the minimum 4mA level lets you know if they become disconnected.

Jon Foote12:37 PM
You can make a little tester that's just an LED

Jon Foote12:37 PM
Someone asked about noise removal and I have to say I'm impressed with the one in Audacity

Jon Foote12:37 PM
I've been remastering some cassettes and boy does it help with the hiss

Jon Foote12:38 PM
But I don't know how it works! I'm guessing spectral subtraction

Johnathan Carlson12:38 PM
Yeah, it gets a sample of the noise first though, I imagine to see the spectrum it occupies?

But the hiss gives is "character"...

morgan12:38 PM
*pop*

Jon Foote12:38 PM
Yes guessing spectral subtraction

Kevin Andersen12:39 PM
I'm working on a sensor that uses a piezoelectric sensor to pick up audio up from a surface and want to do real-time DSP on it inside a micro. It seems I should put in an amplifier, limiter to prevent blowing out the ADC and maybe some filters. But what kind of amplifier/limiter/filter? any good learning resources so that I could find out myself?

Johnathan Carlson12:39 PM
I mean, to some extent noise in music *can* be desireable @Dan Maloney

Leigh L. Klotz, Jr.12:39 PM
20ma current loops - teletype!

Jon Foote12:39 PM
Piezo sensor: probably a preamp like from Adafruit would work. They are high impedance

I was actually only slightly kidding -- still love to listen to my old tapes once in a while. Brings you back

Jon Foote12:39 PM
and I would put a zener across it

Jon Foote12:40 PM
to clamp high voltages. For big signals like tapping you can put a piezo right into a GPIO

Jon Foote12:40 PM
And hope the protection diodes work. :)

Jon Foote12:41 PM
Don't get me started on how terrible cassettes are because I will rant like an old fart :)

Johnathan Carlson12:41 PM
if you scroll down a bit on http://www.doepfer.de/DIY/a100_diy.htm they have a dead simple voltage clamping/limiting circuit with a good explanation

Kevin Andersen12:41 PM
thanks Jon and Johnathan!

Daniel Lynch12:41 PM
re: putting a zener across it, that sounds like the clipping circuits in those old guitar distortion pedals, like the ProCo RAT. Have you seen uses for that outside music?

Johnathan Carlson12:42 PM
"All these young wipersnappers using Vinyl, don't they know wax cylinders are the only true way to listen"

Jon Foote12:42 PM
Zener clipping? Pretty standard protection circuit

Jon Foote12:43 PM
also TVS which is two back-to-back? Use them a lot on motor driver outputs to

Leigh L. Klotz, Jr.12:43 PM
I used a piezo and uC with a zener to detect motion of a bike and enable a ham radio / APRS / GPS transmitter. It worked, though the zener did rectify some RF and I had to bypass it, but not too much because the motion was also impulsey and had high frequency components.

Johnathan Carlson12:43 PM
Yeah, good quick n' dirty way to make sure you don't fry a micro

Jon Foote12:43 PM
TVS wil snub some of the noise from PWMing motor coils

"Wax cylinders? Back in my day if we wanted to listen to music, we paid chamber musicians to play. And we liked it that way!"

morgan12:43 PM
heh

Dave Blundell12:43 PM
i've used a lot more dual schottky than zener clamp. You end up with (0 - Vf) and (VCC + Vf) for your clamping voltages. I was under the impression that this setup had less capacitance than a zener clamp

Jon Foote12:44 PM
Sounds right! Also I've seen more than one zener fail shorted. Ouch.

Dave Blundell12:44 PM
that's a diode in general thing... fail shorted.

Jon Foote12:45 PM
For signal processing, you can clamp -- "limiter" with a diode and an opamp

Johnathan Carlson12:45 PM
It's definitely a use what you need sorta thing. it's not like it'll add to your BOM, so it's more a matter of if you need bipolar and what kinda signal are you trying to shove down the wire: if it's high rate data you might need to care, if it's audio, the clipping adds character ;)

Jon Foote12:45 PM
there's a few circuits in AoE if memory serves.

Dave Blundell12:46 PM
One of the more challenging signals I've been a party to dealing with lately is ion sensing. Using a ~400V bias signal applied to the primary of a car's ignition coil when the spark is not active and sensing current

Dave Blundell12:46 PM
with the goal of sampling current on a MCU

Jon Foote12:46 PM
Hah! I did a stupid hack triggering a selfie stick with a cattle prod and that was actually really tricky

Johnathan Carlson12:47 PM
Yeah, just checked my 110% legal AoE 3rd ed. PDF, it's in there.

Jon Foote12:47 PM
How did you approach it?

Kevin Andersen12:47 PM
yeah there are quite a few circuits in AoE, but that's actually my problem. Which one to choose? It doesn't seem obvious to me which one to choose over another and why? that's where the book falls short for me

Jon Foote12:48 PM
Hmm, yes I see that could be an issue

tubetime joined the room.12:49 PM

doctek12:49 PM
In the analog world, a combination of breadboarding and SPICE can really help..

Jon Foote12:49 PM
Not sure I have a good answer, usually it's how little can I get away with and what parts do I have on hand ?

mgrusin joined the room.12:49 PM

Johnathan Carlson12:49 PM
I don't know how relevent it is, but the cattle prod reminds me: I do some lichtenberg figure burining with an oil ignition transformer- sometimes it takes a while to actually start up. Would there be any way to measure a signal from it to see if the transformer is working harder than it should be, if I should boost/lower the input voltage based on current, etc? Just curious if you have some ideas were some signal processing could lead t

Discussions