📄 hcommodu.htm
字号:
<TITLE>Communications Toolbox Modulation and Demodulation</TITLE><h2>Modulation and Demodulation</h2>This toolbox contains functions for analog and digital modulation anddemodulation. You can use the toolbox to simulate a communication system using passband or baseband.There are six sublibraries included in the SIMULINK block library.<dd><A RUN="closebut(gcf);com_modu">Modulation and Demodulation Library</A> includes the following sublibraries:<dl><dd><A RUN="closebut(gcf);com_cdmo">Passband Analog Modulation and Demodulation</A><dd><A RUN="closebut(gcf);com_ddmo">Passband Digital Modulation and Demodulation</A><dd><A RUN="closebut(gcf);com_mocd">Passband Digital Modulation and Demodulation with a separated Map/Demap</A><dd><A RUN="closebut(gcf);com_cemo">Baseband Analog Modulation and Demodulation</A><dd><A RUN="closebut(gcf);com_moce">Baseband Digital Modulation and Demodulation</A><dd><A RUN="closebut(gcf);com_momp">Baseband Digital Modulation and Demodulation with a separated Map/Demap</A></dl><p>You can view a list of <a href="htb_modu.html">all SIMULINK blocks</a> in this category. <p>You can use either SIMULINK blocks or MATLAB functions for thesimulation. The MATLAB functions for modulation and demodulation are as follows:<dl><dd><b><a run="hthelp amod">amod</a></b> - Modulation computation.<dd><b><a run="hthelp ademod">ademod</a></b> - Demodulation computation.<dd><b><a run="hthelp amodce">amodce</a></b> - Complex envelope of analog modulation.<dd><b><a run="hthelp ademodce">ademodce</a></b> - Demodulate from a complex envelope of analog modulated signal.<dd><b><a run="hthelp dmodce">dmodce</a></b> - Complex envelope of digital modulation.<dd><b><a run="hthelp ddemodce">ddemodce</a></b> - Demodulate from complex envelope of digital modulated signal.<dd><b><a run="hthelp modmap">modmap</a></b> - Digital modulation mapping.<dd><b><a run="hthelp demodmap">demodmap</a></b> - Digital demodulation demapping.</dl><p>There are some other supporting functions in this category:<dl><dd><b><a run="hthelp apkconst">apkconst</a></b> - Compute/plot ASK/PSK constellation from NIR, AIR, PIR.<dd><b><a run="hthelp qaskenco">qaskenco</a></b> - Encode a message to two-dimensional form for QASK use.<dd><b><a run="hthelp qaskdeco">qaskdeco</a></b> - Decode a two-dimensional code to one dimension message.</dl><p>The analog modulation part includes the methods:<dl><dd><b>AM DSB-SC</b> Double sideband suppressed carrier amplitude modulation<dd><b>AM SSB-SC</b> Single sideband suppressed carrier amplitude modulation<dd><b>AM DSB-TC</b> Double sideband amplitude modulation with transmitting carrier<dd><b>QAM</b> Quadrature multiplex amplitude modulation<dd><b>FM</b> Frequency modulation<dd><b>PM</b> Phase modulation</dl><p>The digital modulation part includes the methods:<dl><dd><b>AKS</b> Amplitude shift keying modulation<dd><b>QAKS</b> Quadrature amplitude shift keying modulation<dd><dl> You can use one of the following three constellations:<dd> Square constellation<dd> Circle constellation<dd> User defined arbitrary constellation</dl><dd><b>FSM</b> frequency shift keying modulation<dd><b>PSK</b> phase shift keying modulation<dd><b>MSK</b> minimum shift keying modulation<p></dl>The following examples use the parameters:<dl><dd> Simulation sample time: ts = 0.01; <dd> Carrier frequency: Fc = 100/2/pi; <dd> Low pass filter: [num, den] = butter(2, Fc*ts); <dd> Simulation time vector: t = [0:ts:3]; <dd> Message signal: x = sin(t*pi); </dl><p><A RUN="closebut(gcf);hmodem('amssb',1);">Example 1: Passband AM SSB-SC</A> simulation.This example uses the following MATLAB commands:<dl><dd><tt> y1 = amod(x, Fc, 1/ts, 'amssb');<dd> y2 = amod(x, Fc, 1/ts, 'amssb/upper');<dd> z = amod(y1, Fc, 1/ts, 'amssb', num, den);<dd> subplot(312);<dd> plot(t, [x, z]);<dd> subplot(313);<dd> plot(t, y1);<dd> y1 = fft(y1, 512);<dd> y1 = y1 .* conj(y1) / 512;<dd> y2 = fft(y2, 512);<dd> y2 = y2 .* conj(y2) / 512;<dd> % frequency scale.<dd> f = 1000*(0:255)/512; <dd> subplot(311);<dd> plot(f, [y1 y2]);</tt></dl><p><A RUN="closebut(gcf);hmodem('qam',1);">Example 2: Passband QAM</A> simulation.This example uses the following MATLAB commands:<dl><dd><tt> x = [x sin(t*3*pi)];<dd> y = amod(x, Fc, 1/ts, 'qam');<dd> z = amod(y, Fc, 1/ts, 'qam', num, den);<dd> subplot(211);<dd> plot(t, [x, z]);<dd> subplot(212); <dd> plot(t, y);</dl></tt><p><A RUN="closebut(gcf);dmod('qask',64);">Example 3: 64-QASK square constellation</A>This example uses the following MATLAB command:<dl><dd><tt><a run="hthelp dmod">dmod</a>('qask', 64);</dl></tt><p><A RUN="closebut(gcf);x=modmap([0:127],1,1,'qask',128);dmod('qask/arbitrary',x(:,1),x(:,2));">Example 4: 128-QASK arbitrary constellation</A>This example uses the following MATLAB commands:<dl><tt><dd>x=<a run="hthelp modmap">modmap</a>([0:127],1,1,'qask',128);<dd>modmap('qask/arbitrary',x(:,1),x(:,2));</dl></tt><p>In this example, the first <b><a run = "hthelp modmap">modmap</a></b> generatesa vector of the constellation from a square constellation. The second <b><a run = "hthelp modmap">modmap</a></b> generates the constellation plot.<p><A RUN="closebut(gcf);hmodem(' ',3)">Example 5: 16-QASK modulation</A>. <p>This example uses the following MATLAB commands:<dl><tt><dd>M=16;<dd>N = 20;<dd>Fs = 100;<dd>x = randint(N, 1, M);<dd>y = dmod(x, 10, 1, Fs, 'qask', M);<dd>xx=modmap(x, 1, 1, 'qask', M);<dd>[ny, my] = size(y);<dd>y_n = y + (rand(ny, my) - .5) * 1.5;<dd>z = ddemod(y_n, 10, 1, Fs, 'qask', M);<dd>subplot(311)<dd>plot([0:N-1],x(:),'o',[0:N-1],z(:),'*');<dd>title('Digital signal. original: o, and recovered: *');<dd>subplot(312)<dd>plot([0:N-1],xx(:,1),'+',[0:N-1],xx(:,2),'x')<dd>title('Mapped Signal. In-phase + and Quadrature x');<dd>subplot(313)<dd>plot([0:1/Fs:N-1/Fs],y);<dd>title('Modulated signal');</dl></tt><p>In the figure generated from this example, the upper plot is acomparison between the originalmessage from the transmitting side and the recovered message from thereceiving side. The middle plot is the mapped signal in the digitalmodulation. The bottom plot is the modulated signal. You can view the <A RUN="closebut(gcf);dmod('qask',16);">16-QASK square constellation</A>used in this example by using the command:<dl><dd><tt><a run="hthelp dmod">dmod</a>('qask', 16);</dl></tt><p><dd><a href="commhelp.html">Return to the first page of the tutorial</a><dd><a href="hmfasb.html">Return to the functionality listing</a><p><tt><dd> This is hcommodu.html file.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -