Hey everyone. I am attempting to create a matlab code to filter and further analyze EMG signals. As of right now, I keep receiving this error: "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters". This happens after I denote the variable Filtered as filter(d,SA). My code is shown below. I any of you guys can help me with this particular problem and give some input on what do you think about it, I highly appreciate.
SN = 1; %Chooses the gain which will equal to the desired input voltage or impedance SA= CH1.* 10^(SN/20); %signal amplification figure(2) plot(SA)
D = fdesign.bandpass('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2', ... 0,15,500,515,60,1,60); %values for band pass filter Filtered = filter(d,SA); %applying filter to amplified data freq = 0:(2*pi)/length(CH1):pi; %frequency vector xdft = fft(SA); %discrete fourier transform ydft = fft(Filtered); %discrete fourier transform plot(freq/pi,abs(xdft(1:length(CH1)/2+1))) hold on plot(freq/pi,abs(ydft(1:length(CH1)/2+1))) hold off xlabel('Normalized Frequency (\times\pi rad/sample)') legend('Original Signal','Bandpass Signal')
SN = 3; %Chooses the gain which will equal to the desired input voltage or impedance FSA= Filtered.* 10^(SN/20); %signal amplification for later analysis figure(2) plot(FSA)