Zum Inhalt springen

Demodulation in Matlab – AM

Amplitude modulation, or AM, is a method of transmitting radio signals in which the amplitude of the carrier wave is varied according to the information-bearing signal. This is in contrast to frequency modulation (FM) where the frequency of the carrier wave is varied. In my experiment, I used Matlab to demodulate an AM signal in order to test if I wanted to acquire a private ‚Home‘ license.

My goal was to extract samples from my RTB2002 Oscilloscope and process them further in Matlab, with the ultimate goal of using the Advantest R3265a as a down-mixer to demodulate more complex high-frequency signals. The test signal was generated by the RTB2002’s signal generator, with a carrier signal of a 10MHz sine wave modulated by a 3 kHz sine wave and 100% modulation depth.

The first step was to connect to the RTB2002 with the VISA driver via a USB-TMC interlink. The binary query for the waveform worked efficiently enough for this purpose. To ensure proper results, I pulled the start time, end time and total samples to parametrize the ‚amdemod‘ function of Matlab.

I also stumbled upon a Butterworth filter on the tutorial page of Matlab, but I was unable to get it to work with the higher sample rates. Overall, my experiment provided valuable insights into the process of demodulating AM signals and sparked my interest in exploring the potential of Matlab for signal processing further.

This live script did the job. (Props to the guy over on reddit !)

Untitled
Connect and get waveform
rtb2002 = VISA_Instrument(‚USB0::0x0AAD::0x01D6::200278::0‘);
tic
query = ‚FORM:BORD LSBF;:FORM REAL;:CHAN1:DATA?‘;
waveformBIN = rtb2002.QueryBinaryFloatData(query, false);
toc
Elapsed time is 2.071922 seconds.
Show data
fprintf(„Waveform Data unprocessed:“)
Waveform Data unprocessed:
plot(waveformBIN);
Get waveform information
response = rtb2002.QueryASCII_ListOfDoubles(‚CHAN1:DATA:HEAD?‘, 4);
rtb2002.Close();
Calculate waveforms samplerate
xstart = response(1);
xstop = response(2);
samples = response(3);
samplerate = 1/((xstop – xstart) / samples);
Setup filter and time series
fc = 10e6;
t = (xstart:1/samplerate:xstop)‘;
t(end)=[];
% optional filter
[num, den] = butter(10, fc / (samplerate*2));
Convert data to double and plot
z = amdemod(double(waveformBIN), fc, samplerate, -0.15, 0);%, num, den);
fprintf(‚Processed 3khz sine‘)
Processed 3khz sine
plot(t, z, ‚c‘)

Schlagwörter:

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert