DSPRelated.com
Forums

Matlab code needed for SSB demodulation

Started by Rick Lyons June 30, 2012
On 7/7/12 7:09 PM, Robert Adams wrote:
> Yes I have heard that as well. > Another cool use of frequency shifting was pioneered by Bob Orban, who designed the standard broadcast audio compressors that became ubiquitous on the 70's. Take an audio spectrum and shift it up to a few hundred kHz, and apply it to a soft limiter. If the original spectrum consisted of a mix of sine waves, the limiter will produces intermod tones that are down in the audio band or up around twice the carrier. Apply this limited signal to a band pass filter to remove all the intermod components and then shift the whole thing back down to audio. Presto, you have a limiter with no intermod distortion. Very clever. >
i think that other Bob has posted here at comp.dsp, once or twice. now to get Bob Chidlaw in on it. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Sat, 7 Jul 2012 07:50:38 -0700 (PDT), lito844@gmail.com wrote:

>> Hi Mark, >> Your Matlab code is a really terrific >> demo of single sideband demodulation >> >> Thanks, >> [-Rick-] > >Hi Rick, > >I'm glad you found it helpful. > >Mark
Hello Mark, I sent you a private E-mail, to the 'lito844...' E-mail address. I wonder if you received that E-mail. [-Rick-]

Hi Tauno,
   I'd like to send you a block diagram of 
