瀏覽代碼

fourierfilteranalyse toegevoegd

master
Wouter Horlings 8 年之前
父節點
當前提交
ab373c35b3
共有 5 個文件被更改,包括 51 次插入25 次删除
  1. +0
    -15
      MOD2-files/EXP6/Experiment6_filter.m
  2. 二進制
      OOequipment/FourierFilterAnalysis.mlx
  3. 二進制
      OOequipment/FourierHarmonics.mlx
  4. +38
    -0
      OOequipment/subfiles/FourierFilterAnalysis_script.m
  5. +13
    -10
      OOequipment/subfiles/FourierHarmonics_script.m

+ 0
- 15
MOD2-files/EXP6/Experiment6_filter.m 查看文件

@@ -1,18 +1,3 @@
clear;
clc;

fprintf('Bodediagram of the filter\n\n');

R2 = input('R2 [Ohm] : ');
R3n = input('R3:[kOhm] : ');
C4n = input('C4 [nF] : ');
L5n = input('L5 [mH] : ');
fprintf('\n');

R3 = R3n*1e3;
C4 = C4n*1e-9;
L5 = L5n*1e-3;

t0 = 0;
t1 = L5;
n0 = R2+R3;


二進制
OOequipment/FourierFilterAnalysis.mlx 查看文件


二進制
OOequipment/FourierHarmonics.mlx 查看文件


+ 38
- 0
OOequipment/subfiles/FourierFilterAnalysis_script.m 查看文件

@@ -0,0 +1,38 @@
t0 = 0;
t1 = L5;
n0 = R2+R3;
n1 = L5;
n2 = n0*C4*L5;

fstep = 4;
f=596;

for i=1:251
f = f + fstep;
frequentie(i) = f;
w = 2*pi*f;
H(i)=((1i*w*t1)/(n0+1i*w*n1+n2*(1i*w)^2));
end

figure(1);
fig_label=('Bodediagram Fourierfilter');
set(clf,'PaperType','A4');
set(clf,'Color',[1,1,1]);
subplot(211);
semilogx(frequentie, abs(H))
axis([600 1600 0.0 1.2])
ylabel('amplitude','Fontsize',10)
hndl=title(fig_label,'Fontsize',10,'Fontweight','bold');
h=get(hndl);
set(gca, 'XTick', [600 700 800 900 1000 1100 1200 1300 1400 1500 1600],'Fontsize',8)
set(gca, 'YTick', [0.0 0.2 0.4 0.6 0.8 1.0 1.2],'Fontsize',8)
grid;

subplot(212);
semilogx(frequentie, angle(H)/pi)
axis([600 1600 -0.6 0.6])
xlabel('frequency [Hz]','Fontsize',10)
ylabel('phase [rad]','Fontsize',10)
set(gca, 'XTick', [600 700 800 900 1000 1100 1200 1300 1400 1500 1600],'Fontsize',8)
set(gca, 'YTick', [-0.6 -0.4 -0.2 0.0 0.2 0.4 0.6],'Fontsize',8)
grid;

+ 13
- 10
OOequipment/subfiles/FourierHarmonics_script.m 查看文件

@@ -18,30 +18,30 @@ mA=ceil(maxamp);
figure(1);
set(clf,'PaperType','A4');
set(clf,'Color',[1,1,1]);
subplot(221);
ax(1) = subplot(221);
plot(tv, blv, tv, ehv, tv, dhv, tv, vhv);
xlabel('time [ms]','Fontsize',8);
title('first three harmonics','Fontsize',8);
set(gca,'Fontsize',8);

subplot(222);
ax(end+1) = subplot(222);
plot(tv, blv, tv, ehv);
xlabel('time [ms]','Fontsize',8);
title('first harmonic','Fontsize',8);
set(gca,'Fontsize',8);

subplot(223);
ax(end+1) = subplot(223);
plot(tv, blv, tv, epdhv);
xlabel('time [ms]','Fontsize',8);
title('sum first and third harmonic','Fontsize',8);
set(gca,'Fontsize',8);

subplot(224);
ax(end+1) = subplot(224);
plot(tv, blv, tv, epdpvhv);
xlabel('time [ms]','Fontsize',8);
title('sum of all harmonics','Fontsize',8);
set(gca,'Fontsize',8);
linkaxes(ax)

%% Triangular Wave
amp = -(8*B)/(pi^2);
@@ -70,26 +70,29 @@ epdpvhv = epdhv + vhv;
figure(2);
set(clf,'PaperType','A4');
set(clf,'Color',[1,1,1]);
subplot(221);
ax(end+1) = subplot(221);
plot(tv, drv, tv, ehv, tv, dhv, tv, vhv);
xlabel('time [ms]','Fontsize',8);
title('first three harmonics','Fontsize',8);
set(gca,'Fontsize',8);

subplot(222);
ax(end+1) = subplot(222);
plot(tv, drv, tv, ehv);
xlabel('time [ms]','Fontsize',8);
title('first harmonic','Fontsize',8);
set(gca,'Fontsize',8);

subplot(223);
ax(end+1) = subplot(223);
plot(tv, drv, tv, epdhv);
xlabel('time [ms]','Fontsize',8);
title('sum first and third harmonic','Fontsize',8);
set(gca,'Fontsize',8);

subplot(224);
ax(end+1) = subplot(224);
plot(tv, drv, tv, epdpvhv);
xlabel('time [ms]','Fontsize',8);
title('sum of all harmonics','Fontsize',8);
set(gca,'Fontsize',8);
set(gca,'Fontsize',8);

linkaxes(ax(5:8))
arrayfun(@(x) set(x,{'XGrid','YGrid'},{'on','on'}),ax)

Loading…
取消
儲存