WIP büro
This commit is contained in:
45
Classes/00_signals/Electricalsignal.m
Normal file
45
Classes/00_signals/Electricalsignal.m
Normal file
@@ -0,0 +1,45 @@
|
||||
classdef Electricalsignal < Signal
|
||||
%ELECTRICALSIGNAL Summary of this class goes here
|
||||
% Detailed explanation goes here
|
||||
|
||||
properties
|
||||
fs
|
||||
end
|
||||
|
||||
methods
|
||||
function obj = Electricalsignal(signal, options)
|
||||
%ELECTRICALSIGNAL Construct an instance of this class
|
||||
% Detailed explanation goes here
|
||||
arguments
|
||||
signal
|
||||
options.fs
|
||||
options.logbook
|
||||
end
|
||||
|
||||
obj = obj@Signal(signal);
|
||||
|
||||
fn = fieldnames(options);
|
||||
|
||||
for l = 1:numel(fn)
|
||||
obj.(fn{l}) = options.(fn{l});
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
function pow = power(obj)
|
||||
|
||||
pow = mean(abs(obj.signal),"all") ;
|
||||
|
||||
end
|
||||
|
||||
function obj = normalize(obj)
|
||||
|
||||
obj.signal = obj.signal/sqrt(mean(abs(obj.signal),"all"));
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user