COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Butterworth filter 407421

• Email
• Follow

```Hi guys

This is my first post on the forum. I am currently doing an assignment that involves analysing large data sets. These can be read in MATLAB and opened in wordpad. Does anyone know how to write code to use a butterworth filter to filter the data sets. I will be using a high pass filter.

Thanks

Steve
```
 0

See related articles to this posting

```"Steven " <beefy125@hotmail.com> wrote in message <i81m1c\$or4\$1@fred.mathworks.com>...
> Hi guys
>
> This is my first post on the forum. I am currently doing an assignment that involves analysing large data sets. These can be read in MATLAB and opened in wordpad. Does anyone know how to write code to use a butterworth filter to filter the data sets. I will be using a high pass filter.
>
> Thanks
>
> Steve

Hi Steve,

There are a number of workflows for the  implementation of  a Butterworth filter in MATLAB.

1.) Through the GUI fdatool (or filterbuilder). Enter fdatool at the command line, the GUI will initialize. Choose highpass and IIR -> Butterworth and specify your filter. Once you have designed your filter, you can do file -> Generate MATLAB code to export the MATLAB code for your filter.

2.) From the command line using fdesign.highpass.
Ex: Assume your sampling frequency is 10 kHz and you want to high pass filter everything above 1 kHz. Place the stopband frequency at 950 Hz, the passband at 1 kHz, require 60 dB of attenuation in the stopband, and tolerate a passband ripple of 0.5 dB.

h = fdesign.highpass('Fst,Fp,Ast,Ap',950,1000,60,0.5,1e4);
D = design(h,'butter');

output = filter(D,Input);

3.) Use butter(), you will have to convert your frequencies in Hz to normalized frequencies. The output of butter() is the numerator and denominator coefficients of your Butterworth filter.

All of the above are well-documented in the MATLAB Signal Processing Toolbox documentation.

Wayne
```
 0

```Cheers thanks for that I will c how it goes.
```
 0

2 Replies
656 Views

Similar Articles

12/6/2013 11:35:11 AM
page loaded in 72714 ms. (0)

Similar Artilces:

filter() function
Hi All, I was reading the technical note on vectorisation and came across the filter() function. Unfortunately I don't come from any kind of signal processing background, although from what I can make out this could be a useful function for my work. I couldn't understand the help file. If I have row vector x defined, what will filter([a b],[c d], x) do, in terms of a,b,c,d and x(i)? Any help will be very much appreciated Rob "Rob McIntyre" <mcintyrer@andisa.co.za> wrote in message news:eee45e9.-1@webx.raydaftYaTP... > Hi All, > I was reading the technical note on vectorisation and came across the > filter() function. Unfortunately I don't come from any kind of signal > processing background, although from what I can make out this could > be a useful function for my work. I couldn't understand the help > file. > > If I have row vector x defined, what will > > filter([a b],[c d], x) > > do, in terms of a,b,c,d and x(i)? > > Any help will be very much appreciated > Rob What don't you understand from help filter? Apologies I misread the help file, in truth. I see the light now. Thanks

Kalman Filter
Dear Sir/Madam, Why the noise used in Kalman filter is assumed to be White noise? Any particular reason? Regards, Senthil Kumar S, Assistant Professor, Hindustan University, Chennai. On 11/17/2010 04:29 AM, Senthil_Avionics wrote: > Dear Sir/Madam, > > Why the noise used in Kalman filter is assumed to be White noise? Any > particular reason? If you go over the math behind the Kalman filter you'll see that it assumes white Gaussian noise. The math isn't valid for noise that's not white (or at least for noise that isn't much broader band... foundation for Kalman filtering and all of it's offspring, you can't go wrong with "Detection, Estimation and Modulation Theory, Part I" by Van Trees (Wiley, 1968): http://www.powells.com/partner/30696/biblio/9780470542965. The Simon book teaches you a bit about estimation, then spends a chapter deriving a basic Kalman filter. The Van Trees book connects a fire hose directly to your brain and fills it with more estimation theory than you can shake a neuron at, then makes _you_ derive the Kalman filter in one of the homework problems in Chapter 5. The Simon book

FIR Filter 187724

Nonlinear filter evaluation
Is there a standardized method of root signal analysis to be applied to nonlinear filters? If yes, please give details. Thanks in advance.

