Pre-amplification, filtering and amplification

조회 수: 2 (최근 30일)
Ricardo Whitaker
Ricardo Whitaker 2018년 11월 10일
답변: Robert U 2018년 11월 12일
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)

답변 (1개)

Robert U
Robert U 2018년 11월 12일
Hello Ricardo Whitaker:
I assume the CH1 signal is a vector of doubles.
  • The desired filter causes errors since frequency zero as first stop frequency is not supported.
  • Frequencies have to be given as normalized values using option 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
  • Function filter() does not support fdesign-objects; the filter has to be designed first applying one of the available methods (see design() as reference, an example is given in the matlab help in fdesign.bandpass )
Kind regards,
Robert

카테고리

Help CenterFile Exchange에서 Analog Filters에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by