diff --git a/OOequipment/FourierHarmonics.mlx b/OOequipment/FourierHarmonics.mlx new file mode 100644 index 0000000..d6f91eb Binary files /dev/null and b/OOequipment/FourierHarmonics.mlx differ diff --git a/OOequipment/subfiles/FourierHarmonics_script.m b/OOequipment/subfiles/FourierHarmonics_script.m new file mode 100644 index 0000000..f6db58f --- /dev/null +++ b/OOequipment/subfiles/FourierHarmonics_script.m @@ -0,0 +1,95 @@ +%% Squarewave +w0 = 2*pi/T; +amp = 4*A/pi; + +tv = 0:T/50:2*T; + +ehv = amp*sin(w0*tv); +dhv = (amp/3)*sin(3*w0*tv); +vhv = (amp/5)*sin(5*w0*tv); +blv = A*(sign(ehv)); + +epdhv = ehv + dhv; +epdpvhv = epdhv + vhv; + +maxamp=max(ehv); +mA=ceil(maxamp); + +figure(1); +set(clf,'PaperType','A4'); +set(clf,'Color',[1,1,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); +plot(tv, blv, tv, ehv); +xlabel('time [ms]','Fontsize',8); +title('first harmonic','Fontsize',8); +set(gca,'Fontsize',8); + +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); +plot(tv, blv, tv, epdpvhv); +xlabel('time [ms]','Fontsize',8); +title('sum of all harmonics','Fontsize',8); +set(gca,'Fontsize',8); + + +%% Triangular Wave +amp = -(8*B)/(pi^2); + +tv = 0:T/50:2*T; + +ehv = amp*cos(w0*tv); +dhv = (amp/9)*cos(3*w0*tv); +vhv = (amp/25)*cos(5*w0*tv); + +rc = 4*B/T; +T2 = T/2; +T15 = 3*T/2; + +drv=[]; +for t=tv + if (t