Very narrowband filter
I need help on how to filter a very narrowband signal. Signal bandwidth = 0.05 Hz Signal frequency = 5000 Hz Sampling rate = 30000Hz For the filter (lowpass or bandpass FIR): transition bandwidth = 0.02 Hz max passband ripple = 0.15 dB minimal stopband attenuation = 80 dB If I can only get a lowpass filter I will bring the signal to baseband. I do know that I need to use multistage multirate filter. Any help with this simulation will be appreciatted. The simulation is in Matlab. Thanks e09 wrote: > I need help on how to filter a very narrowband signal. > Signal bandwidth = 0.05 Hz > Signal frequency = 5000 Hz > Sampling rate = 30000Hz > For the filter (lowpass or bandpass FIR): > transition bandwidth = 0.02 Hz > max passband ripple = 0.15 dB > minimal stopband attenuation = 80 dB > > If I can only get a lowpass filter > I will bring the signal to baseband. > > I do know that I need to use multistage multirate filter. > Any help with this simulation will be appreciatted. > The simulation is in Matlab. > > Thanks You don't necessarily need to use a multistage multirate filter. I haven't tried it (no Matlab on my Mac

JSP Filter question
So I have this filter I'm playing around with. It's a simple one, replaces all instances of my daughter's name with the word "Princess" wrapped in a couple html tags. It captures the output of any filters after it in a CharArray, and then does a regex search and replace. It works perfectly *if* there is a filter sitting after it in the chain. If not, however, chain.doFilter results in an empty CharArray. Is there any way to make this thing work if this filter is the only one installed in my webapp? (Ignore the package and class names - I'm eventually going to use this filter for something else but didn't feel like changing the names. The code obviously doesn't have anything to do with logging in to anything. :>) package net.justthe.csfilter; import java.io.IOException; import java.io.PrintWriter; import java.util.regex.Pattern; import java.util.regex.Matcher; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class LoginFilter implements Filter { public void doFilter(ServletRequest rq, ServletResponse rs, FilterChain chain) throws

white noise in kalman filter
I have a dc motor and I have to control it by control lg and using kalman filter.As input I have a step,how I can choose w e v in the kalman filter? Can you help me ? Thanks.

IIR filter design
Hi all, As we all know, designing IIR filters is easy enough for low filter order but is far more difficult when higher order filters are required to meet design contraints like low passband ripple, narrow transition bands and high levels of attenuation in the stopband. I'm currently working on a program for designing IIR filters and this software has recently produced a LP filter with the following specs: Order : 18 Passband : 0 - 0.2*fs < 0.1 dB ripple Stopband : 0.25*fs - 0.5*fs > 100 dB attenuation This was achieved with a single overnight run on a 450Mhz Pentium III machine. I am now trying to design a 16th order filter to meet the same specs. I'm therefore asking people here the following questions: 0) How big and how "difficult" are the IIR filters you have designed? 1) What methods and/or software was used to design them? TIA, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ A sufficiently advanced programming error is indistinguishable from

streams problems in filter chains...
Hello. I have some problem with application I am writing. I have filter chain (classes implement interface Filter from javax.servlet). My problem is about handling streams from request and response. In my chain I have two filters. First filter in its doFilter() method retrieves file (image) from database as an input stream and copies it contents into response's output stream. My second filter needs to act upon retrieved file... And here the problem appears. I tried googling, I tried reading manuals, but only got confused... And now I'm not even trying to pretend I understand a thing... I have structure like this: currentFilter extends Filter{ doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) //do some request processing to get some params - only reading those filterChain.doFilter(); } As far as I understand if I call filterChain.doFilter() filter underlying current will be executed. Image should be in response's output stream, am I right? If yes, how can I transform this output stream into input stream? I need that because this filter will work on data and needs to read them somehow.... I also tried something like

Question on inverse filter
Dear all, I want to design an inverse filter, I inverse the spectrum of a chirp and do ifft to get the coefficients. However, the convolution of the coefficients with the chirp is not close to delta function, anyone can help me? Thank you very much! f0=10e6; B =4e6; Tr =6.4e-6; a = 2*pi*B/Tr; fs =200e6; t = [0:1/fs:Tr]; chirps = cos(2*pi*(f0-B/2)*t+a/2*t.^2); fftc = fft(chirps); inversef = ifft(1./fftc) figure; plot(conv(chirps,inversef));