Forums

Matlab code needed for SSB demodulation

Started by Rick Lyons June 30, 2012
On 11.05.2017 18:25, danielot@gmail.com wrote:
> On Thursday, May 11, 2017 at 9:54:12 AM UTC-3, Tauno Voipio wrote: >> On 11.5.17 01:03, Steve Pope wrote: >>> <danielot@gmail.com> wrote: >> >> I just wonder if the OP is barking up the wrong tree. There >> must be good grounds to suspect that there is noise/interference >> on one sideband but not on the other, and this is the situation >> where SSB demodulation will work. >> >> The crud near the carrier could be from low modulation index >> PM sidebands, which look pretty much similar to AM sidebands, >> except for 90 degree phase difference compared to carrier. >> Noisy oscillators create easily small jitter for PM sidebands. >> > > This is interesting. > > The problem here is that my RF comes from an analog front-end which performs switching between two channels. This is done to correlate drifts of RF amplifiers of the 2 different RF channels. To model it, we can think of two 500 MHz sinusoids modulated by 2 quasi-square wave with 50% duty cycle, shifted 180 deg one to the other, and then summation of those 2 modulated signals. In time domain we can notice very small phase and amplitude jumps in the switch transition points, but if we try to model it in frequency-domain, there would be quite a mess interfering in the 500 MHz carrier due to the convolution of the RF spectrum with the several square wave harmonics. >
Do you mean to say that you are measuring, say, X and Y displacements of the beam (and that's why you need two channels), and then convert that to polar coordinates?
> If this explanation looks confusing, I'll try to put it in a more clear way in a longer text. >
Definitely, you'd get better help here if you provide some more detailed explanations. Gene
Evgeny Filatov  <filatov.ev@mipt.ru> wrote:

>On 11.05.2017 18:54, danielot@gmail.com wrote:
>> On Thursday, May 11, 2017 at 12:18:30 PM UTC-3, Evgeny Filatov wrote:
>>> Instead, you downconvert the both sidebands to baseband, then use a >>> Hilbert transform filter to separate the sidebands, or to suppress the >>> undesired sideband.
>> Thanks, Gene. I think I'm starting to understand my failure. I was >> using the Hilbert transform as a passband in a "audio" IF, but now I'm >> realizing I should use it when my downconverted signal is already in DC. >> Is it right?
>It's a way to do that.
>> Does it mean then that I'll always loose a considerable ammount of >> power around DC, since the Hilbert transform filter will be >> transitioning to stopband at this region?
>> This wouldn't be tolerated in my application, so this may mean end of >> the line...
Yes, if you have the Hilbert transformer at baseband, then you have additional difficulties in recovering components near DC, relative to having the Hilbert transformer at IF (as described in my last pair of posts). SSB in general is not very well suited to representing very low frequencies within the modulating signal, and also most of your phase noise is going to be down there. Generally -- if you're actually building a receiver -- you need an architecture and a frequency plan, and therefore face a decision between direct conversion and low-IF, ahead of your ADC. For the SSB case these two choices correspond to the two possible placements for the Hilbert transformer described above. If you're just doing a simulation for a proof of concept, then it may not matter yet, and you can simulate it either way. But if you're pretty sure which way the final design will go, then save yourself some work and go in that direction now. Steve
On 11.5.17 19:30, Steve Pope wrote:
> Evgeny Filatov <filatov.ev@mipt.ru> wrote: > >> Why would you want to "downconvert to baseband only one of the sidebands"? >> >> Not that it's impossible to do, but I believe Steve didn't suggest that! >> >> Instead, you downconvert the both sidebands to baseband, then use a >> Hilbert transform filter to separate the sidebands, or to suppress the >> undesired sideband. > > Seems to me if R(t) is the received signal at RF or IF, H is a Hilbert > transformer, and { I(t), Q(t) } is a quadrature oscillator at the carrier > frequency, then LPF ( I(t)R(t) + Q(t)H(R(t) ) gives you one sideband at > baseband. Noise (or signal) within the other sideband is suppressed. > > Although, I'm not all the way through my morning coffee so ... > > This (if correct) is the "phasing method at IF" which was once popular > since the passband of the Hilbert transformer is narrow relative to > its operating frequency. It was - back then - more difficult to > construct a Hilbert transformer at baseband. > > The only real problem should be carrier recovery. > > Steve
The essential main problem of Hilbert transform on baseband is that the minimum delay is a quarter wave at the lowest frequency of interest, because otherwise we'll need a non-causal filter. --- Is there any physical reason to think that some of the undesired signals are on one sideband only? For pure AM the sidebands are mirror images of each other, and a process that does not contain Hilbert transform (explicitly or implicitly) does not generate sideband skew. A sideband filter makes an implicit Hilbert transform and summation. -- -TV
Tauno Voipio  <tauno.voipio@notused.fi.invalid> wrote:

>On 11.5.17 19:30, Steve Pope wrote:
>> This (if correct) is the "phasing method at IF" which was once popular >> since the passband of the Hilbert transformer is narrow relative to >> its operating frequency. It was - back then - more difficult to >> construct a Hilbert transformer at baseband.
>The essential main problem of Hilbert transform on baseband is that >the minimum delay is a quarter wave at the lowest frequency of >interest, because otherwise we'll need a non-causal filter.
Good point. Although (thought experiment) if you mix it back up to RF, have an equivalent Hilbert transformer with less latency, and then mix it back down to baseband, do you not then have a causal version of this "non causal" filter? Heh heh, that would be a good exam question. Steve
On Thursday, May 11, 2017 at 3:19:51 PM UTC-3, Steve Pope wrote:
> > Yes, if you have the Hilbert transformer at baseband, then you have > additional difficulties in recovering components near DC, relative > to having the Hilbert transformer at IF (as described in my last pair > of posts).
I finally made my code working! But then I realized it only works for baseband. I'm just wondering now how would it be possible to do the Hilbert transformer at IF as you said. I have the impression the Fig. 5 of the AARL paper you shared is still describing a baseband Hilbert transformer, which had to be implemented as a BPF due to physical limitations. I think it would be impossible to design a LPF with +90 deg at DC+ frequencies and -90 deg at DC- frequencies. Does it look right?
> > Generally -- if you're actually building a receiver -- you need > an architecture and a frequency plan, and therefore face a decision > between direct conversion and low-IF, ahead of your ADC. For the > SSB case these two choices correspond to the two possible placements > for the Hilbert transformer described above. > > If you're just doing a simulation for a proof of concept, then it may > not matter yet, and you can simulate it either way. But if you're > pretty sure which way the final design will go, then save yourself > some work and go in that direction now.
Thanks for the advice. We have designed a receiver. By undersampling our 500 MHz carrier at ~221 MHz sampling rate (RF/864*383) we get the IF at 56.7 MHz (RF/864*98)). Then we downconvert to baseband digitally in a FPGA using standard AM demodulation using complex NCO. That's the point where I wanted to improve and use SSB demod. This is the project: http://www.ohwr.org/projects/bpm/wiki Daniel
On Thursday, May 11, 2017 at 3:10:40 PM UTC-3, Evgeny Filatov wrote:
> Do you mean to say that you are measuring, say, X and Y displacements of > the beam (and that's why you need two channels), and then convert that > to polar coordinates?
(...)
> > If this explanation looks confusing, I'll try to put it in a more clear way in a longer text. > > Definitely, you'd get better help here if you provide some more detailed > explanations.
On Thursday, May 11, 2017 at 4:37:24 PM UTC-3, Tauno Voipio wrote:
> > Is there any physical reason to think that some of the undesired > signals are on one sideband only?
I'll try to formulate my issue better, but I'll need some time to write. I owe some explanations to you guys :) Thanks for helping.
Tauno Voipio wrote:
> On 11.5.17 01:03, Steve Pope wrote: >> <danielot@gmail.com> wrote: >> >>> Following DSPRelated moderator's advice, I'm moving this thread to the >>> DSPrelated forum: >> >>> https://www.dsprelated.com/thread/2946/matlab-code-for-ssb-demodulation-using-phasing-method >>> >>> >>> I've put there a much easier to follow code. >> >> Note that, not everybody on this newsgroup follows DSPRelated and >> so by moving the thread, you have lost some of your potential >> audience that might answer your questions. >> >> That said, have you tried using Mathwork's "fdatool" to create >> the Hilbert transformer? It should be dead easy to create >> an SSB demodulator by this method. >> >> Steve > > > I just wonder if the OP is barking up the wrong tree. There > must be good grounds to suspect that there is noise/interference > on one sideband but not on the other, and this is the situation > where SSB demodulation will work. >
That's my understanding - SSB was vaunted back in the CB radio days to have better range, which I assumed was due to better noise immunity. It's used in other systems for other reasons as well.
> The crud near the carrier could be from low modulation index > PM sidebands, which look pretty much similar to AM sidebands, > except for 90 degree phase difference compared to carrier. > Noisy oscillators create easily small jitter for PM sidebands. >
Wouldn't that in essence just be distortion[1] in the audio band, due to errors in demodulation? It's roughly the same thing in digital radio - although it's expressed there as higher BER because those are mostly decoding in the phase domain. [1] these guys call it noise, although I'd somehow suspect it'd be correlated with the input signal, somehow: http://www.robkalmeijer.nl/techniek/electronica/radiotechniek/hambladen/qst/1988/03/page14/ Sometimes people call distortion noise, which is understandable.
> --- > > And - yes, I'm not going to another forum. >
-- Les Cargill
<danielot@gmail.com> wrote:

>I have the impression the Fig. 5 of the AARL paper you shared is still >describing a baseband Hilbert transformer, which had to be implemented >as a BPF due to physical limitations.
Based solely on the diagram it's ambiguous I think. It would be considered a "Low IF" (as opposed to "zero IF") receiver architecture which is the main design distinction, since there is only one ADC digitizing an IF signal. But then there's some clever decimation. Maybe the Hilbert transformer is at baseband ... but it does still work having the Hilbert transformer at IF. Steve
Les Cargill  <lcargill99@comcast.com> wrote:

>That's my understanding - SSB was vaunted back in the CB radio days >to have better range, which I assumed was due to better noise immunity.
It has better range than AM, other things being equal, because you are not wasting power transmitting a carrier with no information. Double sideband suppessed carrier should be as good as SSB -- twice the noise bandwidth but a 2x redundant signal -- but you get half as many users in a band. If you can tolerate the audio squawkiness SSB is better, thus is used by hams, CB'ers etc. Steve
On 12.5.17 05:01, Steve Pope wrote:
> Les Cargill <lcargill99@comcast.com> wrote: > >> That's my understanding - SSB was vaunted back in the CB radio days >> to have better range, which I assumed was due to better noise immunity.
SSB is much older. It was used already in the 1930's in carrier telephony, to squeeze more channels in the same cable.
> It has better range than AM, other things being equal, because you > are not wasting power transmitting a carrier with no information. > > Double sideband suppessed carrier should be as good as SSB -- > twice the noise bandwidth but a 2x redundant signal -- but you > get half as many users in a band.
The problem in receiving suppressed-carrier DSB is that you need to have the re-inserted carrier in both proper frequency and phase, whereas SSB tolerates some frequency offset without any phase constraints. -- -TV