an SSB demodulation system.
If you're interested, would you please 
send me a private E-mail.  (Just remove the 
'_Bogus_' or 'n o s p a m' from my E-mail address.

Regards,
[-Rick-]
On 11.7.12 6:33 , Rick Lyons wrote:
> > > Hi Tauno, > I'd like to send you a block diagram of > an SSB demodulation system. > If you're interested, would you please > send me a private E-mail. (Just remove the > '_Bogus_' or 'n o s p a m' from my E-mail address. > > Regards, > [-Rick-] >
Private mail sent. -- -Tauno
> In searching the Internet for tutorial SSB demodulation > information I'm shocked at the inconsistent, contradictory, > and ambiguous, SSB demod material that's on the > web. I've found no web site, including MathWorks > 'File Exchange' pages, that has helped me. > > Either I'm misunderstanding the "phasing method" of > SSB demodulation, or my Matlab code is fouled up. > I can't figure what I'm doing wrong. > > Anyway, does anyone out there have Matlab code that > models the "phasing method" of SSB demodulation that > they'd be willing to share with me?
Hi all, I need to perform AM demodulation for electron beam position monitoring in a particle accelerator. Signal is centered at 500 MHz and has ~290 kHz bandwidth. I have many many spurs in multiples of ~580 kHz which is due to the structure of the beam and I must avoid aliasing to baseband. A first stage of downconversion is simply done by undersampling, which brings my signal down to ~56 MHz, or exactly IF freq = 383/864 * RF freq. Everything is done with synchronous sampling since a timing system delivers a reference clock locked to the RF master oscillator. We have a system up and running today using straight forward complex NCO mixing + low-pass filtering/decimation using CIC decimation filters + rectangular-to-polar conversion using CORDIC (only amplitude is used). Latency is a very critical performance figure since the beam position is used in a fast feedback to keep the beam stable for the synchrotron light source users, and today the main bottleneck for latency is the decimation digital filters! We've experienced some undesired effects which I'm pretty sure comes from the fact upper and lower sidebands interfere, especially in low frequency (~DC to 1 kHz). Just as Rick Lyons in the beginning of this thread, I'm trying to simulate SSB demod in Matlab and am a bit confused by the literature I found online. I basically have a non-working code and don't exactly what to expect as result in some parts of it. I'm trying to use the phasing method and follow Clay Turner's approach of +45 deg and - 45 deg phase shift in I and Q branches, with filters designed very similar to what can be found here: http://www.claysturner.com/dsp/asg.pdf I would appreciate if you could take a look in my code below. I would expect that the USB_bb and LSB_bb signals would have one of the two sidebands (signal and image) suppressed. I tried to look at Mark's code but could not figure out how to use it in my case yet. Thanks, Daniel % Signal generation % ----------------- nrep = 10002; M = 18; N = 65; t = ((0:N*nrep-1) - 2*N)'; IF = 0*cos(2*pi*M/N*t + pi/3+pi/2); signal = cos(2*pi*(M+0.0002)/N*t - pi/6); image = 0.5*cos(2*pi*(M-0.0004)/N*t - pi/12); x = IF + signal + image + 0.0001*randn(N*nrep,1); % Band pass filters used to replace Hilbert transform % --------------------------------------------------- cos_filt_num = cos(2*pi*M/N*(0:N*2-1)-pi/4); sin_filt_num = -sin(2*pi*M/N*(0:N*2-1)-pi/4); gain_cos_filt = sum(abs(cos_filt_num))/length(cos_filt_num); gain_sin_filt = sum(abs(sin_filt_num))/length(sin_filt_num); num_filter_I = cos_filt_num.*[0 conv(ones(1,N)/N,ones(1,N)/N)]/gain_cos_filt; num_filter_Q = sin_filt_num.*[0 conv(ones(1,N)/N,ones(1,N)/N)]/gain_sin_filt; % Phasing method % -------------- nco = exp(1j*2*pi*M/N*t); x_analytic = filter(num_filter_I, 1, x) + 1j*filter(num_filter_Q, 1, x); IQ = x_analytic.*nco; USB_bb = real(IQ)-imag(IQ); LSB_bb = real(IQ)+imag(IQ); % Plots % ----- y = [x USB_bb LSB_bb]; npts1 = size(y,1); Y = fft(y(2*N+1:end,:))/npts1; for i=1:size(Y,2) Y(:,i) = fftshift(Y(:,i)); end Yabs = abs(Y); npts2 = size(Y,1); f = (-ceil(npts2/2):floor(npts2/2)-1)/npts1*N; figure semilogy(f, Yabs);
On 10.5.17 13:19, danielot@gmail.com wrote:

> I need to perform AM demodulation for electron beam position monitoring in a particle accelerator. Signal is centered at 500 MHz and has ~290 kHz bandwidth. I have many many spurs in multiples of ~580 kHz which is due to the structure of the beam and I must avoid aliasing to baseband. A first stage of downconversion is simply done by undersampling, which brings my signal down to ~56 MHz, or exactly IF freq = 383/864 * RF freq. Everything is done with synchronous sampling since a timing system delivers a reference clock locked to the RF master oscillator.
I cannot make the figures match. 383/864 * 500 MHz = 221.6 MHz, which I cannot push to generate 56 MHz from 500 MHz. Is the signal at 500 MHz +/- 195 kHz, and first spurs at 500 MHz +/- 580 kHz?
> We have a system up and running today using straight forward complex NCO mixing + low-pass filtering/decimation using CIC decimation filters + rectangular-to-polar conversion using CORDIC (only amplitude is used). Latency is a very critical performance figure since the beam position is used in a fast feedback to keep the beam stable for the synchrotron light source users, and today the main bottleneck for latency is the decimation digital filters!
What is the final sample rate?
> We've experienced some undesired effects which I'm pretty sure comes from the fact upper and lower sidebands interfere, especially in low frequency (~DC to 1 kHz).
There may be spurs from phase jitter in some of the signals involved, and they can appear as spurious sidebands. -- -Tauno Voipio
Em quarta-feira, 10 de maio de 2017 10:16:49 UTC-3, Tauno Voipio  escreveu:
> On 10.5.17 13:19, danielot@gmail.com wrote: > > > I need to perform AM demodulation for electron beam position monitoring in a particle accelerator. Signal is centered at 500 MHz and has ~290 kHz bandwidth. I have many many spurs in multiples of ~580 kHz which is due to the structure of the beam and I must avoid aliasing to baseband. A first stage of downconversion is simply done by undersampling, which brings my signal down to ~56 MHz, or exactly IF freq = 383/864 * RF freq. Everything is done with synchronous sampling since a timing system delivers a reference clock locked to the RF master oscillator. > > I cannot make the figures match. > > 383/864 * 500 MHz = 221.6 MHz, which I cannot push to generate 56 MHz > from 500 MHz. > > Is the signal at 500 MHz +/- 195 kHz, and first spurs at 500 MHz +/- 580 > kHz?
(...)
> What is the final sample rate?
Hi Tauno. Sorry for my mistake, you're absolutely right. 383/864 * 500 MHz = 221.6 MHz is my sampling rate. The IF which is result of undersampling is (864-2*383)/864*500 MHz = 56.7 MHz.
> There may be spurs from phase jitter in some of the signals involved, > and they can appear as spurious sidebands.
Spurs coming from ADC and ADC clock are well controlled, they provide sufficient SFDR and they are out of our preoccupations. The spurs I was referring to appear in all frequencies multiple of RF/864, that is, n*578.7 kHz (n=1,2,3,...). This is just to say why I need that CIC-like filter (I mean, the low pass centered at IF of my code) which has notches in those n*578.7 kHz frequencies. My code actually had numbers for another accelerator. To better reflect this discussion, we should have: M = 98; % instead of N = 18 N = 383; % instead of M = 65 Sorry for this (once more). Daniel
> Spurs coming from ADC and ADC clock are well controlled, they provide suf=
ficient SFDR and they are out of our preoccupations. The spurs I was referr= ing to appear in all frequencies multiple of RF/864, that is, n*578.7 kHz (= n=3D1,2,3,...). This is just to say why I need that CIC-like filter (I mean= , the low pass centered at IF of my code) which has notches in those n*578.= 7 kHz frequencies. Another correction: read "band pass" where it is written "low pass".
On 10.5.17 17:17, danielot@gmail.com wrote:
>> Spurs coming from ADC and ADC clock are well controlled, they provide sufficient SFDR and they are out of our preoccupations. The spurs I was referring to appear in all frequencies multiple of RF/864, that is, n*578.7 kHz (n=1,2,3,...). This is just to say why I need that CIC-like filter (I mean, the low pass centered at IF of my code) which has notches in those n*578.7 kHz frequencies. > > Another correction: read "band pass" where it is written "low pass". >
No problem - a two-sided low-pass is a band-pass. Are you quadrature sampling? -- -TV
On Wednesday, May 10, 2017 at 12:33:06 PM UTC-3, Tauno Voipio wrote:
> No problem - a two-sided low-pass is a band-pass.
Yes, in the end they're all the same stuff only shifted in frequency :)
> Are you quadrature sampling?
No, I'm trying to quadrature downconvert instead. 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. I would appreciate if you could review that new code. It should be straight forward now. Thank you very much. Daniel