From c16bb871ccfa5ba6e1cd81e2db3bd0945b12e2f9 Mon Sep 17 00:00:00 2001 From: Wouter Horlings Date: Sun, 3 Dec 2017 11:51:36 +0100 Subject: [PATCH] phase magnitude function --- OOequipment/equiment_init.m | 2 ++ OOequipment/phamag.m | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 OOequipment/equiment_init.m create mode 100644 OOequipment/phamag.m diff --git a/OOequipment/equiment_init.m b/OOequipment/equiment_init.m new file mode 100644 index 0000000..448c493 --- /dev/null +++ b/OOequipment/equiment_init.m @@ -0,0 +1,2 @@ +fg = FunctionGenerator('10.0.0.3',1234,10); +sc = Oscilloscope('10.0.0.2',5025,2); \ No newline at end of file diff --git a/OOequipment/phamag.m b/OOequipment/phamag.m new file mode 100644 index 0000000..87346ea --- /dev/null +++ b/OOequipment/phamag.m @@ -0,0 +1,17 @@ +function [phase,magnitude] = phamag(wave1,wave2,frequency,T,length) +%PHAMAG Summary of this function goes here +% Detailed explanation goes here +wave = [wave1;wave2]; +fft1 = fft(wave); + + + function g = phasefft(wave,length,T) + f = fft(wave); + g = abs(f(1:length/2+1)/length); + figure; + plot(f) + end + + +end +