Questions tagged [butterworth]

For Questions related to the development, design, and calculations associated with Butterworth filters, a type of linear signal processing filter. Questions must be related to programming, and not to the specifics of electrical implementations, or to the use of implementing devices (which may be more suited to the Electronics or Signal Processing Stack Exchanges).

Butterworth filters were first described by Stephen Butterworth in 1930 and are a form of linear analog signal processing filter. They approximate an ideal low-pass filter by combining filter elements.

There is an associated Wikipedia article here: https://en.wikipedia.org/wiki/Butterworth_filter

Electronics Stack Exchange: https://electronics.stackexchange.com/

Signal Processing Stack Exchange: https://dsp.stackexchange.com/

79 questions
6
votes
0 answers

Performance issues processing & updating huge dataset in JS

I have a Python Tkinter app that loads a dataset with 10 million data points into a plot using Matplotlib. In addition, it allows the user to constantly apply various signal processing filters on runtime that manipulate the data and update the…
5
votes
0 answers

Audio equalizer

I'm trying to make a simple 10-bands equalizer with python. I have written two functions in order to make this but I have a issue with gain. I want to set a gain for each band but it not works. Here there is an example. It is required a mono-channel…
Federico
  • 51
  • 1
  • 1
  • 3
4
votes
1 answer

how do I remove large spike at the beginning of a signal after applying Butterworth Bandpass filter in python?

I want to detrend a signal using a bandpass filter. I used a Butterworth filter with FL=0.1 Hz and FH=20Hz in python but after applying this bandpass filter I observed a large spike at the beginning of the detrended signal. what is this spike for?…
Mahsa Alidadi
  • 105
  • 1
  • 8
3
votes
0 answers

Filtering low frequencies using a High Pass Filter does not seem to work

I am trying to implement an algorithm from a research paper where we use accelerometers for detecting activity patterns. The authors mention in the paper that use a High Pass Filter with a cutoff frequency of 1Hz to remove the effect of low…
m.umar
  • 855
  • 4
  • 13
  • 23
3
votes
1 answer

Why do I get an error using butterworth filter for low frequency filtering?

I'm trying to analyze the amplitude of each 1/3 octave band frequency, so I'm using many bandpass butterworth filters. However, they only work for 50 Hz when it is a 3rd order. I would like to use a 6th order, but for some reason I got no results…
Marcel
  • 51
  • 4
3
votes
0 answers

Why it returns nan while using scipy.signal.filtfilt

I have an array of date whose sampling rate is 160GHz, and I wish to apply 30kHz-100kHz bandpass filter to the data. I write as follows: import scipy.signal as dsp import numpy as np fs=160e9 data=np.random.rand(int(1e-4*fs)) b, a = dsp.butter(5,…
Zhang Boyu
  • 39
  • 1
  • 4
3
votes
1 answer

Provide initial value to signal::filter function in R

Consider the following (derived from signal::filter help page): require(signal) bf <- butter(5, 0.1) t <- seq(0, 1, len = 100) x <- sin(2*pi*t*2.3) + 0.25*rnorm(length(t)) + 5 y <- filtfilt(bf, x) z <- filter(bf, x) plot(t, x, ylim = c(0,…
lactea
  • 121
  • 10
2
votes
0 answers

How to determine parameter W in butter function (bandpass filter) from signal package R?

I would like to preprocess my collected data with a bandpass filter between 0.1 and 10 HZ and 0.01 and 10Hz. butter(n, W, type = c( "pass")) According to the signal package documentation the parameter W must be between 0 and 1. W : critical…
2
votes
0 answers

Filtering Gaussian Peaks With Known Frequency

Let us suppose I have some gaussian data, at some known frequency from one another, sitting on some low frequency noise data. Each gaussian has a probability given by a Poisson distribution, so all the peaks have different heights. I would like to…
Jack Rolph
  • 587
  • 5
  • 15
2
votes
1 answer

scipy.signal issue with butterworth, value unpacking wierdness

b, a = butter(order, normal_cutoff, btype='low', analog=False) this highlights butter, and says there are too many values to unpack. When I run the code, it works and returns no errors. b, a, c = butter(order, normal_cutoff, btype='low',…
2
votes
0 answers

Apply Butterworth filters in time series data

I have time series data which are measured in miliseconds (ms) (69300 rows) and I want to apply low-pass, high-pass and band-pass Butterworth filters. My approach is the following: Convert ms into Hz Find the Nyquist which is sample rate/2 (as…
2
votes
0 answers

Butterworth filter doesn't improve my neural signal

I have a signal from a (natural) neuron taken from a 16 bit ADC at 18.2 kHz. I'm trying to detect spikes in that signal. For those who are not familiar with this: when neurons fire, they give a specific signal: it starts with a steep rise (or fall,…
Nyos
  • 394
  • 5
  • 13
2
votes
2 answers

why is this butterworth filter presenting different results in R and Matlab?

I'm trying to use a 20Hz low pass filter on data in R, but when I use the filtfilt function, the plot is different from the matlab. I'm using the following code in R: fc<-20 fs<-100 Wn<-pi*fc/(2*fs) testar<- butter(5, Wn, type="low") L2<-…
2
votes
1 answer

Different Results for Butterworth Filter in R and Python

I tried to run the same filter on the same data in R and Python and I got different results, below are the codes. Can anyone tell me why does that happen and how do you solve it? Python code: from scipy import signal >>> fc = 0.05 # Cutoff…
lfc
  • 185
  • 6
1
vote
1 answer

Scipy Butterworth bandpass filter does not return correct amplitudes

I am trying to create a bandpass filter using SciPy Butterworth, but it is not returning correct amplitudes (although it seems to get the periods right). First, I create a wave that is a combination of three waves: x = np.arange(1,365,1) y1 =…
1
2 3 4 5 6