Welcome to Pragmatic.
Pragmatic is a discussion show contemplating the practical application of technology.
By exploring the real-world trade-offs, we look at how great ideas are transformed into products and services that can change our lives.
Nothing is as simple as it seems.
Pragmatic is part of the Engineered Network.
For other great shows, visit engineered.network today.
This episode is brought to you by Sapient Pair and their iOS app, Shopee.
Shopee is a free collaborative shopping list app that's simple and easy to use
and we'll talk more about them during the show. I'm your host, John Chidjie, and
I'm joined today by my co-host, Carmen Parisi. How's it going, Carmen?
Pretty good, John. How about you?
Very good. Very good, thank you.
So, I just want to start with...
Wonderful.
Yes. So I just wanted to, before we dive into today's topic,
which will be software radios,
I just want to have a quick discussion about what's happened in the
last six months. So when I wrapped up Pragmatic about six months ago,
I actually had no intention of bringing it back at all.
I think I did a pretty comprehensive job of wrapping it up actually.
And I underestimated,
significantly underestimated just how many people that annoyed.
And the fans of the show were very, very vocal to me.
And I continue to get emails about it, you know,
even this week and just asking about ways
that I could bring the show back somehow.
And just, it meant doing it less regularly or something,
you know, getting more help with the show,
something like that.
So I did a lot of soul searching
and over the last six months,
and I decided that what I think was lacking
wasn't just Pragmatic as a show,
but it was the kind of content
that I think that pragmatic offers, which is sort of focused engineering related content.
And it's like a tackle the way an engineer would tackle a problem.
And I guess that's what I felt was lacking in the podcast space.
Yeah, there's some out there, but they're scattered everywhere.
And I looked for networks that would support a show like this.
And fundamentally, I just I couldn't find any.
Yeah, I looked, I couldn't find it.
So being crazy, I decided to start my own.
And I'm calling it the Engineered Network, or TEN for short.
Now, it's a small network, and for now, and it may stay very small or it may grow.
We'll see what happens. Either way, I guess I'll find out the rest of the world feels the same way I do, I guess.
Anyway, in order to keep making the show pragmatic, I've cut the frequency of the show back to once a fortnight,
which many fans suggested.
So I'm taking that on board.
I'm going to do it once a fortnight.
Carmen will also be helping with show production for me
and I'll be starting a second podcast called Causality.
And Causality is inspired by episode 11 of Pragmatic.
Got a lot of good feedback about that
and I really enjoy cause and effect.
So there's a link in the show notes
with more information about Causality.
Feel free to have a look at that.
There's gonna be another show
at the launch of the network called Nutrium.
And that's a podcast by two chemical and process engineers
and they've been running a website
of the same name for several years now.
And so I'm actually really excited,
not just to bring back Pragmatic,
but to also bring two new shows
to listeners of Pragmatic
that I think that they will find really interesting.
Now, both Causality and Neutrune
will be launching in the second full week of October,
and all of the shows on the network
are gonna be produced fortnightly.
So the network itself, the URL for it is engineered.network,
and there's also a newsletter you can sign up to,
and it'll give you an update every week
as to everything that's happened that week.
There'll also be a store coming shortly
with a few bits and bobs in it,
and there will be a Patreon account
that you can contribute to as well
if you wish it'll be rolling out shortly.
So there you go.
So we are back.
And now that's on the table,
I just also wanna say that I'm currently open
to exploring new shows.
So if you're interested in making your own podcast solo
or with a friend or a group of friends,
you're practicing professional engineers,
then please get in touch via the contact form
at engineer.network and we'll see what we can do.
All right, I think that's enough of that.
I think we should dive into the topic,
Carmen, don't you think?
- Sure, yeah, let's go.
- I don't wanna bore people with all of the other stuff.
So I wanted to talk about software radios
'cause previously I've talked about radio a few times,
episode 39, as well as episode number five,
actually going way back in time.
But I never really did much talk about modulation and demodulation.
And that's one of those things that's because of your background and experience in
software, right. Actually, you know what, before we dive into that, can you just give the
listeners like a couple of minutes summary of your background and just experience so they
know where you're coming from?
Sure. Yeah, no problem.
So I'm an electrical engineer and I'm in the analog and semiconductor industry.
I'm an applications engineer working on switching regulators
for Intel vCore applications.
So the main processor voltage that all the, you know,
your Intel processor runs on.
I make sure our parts meet the long list of specs
that Intel puts out.
Transient response, settling time, efficiency targets,
you name it, I have to meet it, which is interesting
'cause it's easier said than done sometimes,
especially on these new Skylake designs for tablets.
They're motherboards the size of a deck of cards almost.
And you're like, oh, just throw a few more capacitors on there.
But you can't do that.
Yeah.
You try to make 20 amp transients with 603 capacitors.
It's difficult. Those things like to sing.
But anyways, getting too deep in there.
No, that's fine.
Yeah, so I studied electrical engineering in college.
I do have my master's degree.
And I did communications as a focus.
I was building some hardware for a radio to encrypt the
channel using the randomness of the carrier.
Yeah. And it worked on paper and my circuit worked, but the bits
that spit out did not.
Do what my teacher expected.
You're not supposed to tell them that bit.
You know, I'm like to be open about that.
I got no secrets.
You're just so honest.
That's good. OK.
That's fine, that's fine, that's all good.
It could be my circuit, although it worked. I don't like to look at the schematics anymore.
I was young and inexperienced.
Mate, everyone's designed a circuit that hasn't worked.
And if you haven't, well, actually, hang on. I wonder how many people actually have.
I have. In fact, I've designed a couple that didn't work, but that's okay.
That was a long time ago. And I also claim that I was young and blah blah.
So, it's all good. No judgment.
Yes.
Anyway.
Yeah, if I could have a third revision, I would do things much differently.
Yeah, just one more spin of the board, come on, we'll do it again.
It's all, it's fine.
It'll be fine this time.
It'll be perfect.
Fantastic.
Revolutionize everything.
Of course we will.
Third spin, it's all I need.
Tell you what, when I was at Nortel and they said, we're going to have to spin the board,
the collective groan in the conference room was just, it's unbelievable.
Because these boards, some of them were like 12-layer stacks and they're like, oh, God,
re-spinning a 12-layer.
Okay.
Anyway. Oh yeah. Yeah, customers just love to hear they have to change their layout when it's almost production and you notice they routed a sense line next to the noisy phase node.
Yeah, that's it. That's what's causing the errors. Just put a barnacle on there. She'll be fine. Ship it. It's fine. Just another mod. Another mod, not a problem.
Airwire it. It's fine. Yeah, exactly. Anyway.
All right, cool. Well, thank you for that. At least everyone has a bit of an audio background.
Now, I'm not going to tell people about my background because if you haven't figured
out by listening to Pragmatic for the last two years, then you probably, yeah, anyway.
But there is a link. I like to talk about myself, so bits and pieces will show up during
the show. Well, there you go. Cool. All right. So, all right, carriers and modulation. So
I just want to start with the very basics. And I guess with carriers and modulations,
a carrier just means a single frequency or a single frequency over a certain bandwidth
and essentially modulation is about carrying data
and using a radio to carry that data, radio wave carrier to carry that data,
hence why they call it a carrier because it's carrying.
Anyway, although not like someone carrying a bucket of water, but never mind.
So anyway, modulation, the most simplest way of modulating a signal is to simply
turn it on and off in a sequence of sounds like pulses.
Dits and das, for example,
and that's Morse code essentially.
And that's where it all sort of started
with modulation technology.
So the idea is that with Morse code,
we turn the carrier on and off for two different durations
and that forms data in groups.
And then we space those groups apart and they form letters.
And obviously then we space them slightly more apart
to make words and hey, presto, you're communicating.
It's slow, it's inefficient and yes, but it works.
The technical term, I believe, is on-off keying.
Yes, on-off keying, that's true.
The funny thing though, is if you really want to break it down, it's kind of like a tri-states
time domain serial data transfer mechanism.
So, I thought about how would you classify it?
That's how you would because it's three states.
You got off, which is state one, dit, which is a short sound, that's state number two, and da
is state number three.
So it's technically tri-state and it's all done in the time domain.
So time domain tri-state serial data transfer.
We all call it Morse code though, because of Samuel Morse and all that.
God, that, anyway. Okay. There you go. Fantastic.
Morse code. But analog modulation or AM is far more interesting because that's going to
carry things like, oh, I don't know, our voices, let's say.
And the idea is that if I send a carrier and I vary its amplitude,
that is to say, yes, it's amplitude with an analog waveform over the top
then that's really simple. You strip the carrier off and you then have an analog
waveform that sounds like the voice that originally started it, that was originally
modulating it. It's so easy and that's why analog modulation, AM, was the
first kind of radio technology that carried voice and music.
So, you know, decoding is easy.
You know, you can decode it using like a crystal radio.
Did you have a crystal radio when you were a kid or even as a grown up?
I did not. No judgment.
I did not know, but I have built one of those, you know, like the simple science
projects for kids or whatever, where you use like a penny and a nail and yeah,
yeah, yeah. Stuff around the house, you can build an analog demodulator.
Yeah, those are cool.
Yeah, I've done one of those.
I had a crystal radio set too, which I promptly broke within a week, but that's
okay. Yes, but yes, no, I did have one of those and I also did the whole-
I'm trying to remember, we don't have pennies, but anyway.
It was a coin. It was a coin of some kind. I forget the denomination but anyway yes I know exactly what you're talking about.
But anyway the big downside of AM though is that well it picks up noise and I mean like atmospheric noise and if there's a pop or a click or like a lightning strike or all sorts of different things and all that noise gets picked up by the signal.
So your AM signal that started out as this pristine beautiful modulated thing with your voice on it
by the time it gets to the other end, it's got all sorts of other rubbish in there
and as a result it sounds, well, terrible.
Well, it was good back in the day when that's all you had. It was that or nothing.
And the wireless, you know, was a big deal.
But obviously we could do better.
And we did better because that's when we came up with frequency modulation or FM.
And the good thing about FM is that because the frequency, so if you can imagine a carrier frequency
let's say, I don't know, 100 MHz
and if you were to vary that frequency, plus or minus 10 kHz or 20 kHz
based on the intensity of the audio going into it
you're essentially modulating that carrier frequency with the audio information
from the music or from your voice
And that is completely unnatural.
And that's not what I mean.
What I mean is that there are no naturally occurring frequency modulated radio sources.
So if you get atmospheric noise, it will not affect the frequency modulated signal.
So the FM signal essentially is all the same amplitude.
So that means, yeah, and that's great, right?
Because that means we get rid of the noise problems.
That's why we listen to an FM radio.
It's beautiful and crystal clear.
So it's also a truncated when you pick it up in your car right because it's you spread the frequency content out and you can't recreate all of it so you have to pick a certain power level that recreates the audio enough
yes it goes the beta factor trying to remember my communications class yes no that that's that is that is exactly right and that's why FM will drop out much earlier than I am so if you're the same distance away from the radio antenna and this is not withstanding the frequency problems with you know ionospheric propagation and
and bending around the radio horizon.
But beyond those effects, point to point,
you will get a, you will get,
your ear will be able to decode and hear AM
rather than FM with the same amounts of attenuation
because of that, because it has to pick out
that lowest point where it can recover all of the data.
And that's why FM tends to drop out as opposed to fade.
So AM tends to fade, FM just seems to just like drop out
and chop, you know, that chopping sort of,
I don't know how do you describe that?
Should I do a sound effect?
- Sure. - Okay, here we go.
(sound effects)
There you go.
That's my FM dropout noise, okay?
- All right, cool.
We're gonna record that.
It's gonna be on our pragmatic soundboard
for the next episode.
- God, please no one make a soundboard for this show.
It'll just be me saying anyway,
and fantastic, and that sound effect.
- You introduced me as a co-host.
Really, I'm just gonna be like the wacky morning DJ.
I'll just sound drop.
- If you make a soundboard,
Yeah, we'll talk later. All right, so FM.
There we go.
Now there's actually a really good animated GIF,
GIF, whatever, G-I-F on the wiki page about Ray.
There's a link in the show notes.
Check it out if you're interested
because it sort of shows better
than I can describe with words.
And this is always one of the problems, you know,
on the show trying to describe with words
what's easier sometimes the drawing, but there you have it.
We're working with what we've got.
All right, so that's FM in a nutshell.
Phase modulation is kind of like FM, but the phase of the carrier is modulated.
And that's even harder for me to describe with words.
Let's just say, yeah, phase modulation and move on because, well,
unless you've got a better way of, unless you have a better way of describing it,
but.
I can't say that I do now.
There you go. Okay, lovely. Let's agree to move on. Okay.
So let's talk a little bit about narrow band versus wide band.
Cause you may have heard, or maybe you have, maybe haven't, the expressions.
I guess that when I had a look through the Wikipedia entry on this I wasn't completely happy with the description
but here's the description that it gives, it's a channel of communication, oh this is me paraphrasing it
channel of communication where the bandwidth is narrow enough that it's frequency response is essentially flat
from the start to the end frequency
and I guess the problem that I've got with that is that it's like the frequency response of what
you know is it the amplifier is it the antenna is it
Mixer is it what the hell is it discriminator, but depends on what signal it is, but I mean
See, I think it's a very it's a very generic and non-specific statement
I think that it's far better to say that we roughly use about 25 kilohertz and
Everything's relative so you could say that compared to a 25 kilohertz signal a 5 kilohertz bandwidth signal is narrowband
compared to 25 kilohertz.
But then again, you look at something like spread spectrum
signal for, you know, LTE or something that's, you know, 10
megahertz wide or something insane, then 25 kilohertz looks
like it's narrowband compared to 10 megahertz. So I figure,
see, I was even interpreting it differently. When you said the
channel of communication, I thought you meant the channel
itself.
Well, yeah, I do mean the channel itself. But I mean, with
spread, okay, yeah, with spread spectrum, if I if I were to pick
channel one then on LTE then channel one you know would be could be 10 megahertz
wide or 5 megahertz wide you know depending upon true you know so that's a
channel and that's a chunk of spectrum that Sprint or AT&T or you know Telstra
whoever they are will pay and say okay well I've got this frequency band and
I've got five channels in there that I can use for whatever I want you know
whereas you know narrowband stuff is it's it's bro it's like doled out in
very very small bandwidths like you know if you think about fixed terrestrial
fixed radio and I go and pay for a license traditionally this is what I do
for a telemetry system and telemetry system is going to be operating at 430
megahertz or 430.125 well you get a license you'd pay a fee for a 433.125
the next channel is you know 433.250 I'm trying to do this math in my head
God, I shouldn't be doing this in my head.
I need a calculator, I'm an engineer.
Anyway, point is, yeah, 25 kilohertz,
that was a narrowband channel.
And I think that a lot of that stuff is now going away
because of spread spectrum.
And, you know, it's a lot easier to get away
with frequency overlapping with spread spectrum.
That's great until everyone piles on top
and then you get a big, you know, mess, but nevermind that.
All right, why am I talking about this?
I'm talking about this because it's just important
to understand the difference in the effect of the data rate
and when we get into modulation technologies
and different things and we start talking about software radios that the bandwidth kind of matters
it's part of the equation.
So wideband essentially is sort of still a thing, but honestly, when people say wideband these days,
they're really talking about spread spectrum and spread spectrum is really wide.
Like I was saying before, megahertz wide.
So I don't know.
I think that's probably about enough about that.
I don't know what else there is to add about.
That was a very vague definition if we agreed and disagreed at the same time.
Yeah, did we?
Yeah, I think we did.
Oh, well, anyway.
There you have it. Okay, cool. Now we get into the interesting stuff.
And well, okay. More interesting?
Sound drop.
Yeah, I think it's more interesting.
Okay, this is a modulation technique and there's a couple of them
and they kind of overlap in some ways. There's subtle differences between them.
But okay, QAM, Quadrature Amplitude Modulation
and it's a friend, cousin, relative, whatever, brother
QPSK, which is Quadrature Phase Shift Keying
So the idea is, let's imagine you've got two carrier signals
and each carrier signal is 90 degrees out of phase with each other
So with waveforms, because everything we're talking about is all sine waves
So sine waves start at zero, at zero degrees
to 90 degrees and you know they're at positive maximum you go to 180 degrees
they're back to zero again but they're heading down and then you go to 270
degrees and their maximum negative and then you go back to 360
degrees also known as zero you're back at zero again and this oscillation goes
on indefinitely not as long as you got a carrier. This is a sine wave I'm assuming
listeners know what I'm describing when I say a sine wave I hope so so if you're
going to put two out at 90 degrees out of phase with each other and then you can key them on and
off together at the same time or apart and then you vary the amplitudes of each carrier as you're
doing that. What that can do, what that ends up doing is it creates essentially like a constellation
like stars, but more organized anyway.
And what you can do is on an X and a Y axis, you can actually plot these.
And again, Wikipedia page link in the show notes is a great animated GIF
GIF, GIF, G I F that shows the constellations.
You can have like a but they usually call them by the number of points.
And because everything's based on binary, you know, so binary in both dimensions.
So you'll have zero and one and then zero and one X, zero and one Y,
which will give you a maximum of four possibilities.
So zero, zero, zero, one, one, zero, one, one.
And of course, you go up in those multiples, so you'll go to
go to eight to two.
Hang on. Sorry, four, eight.
God damn it. Four, eight, sixteen, thirty two, sixty four.
Thank you. That's what I was trying to.
Yeah, see, I should have written that down.
But anyway, but yeah.
Powers of two. Yeah, exactly.
So thank you very much.
Save them, save them already.
Okay, so again, great animated GIF in the Wikipedia page
that shows this.
Now, when we're talking about this before, you said there were
a couple of, okay, so how about you talk quickly about IQ
modulation, which is related to this?
Sure. So IQ modulation, like you said, you start with a sine
wave and you generate another carrier that's 90 degrees out of
phase, which is a cosine wave, if you want to go in the most
basic sense. And you do this, you know, there's a couple of
shift registers, you can make a quadrature oscillator, it's
called and so you you know mix in your information signal with the carrier and
send it out and when you decode it you know you get your... I'm trying to think of
an easy way to do all this... just watch the videos I guess. That's cheating!
Oh man! So depending on how you vary the amplitudes and the frequencies and the
phases of the I and Q, I standing for in phase, Q standing for quadrature, you can
Recreate you know the amplitude modulation the frequency modulation the phase shift modulation that we talked about earlier
and
It's relatively simple. I guess
so for example if you're doing you know you get your eye in your cue and your demodulator and you see that they're
30 degree or 30 kilohertz difference
You don't know if that's 30 kilohertz above or below but because you have the eye in the queue
Depending on which one leads if the eye is leading. It's 30 degrees above and if it's Q's leading
It's 30 degrees below. I believe I might have that backwards
well, I'm
Not entirely sure if that is backwards. I thought that sounded correct. But in any case
There was a couple of good tutorials that you link to there's a YouTube video
and
There's a link to analog zoo. I think it is about analog zoo
yes. So those links will be in the show notes if you want to dig into that a little bit more.
Yes, one is a little more math-based, well they're both a little math-based but they cover
it from different approaches. Alan Wolke, W2AW on YouTube, he covers it more from a, I'll call it a
practical approach, although that's, you know, not when the analog zoo isn't practical, but he covers
delivers it for more practical approach and explains IQ modulation.
And then Craig over at Analog Zoo delves into Euler's equation.
Ooh, nice.
Yes.
So not that that isn't practical, but maybe some of the listeners haven't seen that math before.
But it essentially relates exponentials to sines and cosines.
And it's the foundation for pretty much all the electronics these days.
Yep, absolutely right.
And when I was talking about quadrature leading or following
the in phase signal, I was referring to the Euler's
equation, which the imaginary term with the sign on it,
you know, whether it's plus J plus J sign or minus J sign.
Cool. And the other thing about Alan and so he's W2AEW,
I think is his call sign.
So he's an amateur radio operator.
Yes, you can hit him up on the I don't know, one of his frequency
bands that he's hopping around on.
He's got his car outfitted with the radio as he travels around the US selling oscilloscopes.
Oh, really? Cool.
Yeah. Well, as a fellow radio amateur then, yes, I would highly recommend.
Yeah, well, that's cheating.
But anyway, yes, that is good, though.
I had a look at it.
It was very nice.
So. All right, cool.
So enough about IQ modulation, I guess, for the moment.
I want to talk about mixing.
And intermodulation just quickly.
And it's important to understand that there's limitations to all the...
What's the best way of describing this?
When you're stripping off the carrier, however you're doing it,
whether it's an IQ modulated signal, an FM modulated signal, AM signal, it doesn't matter.
All of them have the same problem, the higher you go in frequency.
Because the higher you go, let's say your carrier signal is 1 GHz.
Well, it wasn't that long ago that it was impossible to directly sample 1GHz.
And the reason I say directly sample is that if you're modulating a signal at 1GHz,
you need to be able to sample all that data at at least twice that rate.
Yes, the Nyquist criteria. Exactly. That's right.
And because you need to be able to sample, it makes sense when you think about it, right?
Is if you've got a sine wave, how can you determine the period of that sine wave
unless you take two samples in its overall period?
you don't know when it starts and finishes otherwise.
So that's the basic way of thinking about it.
But the truth is that the way that people have gotten around this for a very,
very long time, and frankly, still do in a lot of cases is mixing.
So how mixing works is if you get two
two frequencies very different and you mix them together,
you'll get intermodulation products.
So you're going to get the sum and the difference as well as your two original signals.
So if I've got a signal at 10 megahertz and I mix it with one at 100 megahertz, I'm going to end up with 110 megahertz as a byproduct.
I'm also going to get 90 megahertz as a byproduct, plus my original 10 and the 100.
And that mixing and the intermodulation product, sometimes you want to avoid that.
But in this particular case, what you're trying to do is you're trying to step down that frequency to something that you can sample.
you want to down mix that to a point at which or down convert or have you want to think about it
to a frequency that you can sample that you can actually extract with components
that actually exist.
And I don't know.
That's the IF frequency, correct?
Yeah, intermediate frequencies, exactly.
And typically, you'll have a local oscillator and the local oscillator will be tuned to a specific
frequency to down mix that so that you can then adjust what you're listening to.
And that will then and then what you need to do is you have to put it through a
filter of some kind. So that then is leads us to band pass band stop filters.
So if you've always got a local oscillator of specific frequency, you can actually
tune that out with a band stop filter.
So it will essentially allow only signals through depending on your roll off and the
bandwidth that you've got.
Bandstop filters will essentially let everything except the small narrow band you're trying to selectively remove
The opposite of that of course is a bandpass filter, where a bandpass filter will only let through
the frequency particularly that you're looking at
So what typically you'll do is you'll downmix the signal and then you put a bandpass in the region
that you're actually able to sample, so if you're downmixing a gigahertz
and you're downmixing it through a single stage or multi-stage receiver
and you drop it down to say maybe, I don't know, 10 MHz, 20 MHz, I don't know, whatever frequency
or less, then you just put a bandpass filter to filter out that one bit. So then all the high
frequency stuff, any intermodulation products, intermodulation frequencies will all be tuned out
by attenuated by the bandpass filter. And that is the signal, the actual, some people refer to that
as the bassband, you've actually dropped it back to bassband and you can actually then sample that
and then away you go.
And once I sample that,
I guess I'm jumping ahead of myself
'cause the topic of this episode is software radio.
So obviously, we're gonna be doing some analog
to digital conversion and sampling.
But in the traditional sense,
that's just how radio receivers worked.
And the most popular in the last, I don't know what,
50, 80 years, long time,
has been the dual conversion super heterodyne receiver
or dual conversion superhet for short.
It's actually really not that much shorter
come to think of it, but anyway.
So yes, you'd think they'd call it something like the D-Het
or something like that, or D-C-Het, I don't know.
I can't think of a good, why just, anyway.
- We'll write a letter to the IEEE.
- That's it, I'm gonna get on that as soon as we're done.
- Okay.
- 80 years too late, that's fine.
Anyway, so yeah, so dual conversion
super heterodyne receivers, built a couple of those myself.
One of them was part of the NN1G transceiver
that I built many years ago.
And you know, they're great, they work great.
However, that's not what we're here to talk about.
So those are the principles behind
how we deal with this problem
of going higher and higher in frequency.
And it's great, we wanna go higher in frequency
because that means that we've got lots more bandwidth
and more spectrum to deal with.
Everything's going higher frequency, right?
So Wi-Fi 802.11n, you were looking at 2.4 gigahertz.
that gets congested, we go up to 5 gigahertz. When that gets congested, we'll probably go up to 10 or 15 or whatever.
I mean, as you go up in microwave, obviously the radio doesn't the radio signals don't pass through solid objects very well, if at all,
but that's okay in small areas and everything's going that way, like micro cells and Pico cells and all that's all good.
Anyway, I'm getting off topic.
Okay, direct digital synthesis, which is going the opposite direction, just quickly, and then we'll start talking about DSPs.
So, do you want to talk about DirectDDS at all or?
Yes. Sure.
So, in the context I know of direct digital synthesis,
you know, when you want to make a sine wave, a cosine wave, a triangle wave,
you know, some sort of waveform, instead of doing it using analog techniques
where you start with an oscillator, either a sine or a square wave oscillator,
and shaping the waveform to its desired, you know, frequency and amplitude
and all that stuff using op amps or other analog techniques.
You would use a lookup table or some
memory cells to hold the patterns for the waveform
and you spit them out of a digital to analog converter and then you just low pass
filter to remove the
switching artifacts from the DAC
and there you go. Ready made signal? Yes.
So the beauty of a DDS is that you can get a lot of
excellent precision and control.
And that's awesome. But once it's been synthesized,
then typically you'll still go through a local oscillator stage to step it up to a
final frequency because the DDS has the same problem.
The DAC has the same problem as the ADC because it can only sample at a
certain rate. So there's an upper limit to how much you can,
how high frequency you can directly synthesize because you're switching rate just
gets too high.
Yeah, and because you still need the low pass filter and everything to get rid of the switching artifacts, it's easier to do that at a lower frequency, building the filter becomes much, much easier.
Yeah, that's a very good point, too, actually, quite right. So I just wanted to just throw that in there, because all these principles we're talking about, they work in both directions. So a software radio, when you say software radio, software radios, you know, can work as a transmitter as well as a receiver.
but we're going to primarily talk about them as receivers,
but it's important just to clarify that, yes, DDSs do exist.
Yes. And they are kind of a form of software radio in a sense.
But anyway, I'll leave that there because I think the DSP angle is more interesting.
OK. You know, before we go on,
I think we should talk about our sponsor for this episode,
and that's Sapient Pair.
Now, Sabian Pair decided after years of being frustrated with to-do list apps when I was
shopping to create an iOS app for the iPhone.
It's called Shopee.
And there's lots of to-do list apps out there and that people use as shopping lists.
And I know because I've used a lot of them and they're just they're not very good.
It's because when you go shopping, it's a very specific use case for a list and an app
that's tuned for actually making and shopping from that list can do a far better job than
just a to-do list on its own.
And if you're shopping for more than just yourself, Shopee can really help you out.
It's a collaborative shopping list app and it's simple and easy to use. I picked it up and instinctively knew how to use it the very first time I used it.
It's not cluttered, doesn't have a lot of options, it doesn't presume you live in a specific country or present you with a huge list of hundreds of brands of butter or different kinds of milk either.
Just type in what you want and that's your list. It remembers the products you've typed in for future lists and even the order that you liked to enter them in and the order that you bought them in, check them off as well.
them off as well. And there's no fussing about assigning items to aisles and
sections, none of that. So any of that is, I think that's pretty cool. But then you
can share that list with your spouse, your partner, your family, and they can
add things, they can mark things off, they can reorder items as they need to.
Changes to the list on one device will show up to anyone else's list that
you've shared it with, and it's pretty much instantaneous. It really, really is.
I've tried it over 3G and on Wi-Fi and it works really well. So when you go
shopping from a shared list you just tap the go shopping button and everyone
sharing that list will get a notification. Shopee uses the phone's GPS
to let them know what shop you're shopping at and then you can give them
any last-minute opportunities to add things to the shopping list and Shopee
will even turn off the go shopping automatically when you leave that shop
if you forget to do so yourself. Another feature it's got that I love is pocket
lock. If you're security conscious and you've got a passcode set on your iPhone
there's nothing more annoying than having to lock your phone slip it in
your pocket, get it back out again at the end of the aisle just to unlock it again so you can look at your
list to see what's next.
Well, pocket lock disables the screen when it detects that it's in your pocket and or your bag and it
re-enables it as soon as it's removed.
There's no passcodes and there's no touch ID required, no messing around with that, no fuss.
It's great. Now, my wife and I, we've used it so much now it's become a verb.
So the other day she asked, she asked me, can you shoppy me a list of things?
Seriously, I'm like, okay, did you just say, "Shoppy me a list"?
Hmm. So we don't need any of those last minute, is there anything else you need while I'm at the
shops? We don't need those phone calls anymore, I just shoppy her a list.
Now, Shoppy is free to try for the first month after which it becomes ad supported.
No risk, no loss of functionality.
Now, if you want to help out the developers, though, you can in-app purchase for a three or 12
month ad removal.
Now, normally it's $1.99 or $4.99 US, respectively.
But if you subscribe during the month of October 2015, it's on special for just 99 cents and $2.99
respectively.
So if you want to help out the show, please visit this URL, sapient, that's sapient-peir.com/engineered
and follow the links to the app store from there, and that will help out the show.
You need to follow that URL if you want to help out the show.
Thank you once again to SapientPair and Shopee for sponsoring the
Engineered Network and for being a launch sponsor for the show and the
network. Thanks again.
All right, digital signal processing.
Hmm.
See, I'm just an analog knuckle dragger, so this is your domain here.
Oh, dear. OK, fine.
Well, then, DSPs.
First of all, I think it's important that we understand the idea
of how, what if, okay, first of all, a spectrum analysis.
So when our signals go past us and
we look at them on something like an oscilloscope, it shows us what we call the time
domain, which is as each moment goes past every second, every hundredth
of a millisecond goes past, we take a sample and it shows us
the amplitude at that point.
Now, that's a time domain representation, you can build that up as a trace on the screen,
you know, and yeah, like, for example, on a digital sampling oscilloscope and you can see
the trace go past and in SCADA, you know, SCADA systems, for example, I could trend the
temperature, I could trend, you know, fan speed, what motor speed, you know, flow, gas
flow, airflow, water flow, whatever.
And these trends are all time-based trends, time-based signals, time-domain signals
But what a Fourier transform gives us the ability to do is it gives us the ability to convert that time-domain information into spectrum information
Because the whole basis of Fourier is that you can have with an infinite number of frequencies
you can combine them up top of each other to create any time domain waveform
that you would find, given an infinite number, of course.
And well, we're not going to create an infinite number,
but the theory then works in reverse.
So what we can then do is we can take a time domain waveform and we can
essentially extract from that the component frequencies and intensities and
amplitudes in order to then recreate that signal.
So we essentially take that time domain signal and can extract,
oh, OK, that's made up of a signal at 20 kilohertz, one at 45 kilohertz,
one at 100 kilohertz and one at, you know, 10 megahertz, whatever.
You know, so that analysis, that's essentially breaks
time domain signal down into a signal spectrum.
So. Does that make sense?
I'm thinking, I'm hoping.
Yeah, yeah, seems all right to me. All right, cool.
There you go. I'll just I'll take that as a yes.
Yeah, in a nutshell, you can recreate any waveform as the sum of an infinite number of sine waves.
Yeah, there you go. Exactly.
There's plenty of nice gif gifs online that you can look at to explain that a little better.
They're interactive too.
Yes, there's some links in the show notes. Again, feel free to check those out if you want to dig more into it.
I'm not going to go into the maths behind Fourier's transforms and everything.
The other thing I just want to quickly point out though is the term Fourier Transform, it kind of refers to both the frequency domain representation as well as the mathematical operation itself
that associates the frequency domain representation to a function of time if that makes sense
so people use a Fourier Transform in those both parlances
so they're both valid I guess
But anyway, sometimes you'll hear things referred to,
sometimes you'll hear referred to as FFTs,
fast Fourier transforms, which is an abbreviated form
or an approximated form of a full Fourier transform.
So FFTs-
- Yeah, that was developed in order to make it easier
to compute, right?
- Yes.
- For doing on computers?
- Exactly, yes.
Because I mean, if you were to try and calculate everything
down to the last order, then you'd never finish.
And that's the whole point.
And so we say an infinite number,
you don't need an infinite number,
You just need the most significant 10, not even 10 sometimes.
But anyway, that's not really the point.
I don't want to go into FFTs and, you know, any of that vector math
or any of that sort of stuff.
I'm not interested in that.
Not well, I am interested in that, but that goes too deep today, I think.
OK, so where do you start?
You start with sampling, and that is the analog to digital converter.
So we take an analog signal and we sample that.
And how do we sample that?
Well, there's multitude ways of doing it.
But just real quickly, what we do is we will-
Let's- You know what?
I'm not going to go into how- I don't want-
That's an episode in itself.
You're right.
Apologies.
You know what? You're right.
I'm just not going to touch that because there's actually- I was about to start and I thought, hmm,
there's actually quite a few ways of doing it, so let's not- Let's assume-
I think I've got two or three textbooks just on that.
Yeah, you're not wrong.
All right. So let's leave it there then.
Okay, good. We're done.
The- No, I'm just kidding.
All right, so let's just assume that that's all good.
All right, you can now take that signal and go chop, chop, chop.
And I now know exactly what voltages at what time.
And I've built up this beautiful string of data.
I'm going to run some FFTs on it, and I'm going to spit out my frequency domain
information. Hold that thought.
Little bit of history, because I have to have some history in here
because I just love it. Why? I don't know.
Anyway, first DSP was actually the TI 5100 and TI meaning Texas
Instruments, of course, that was released in 1978.
So two years after I was born, although technically you could
argue the first DSP was, I think, was developed actually the
year I was born.
So 1976.
There you go.
Anyway, I thought it was found on the alien ship in Roswell.
We just reverse engineered it.
It was in that documentary Independence Day.
I don't know.
Yes, that was a document.
Now that's what I knew I got something wrong about that show skull and crossbones on the damn computer.
I will never ever ever come on really really that's what a virus looks like people.
It's a skull and crossbones on the screen go course anyway.
All right fine.
Anyways, the show is complete now.
We've made fun of Independence Day anyway.
All right, so that was released in 1978 a fun fact about DSPs most DSPs only do fixed point math
or maths or mathematics, depending on how you want to think about it, not floating point.
And it's interesting because the precision provided by floating points generally not required.
And because floating point maths takes longer than in the interest of speed,
most DSPs will stick to fixed point.
Something that I just thought was interesting.
Anyway, now, as DSPs have become more powerful, faster, lower power, more computations per second,
it's been possible to use them to directly sample higher and higher frequencies.
And that's why that's relevant, because that then leads us to a point where we don't have to
down convert absolutely everything, or if we do, not so much, and we can
actually sample wider and wider parts of the spectrum.
And that leads us to software radios.
And when I say a software radio, I guess I mean you were using
a firmware, which is just, you know, and I hate this distinction between,
you know, firmware drivers operating system, like
kernel through the kernel in there.
I don't mean KFC and operating systems in that.
I mean, yeah, it's like it seems like an arbitrary distinction.
I mean, I understand why I guess to some extent people like to break that down.
but when I say firmware, you know what I mean, it's like digital signal
processors have a program to tell them what FFTs to run on what and how
and what to shift to where blah, blah, blah, blah, blah, right?
That is essentially software
defining how the DSP cranks out what it cranks out.
And that is generally referred to as the firmware for that DSP.
And these days, of course, we still that on flash, which is great
because flash RAM can be reprogrammed, which is very cool.
Now in smartphones, and I guess I kind of sort of,
tying this into something modern
that we all use in our hands.
Well, not all of us, but many of us now use in our hands.
You've got multiple layers of software
that I kind of talked about, I guess the operating system.
So iOS is technically the Apple operating system
on their phones and Android, for example,
is the operating system on Google based phones.
However, at a baseband level,
I saw about bass band before but bass band in the software sense and this is the whole problem
with bass band because bass band was a radio term before they hijacked it but never mind that.
So- Which evolves John. Is that what that is or maybe it's just like
what's the word con they've conflated one or they've made one convoluted through their
conflation. I don't know anyway it's just annoying. Yeah, the very cromulent explanation.
- Nice, good, that's my new word for the day, Chromulent.
Okay, so at a baseband level,
Qualcomm have the thing they call the REX real-time kernel.
Now, I actually found some interesting slides about this,
reverse engineering, a Qualcomm baseband.
And they look at an iPhone 4S and how that's set up
and that's actually really interesting.
So I've got a link in the show notes
if you wanna have a read of that,
if you're more interested in baseband and so on.
Going below that, then we have device firmware.
So that's the DSP level,
some of the hardware I/O controllers.
So if you've got a hardware I/O control for USB
or you got hardware controller for some other device,
like a GPS chip or whatever else,
then that's the firmware level.
Now, I guess the problem I've got
is that sometimes the two get twisted together.
So baseband and firmware, in some cases they'll say,
"Oh yeah, well, the iPhone's an update to its baseband."
And some of that will have firmware files in it
that may change the operations of the DSPs
or whatever, maybe they're related to the real-time kernel,
I don't know, because I haven't dug into that deep,
but honestly, that's the layer I'm talking about.
I'm not talking about the operating system.
So this is the actual radio hardware itself.
The actual DSP is crunching away.
Now, it's not unusual to update that
when you do a software update on your device,
but, sorry, I'm saying it's not unusual.
Actually, it is unusual.
Sometimes they do it, sometimes they don't.
but the bottom line is that yes, they do do it sometimes
and sometimes they do put fixes into the DSPs.
One of the things-
- If you make too many fixes,
do you have to get it recertified?
- (laughs) I'm reasonably sure, yeah, actually.
So this is one of the other things
with software radios that people don't realize
is that you think that, okay,
here's my brand new iPhone 6S plus extra bonus, whatever.
And actually I should make a joke about Samsung Galaxy
'cause they're worse, but anyway.
I mean in terms of their naming, right?
But anyway, all right, so if I then make a massive change to the DSPs
and now this thing's going to, you know, transmit receive ever so slightly differently
then you technically you may need to requalify that.
So it's the sort of thing that I don't do very often probably because they can't,
you know, not without a whole bunch of other overhead, unless there's a known issue.
Anyway, so, right, where was I?
Okay, yes, so one of the great things is that at least this is remotely upgradable.
I mean, I'm going on about the ability to do this, but actually people forget that it was only a couple of decades ago
that we were stuck with EPROMs and E2 PROMs, right?
Where you couldn't remote, there was no flash, right?
You couldn't upgrade these things, you know, properly.
I said E2, that's electrically erasable, but even the electrically erasable ones,
typically you didn't electrically erase them on board.
You would take them out of a socket, put them into the programmer that would apply a higher voltage
to electrically erase them before you reprogram them.
So that weren't the sort of thing
that you would just do remotely
because of course, communication wasn't there.
You know, so these things would be out in the field somewhere
and they'd be standalone devices.
There was no internet of things
and therefore it wasn't possible.
So now that it's become possible
and at Nortel, we've sort of, we're moving towards that
proves about the late nineties.
By the early 2000s, it was pretty much commonplace
to use flash memory to store the firmware
and you could then remotely upgrade it
which then comes with all sorts of other risks.
But anyway, so and there was another project I was working on that was just
Secret Squirrel.
Can't say anything about it, really.
And we had full remote DSP firmware upgrade, and that was in 2001, 2002.
So anyway, so you've actually played with a bunch of
software radios and and kits, I think, did you say?
No, I haven't played with them myself, although the one does look pretty
interesting and I kind of want to order it since it's relatively cheap.
I think what you're thinking of is my co-op experience back in, I think it was 2010.
I worked for a company outside of Washington, D.C. and they did software-defined radios
for all the various three-letter agencies in the government and I helped test those.
That was pretty cool.
I was actually on the beamforming network team, so there was an array of eight or nine
antennas and if you heard a signal on whatever band they were interested in, it would tell
you what direction it was coming from.
Cool.
So that was pretty cool.
So I worked on the beamforming boards, I'd connect an antenna, test it, run their program,
and then run it down a small analog signal chain to make sure that all worked and then
there was another group that digitized it and ran the software to find radio.
Cool.
So that was cool.
So I think just before I jump into the kits, when we're talking about a software-defined
radio, we're talking about changing what channel you might be on or decoding the actual
audio or video or whatever it is you're sending using the radio, correct?
Yes.
So software-defined radio replaced essentially the knobs on your old analog radio or in certain
cases you could use a variable capacitor to change certain performances of the radio or
varactor diodes which kind of act like capacitors if you want to get into some junction theory.
That's fine. Yes and you were talking about e-squared proms and all that stuff
being hard to change. You actually have to desolder capacitors or twiddle them with a
screwdriver. That's even farther down the technological chain back in time.
Oh yeah.
Yeah, so much more flexibility when you go digital.
Oh, absolutely.
And when you mentioned before about the capacitor,
I was thinking about,
you know, that actually would change the local oscillator frequency
so that when you were on the TV set,
what you do is you would have fixed positions for the channels.
And as you would move the channels,
you would have a capacitor behind it, an air capacitor.
And as you go from channel 0 to channel 1,
that would change the capacitance by a linear amount.
And that then would change the frequency,
the local oscillator,
so that it would drop down the signal
to the same part of the band pass filter,
that then the TV signal got decoded.
We'd strip off the carrier
and then you'd start decoding the horizontal
and vertical line information.
And that would then change the ray tracing on the screen.
So yeah, but then that was cool
because in Amateur Radio,
what we used to do is we used to go and salvage those
from the old TV sets
and then use them for tuning our antennas.
So yeah, and don't touch them with your hands.
Otherwise you might, you know, like hurt your hands.
I think I mentioned that once on an old episode.
Yeah, I think I did actually.
Yeah, I actually, yeah, blew a bit of a hole
in the webbing of my hand, but nevermind that.
It's all good.
It's fine, it's healed now.
- It is. - It's fine.
Perfectly fine.
- You don't need hands.
- Yeah, exactly.
- You got two.
- Health and safety.
What's that, you know?
Hey, anyway.
But yeah, so tell me a little bit about these kits
that you are talking about.
- Sure, so if you're interested in playing
with a software defined radio,
There's a couple different ways you can get started.
I guess the basic one would be if you wanted to roll your own, but that's a whole project
in and of itself if you just want to play with the radio.
There's an article we'll link to from the IEEE Spectrum, and they say it's a $40-ish
software-defined radio.
They also throw a Raspberry Pi in there for some other stuff, which is about $40, but
the actual radio part is about $40.
And it uses a hacked HDTV setup from Europe.
And there's a certain chip on there, the RTL2832U.
And they found out that this chip has a feature where if you enable it, it can spit out the
raw IQ data, the IQ modulation data that we talked about before, instead of the demodulated
TV stream.
It's very hacky from the article that I've read about it.
it can't transmit but it's pretty low cost. Another option, and this is the one I was
mentioning that I kind of wanted to buy now seeing as it's like $25, it's from Adafruit
and it's just a very basic setup. It uses the actual same chip and it spits out the
INQ data for you. And then if you want to drop some serious money, serious being much more than
$20 to $30. There's the HackRF which is sold by Mike Osman and if you want to hear more about it
he's been on a few episodes of the Amp Hour podcast but I'll let him get into it as soon as
it's his project. And it's $300 you can buy him on SparkFun and this can transmit and receive
and he's currently got a nine course set of videos available on his website on how to use the HackRF
and if you're lucky enough to go to one of the security conferences he attends he also teaches
which is two-day seminars as well on Software Defined Radios.
Nice.
Yes.
So I guess before we wrap this up just on Software Radios, I guess
the thing that I think is so cool about it is that there was a time
not that long ago when everything that we did was channelized, everything
we did was selected through, you know, like you would design
You design a circuit and it would forever be that circuit.
You could never modify it. You couldn't change it remotely.
You couldn't fix problems. There was very little software on it.
And even when the early DDSs came out, you know,
even then the receiver chain was still using dual conversion superheads.
And, you know, it was still, you know,
it hadn't reached that point where you are able to sample at such high frequency
that you could actually directly, you know,
through a DSP process, all of this information and decode it however way you would like
like decoding the raw ion cue data using an ADC and a DSP was like
it was unheard of until recently.
So now all this technology has reached that point where you can have a generic DSP, very
powerful bit of bit of, you know, you know, silicon sitting in your device and you can
you can play with it just by changing software characteristics, changing what
looks at what decodes what information.
And there's no changes to the circuit board anymore. There's nothing to fiddle with. There's no, like you say, no buttons, knobs
that have all been replaced by the software.
And then you can build a user interface for it. And then, you know, it's like everything just became so much easier.
And you can just plonk it all down, have a generic board that does it all or a generic chip that does it all.
And that's how a lot of this stuff is possible.
You know, they say, well, they're using the like on the iPhone, Apple are using like they're using Broadcom chips or
Qualcomm chips and all that.
And they've distilled all this stuff down to these radios.
They've done all that engineering.
They figured it all out.
And all of the little problems with them,
little small amounts of impedances and ductances
between different things, they've all sorted all that out.
It's all been designed.
And all you have to do is bring the software
and the firmware and away you go.
You've got a finished product.
And that is the one thing that blows me away,
knowing where we've come from.
And as the sampling rates get higher and higher
and the technology is refined, DSPs get more powerful,
it's going to mean that we can get away
with denser pack structures.
I mean, obviously you're still gonna hit the wall
at Shannon's limit, but still another topic for another day.
Anyway, and all that, but it's going to get better,
it's gonna get cheaper, it's gonna get faster,
and that can only be a good thing in the end.
So if you wanna learn more about it,
there's plenty of links in the show notes where you can.
So did you have anything else
you wanted to add quickly, Carmen?
No, I think you wrapped it up pretty nicely.
Alrighty then, fair enough.
Well, if you want to talk more about this, you can reach me on Twitter @johnchidjie or you can follow Pragmatic Show to specifically see show announcements and other related stuff related to the show.
Remember though that Pragmatic is now part of the Engineered Network.
It also has an account @engineered_net and that has announcements about the whole network and all of the shows and you can check them all out at engineered.network.
network. If you'd like to get in touch with Carmen, what's the best way for them
to get in touch with you, mate? You can reach me on Twitter. I'll put my
handle in the show notes. It's @fakeeequips. It was a blog I started a
long ago that pretty much defunct right now, but you know, branding and
everything. Sure, that's okay. So I still use it. And then you could also get a hold of me
as well. I do another podcast called The Engineering Commons that's also
bi-weekly with Jeff Shelton and a couple other engineers and we talk about just
about generic engineering topics and there's a contact form on our website
theengineeringcommons.com you can reach me that way as well.
All right fair enough if you had any feedback about this show or the network
then you can use the feedback form on engineered.network that's also where
you'll find the show notes for this episode. I'd also like to take this
opportunity to thank SapientPair and their iOS app Shopee for sponsoring the
Engineered Network as a launch sponsor as well. If you're going shopping and you
want a great collaborative shopping list app then Shopee can help you out. It's
ad-free for the first month so check it out at sapient - that's S-A-P-I-E-N-T -
pair as in two - dot com slash engineered. Finally the network also has a Patreon
account opening shortly. If you'd like if you like what we're doing here at the
Engineered Network and you'd like to contribute something, anything at all,
it's very much appreciated and helps out not only to keep existing shows going
but it also helps bring new shows to you.
So there's also a few perks in there.
So check it out.
It all helps.
Thank you so much in advance for that.
And thank you everyone for listening.
And thank you, Carmen.
- All right.
Thank you, John.
Happy to be doing the show with you.
- Thanks, mate.
(upbeat music)
[Music]
(upbeat music)
[Music]
(thunder)