buttLoop error message code lifted from Matlab example 60 Hz hum

Illustration
Taqi-al-Din - 2021-02-10T10:42:39+00:00
Question: buttLoop error message code lifted from Matlab example 60 Hz hum

Using code from Remove the 60 Hz Hum from a Signal.   srate = input ('Enter SAMPLE RATE for this subject(check log book!): '); ChannelFirst = data.ECG; Fs=srate; t =( 0:length(data.ECG)-1)/fs; plot(t,data.ECG); ylabel 'Voltage (V)', xlabel 'Time (s)' title 'Open-Loop Voltage with 60 Hz Noise' d = designfilt('bandstopiir','FilterOrder',2, ... 'HalfPowerFrequency1',59,'HalfPowerFrequency2',61, ... 'DesignMethod','butter','SampleRate',Fs); fvtool(d,'Fs',Fs) ; buttLoop = filtfilt(d,openLoop); ERROR THIS LINE

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

Looking at the documentation in the link, openLoop is loaded in this line:
 
 
load openloop60hertz, openLoop = openLoopVoltage;
and is one of the variables in that .mat file. You have to substitute your own signal, apparently ‘ChannelFirst’, for ‘openLoop’.

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!