## DSP tutorial: SSB modulation using the Weaver method

This example records audio and generates the lower sideband signal of it using the Weaver method, and saves it to a .wav file.

The Weaver method is the most complicated one, it uses two quadrature oscillators and lowpass filters. A very nicely illustrated paper on this method can be downloaded here, read this if you want to learn the mechanisms of this method.

For lowpass filtering I used a Butterworth filter. It’s cutFreq is 10kHz because it is not very steep, but in an ideal case, it should be samplerate/4. I left the lines for FFT filtering in the code (commented out).

Example resulting signal:

Walter 2013-07-20 17:05:26

Hi Nonoo,
I’ve been playing with your SSBWeaver.java program. I downloaded it and compiled it (after commenting out: import edu.emory.mathcs.jtransforms.fft.DoubleFFT_ID:). Then I tried recording some piano notes (e.g., A3, C4, etc.). When I played the .wav file, I expected to hear a pitch shift (along with some SSB distortion). But there was no pitch shift. I also tried changing the carrierFreq value from 10000 to 440. Still no pitch shift. Do you have any idea what I am doing wrong, or am I expecting the wrong response? Thanks in advance… I’m working on a software defined radio (SDR) project and wanted to add SSB reception. The current project is on SourceForge.net (enter: fun2audio in its Search window).

2013-07-21 09:07:03

Maybe the problem is that you commented out that DoubleFFT line.

Walter 2013-07-21 17:24:40

Hi again,
Since all of the other fft code had been commented out, I assumed that that line was not needed.

I will keep looking…

Walter 2013-07-21 19:41:46

OK, now the results make sense! I used the Audacity audio program to run the output.wav file. I used its Analyze | Plot Spectrun… tool to look at its spectrum. For an input tone of 261.63 (middle C on a piano(,the output peaks at about 9000 Hz, which is well above my hearing range! Impressive code! Thanks for sharing it…

Walter 2013-09-01 16:58:26

Hi again Nonoo
I ran your filter design at:
http://www-users.cs.york.ac.uk/~fisher/mkfilter/ with the same parameters as I assume you used: Butterworth, Lowpass, order=10, samplerate=44100, corner=10000. Everything was the same except the GAIN that was generated was: 7.432679795e+02. in your code the IIR_GAIN is: 3.452507086e+02. Do you remember where the difference came from? I’m trying to re-implement your program in C.

2013-09-01 17:31:36

Huh I can’t remember, but if you’re finished with the C conversion, please upload it somewhere and post the link to it here. :)

SAM 2013-10-03 06:06:08

Hello,

I just downloaded a plugin for Frequency shifter for V Machine but I don’t have a V Machine physically. I just downloaded VFX software and installed on my Win XP and also the plugin Frequency Shifter (32 bit) was added.

I can be able to see the VST editor and all that stuff at the right panel side of VFX application. In the options I have configured the DirectSound under Audio system option.

My question is I’m trying to change (shift) the FREQUENCY of a normal audio file .wav or .mp3 with 44100 khz sample rate with 8 or 16 bit per sample 128 or 320 kbps file from its normal frequency range, say – 8 – 10 khz and shift it to the range between 18- 20 KHZ. Is this possible with the above setup or do I require a V Machine? If it is possible to do it without V Machine then I would love to hear it from you using SSB modulation etc., and I will be obliged.

The statistics are given below –

Wavosaur statistics and information
————————————
Statistics:

RMS power L: 7.28% (-22.75 dB)

RMS power R: 7.27% (-22.76 dB)

Average value L (DC offset): -0.00% (-94.74 dB)

Average value R (DC offset): 0.00% (-89.95 dB)

Min value L: -98.11% (-0.17 dB)

Min value R: -100.13% (0.01 dB)

Max value L: 91.92% (-0.73 dB)

Max value R: 89.03% (-1.01 dB)

General information:

Sample name: D:\Ex\sam.mp3

Channel number: 2

Sample number: 1166976

Total duration: 00:00:26:462

Frequency: 44100Hz

Bits per sample: 16

Format: PCM

Selection:

Selection start: 0

Selection end: 1166975

Delta: 1166976

No loop points

No marker points

No automation points

Warm Regards,
SAM

2013-10-03 08:43:54

Hello, this is not a plugin, and I don’t know what V machine is. You’re missing something.

SAM 2013-10-04 04:35:03

Ok,
Let me make it simple.

I have an audio file whose specifications and details are given in my previous post here.

My sole purpose is to know if it is possible to change (SHIFT) the frequency of a file like above from 8-10 KHZ (for instance) to 18-20 KHZ and REVERSE of that. For instance a high frequency file of 18-20 KHZ and shift its frequency to 8-10 KHZ for whatever normal human hearing range is?

Is this possible using any wave editor program like Audacity or any other application in Win XP?

SAM

2013-10-04 09:46:52

Yes it’s possible, for example Sound Forge has a tool called “pitch shifter”. I think Audacity has this feature too.

SAM 2013-10-05 06:43:56

Thanks, I will give it a try. But I was wondering what does SSB modulation exactly do?

SAM

2013-10-05 08:45:41

Name (required)
E-mail (required - never shown publicly)
Webpage URL
Comment:
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> in your comment.