From: Debora on 9 Aug 2010 12:10 Thanks Wayne. Your suggestion works, but it removes more signal instead of all the signal of that peak. Is there a way of removing all frequencies under 5 and having zero signal until then? Thank, Debora "Wayne King" <wmkingty(a)gmail.com> wrote in message <i3p181$p3l$1(a)fred.mathworks.com>... > "Debora " <debi_can(a)yahoo.com.br> wrote in message <i3otib$rjd$1(a)fred.mathworks.com>... > > Sorry, let me try to explain further. > > > > First, yes, I have used the filter design toolbox for the butterworth filter. > > > > As for the signal, I may not be using the appropriate terms, so I will try to write about it. My data has frequencies up to 1000 Hz. I am considering, from literature and previous works, that emg frequencies are from 20 to 500 Hz. Those are the frequencies I've used. Under 20 Hz, close to 0 Hz, I have this peak. This always happens with the equipment I've used, so I am sure this is noise and must be removed. > > > > Thanks, again, > > Debora > > Hi Debora, Assuming that you really want to remove this peak (I'm speaking about Jan's post). Then: > 1.) Identify the frequency corresponding to the peak. > 2.) Use iirnotch() from the Filter Design Toolbox to remove the oscillation. > > For example, just creating some data here: > > Fs = 1000; > t = linspace(0,1,1000); > % just simulating a 50-Hz component > x = cos(2*pi*50*t)+randn(size(t)); > % identifying the frequency > h = spectrum.periodogram; > msspec = msspectrum(h,x,'Fs',1000,'NFFT',length(x)); > [y,index] = max(msspec.Data); > freq = msspec.Frequencies(index); > % convert that frequency to normalized frequency > W = (2*freq)/Fs; > BW = W/35; > % get the notch filter > [b,a] = iirnotch(W,BW); > y = filtfilt(b,a,x); > msfilt = msspectrum(h,y,'Fs',1000,'NFFT',length(x)); > subplot(211); > plot(msspec); title('Before Notch Filtering'); > subplot(212); > plot(msfilt); title('After Notch Filtering'); > > Hope that helps, > Wayne
|
Pages: 1 Prev: write uitable data to text file Next: "Vectorize" code with nested for-loops |