Minimal Working - seems too good?!
This commit is contained in:
@@ -1,25 +1,45 @@
|
||||
classdef Electricalsignal < Signal
|
||||
%ELECTRICALSIGNAL Summary of this class goes here
|
||||
% Detailed explanation goes here
|
||||
|
||||
|
||||
properties
|
||||
|
||||
fs
|
||||
end
|
||||
|
||||
|
||||
methods
|
||||
function obj = Electricalsignal(signal)
|
||||
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 outputArg = method1(obj,inputArg)
|
||||
%METHOD1 Summary of this method goes here
|
||||
% Detailed explanation goes here
|
||||
outputArg = obj.Property1 + inputArg;
|
||||
|
||||
|
||||
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