MATLABのAM変調回路解析

MATLABのAM変調回路解析

と、言いながらもどちらかといえば
トランジスタ回路で作るAM変調回路の解析
の方が近いかも知れません。

2回にわたり解説したのでここでは
MATLABのプログラムのみ添付しておきます。

もともとスクリプトファイルから始まってるものを
ファンクションmファイルにしました。

このプログラムを保存する場合は
AMmodule.m
で保存願います。

以下MATLABプログラム

function AMmodule
Fs = 10000; % Sampling frequency
T = 1/Fs; % Sample time
L = 1; % Length of signal
t = [0:T:1]; % Time vector

% Carrier 500Hz Signal 65Hz
y1=sin(2*pi*500*t).*(1+0.5*sin(2*pi*500*t*0.135));
y2=sin(2*pi*500*t)+0.5.*sin(2*pi*500*t*0.13);

% signal plot
figure
subplot 311
plot(t,sin(2*pi*500*t))
xlim([0 0.1])
grid on

subplot 312
plot(t,0.5*sin(2*pi*500*t*0.13))
xlim([0 0.1])
grid on
subplot 313
plot(t,y2)
xlim([0 0.1])
grid on
xlabel(‘time(sec)’)
myfft(y2,0.1,1500,Fs)

%transistor amp
yy=100*y2;
yy(find(lt(yy,0)))=0;

figure
plot(t,yy)
xlim([0 0.1])
grid on
xlabel(‘time(sec)’)
myfft(yy,0.1,1500,Fs)

%LCR by-pass and Low-cut filter
figure
yy=lsim(tf([100 100],[1 300 3141.6^2]),yy,t);
plot(t,yy)
title(‘filterd signal’)
grid on
xlabel(‘time (sec)’)
xlim([0 0.1])
myfft(yy,0.1,1500,Fs)
end
function myfft(a,b,c,Fs)
NFFT = 2^nextpow2(Fs); % Next power of 2 from length of y
Y = fft(a,NFFT)/Fs;
f = Fs/2*linspace(0,1,NFFT/2);

% Plot single-sided amplitude spectrum.
figure
plot(f,2*abs(Y(1:NFFT/2)))
title(‘Single-Sided Amplitude Spectrum of y(t)’)
xlabel(‘Frequency (Hz)’)
ylabel(‘|Y(f)|’)
xlim([b c])
grid on
end

以上

Tags: ,

Leave a Reply