# Tag Info

## Hot answers tagged filtering

19

To understand the linearity property more easily.Let us consider the above diagram,here we have 2 sequences namely Xn and Yn. when we add both the sequence we get Xn+Yn whose amplitude value are represented with blue colour. when any system which satisfy this condition then it is called linear. In case of mean filter, mean value for sequence Xn is 1+1+3/3=5/...

18

Nonlinear filters are those for which the linearity relationship breaks down. Consider two signals $A$ and $B$, for linear filter such as mean filter $F_m$,you have $F_m(A+\lambda B) = F_m(A) + \lambda F_m(B)$, but the equation is not satisfied for an nonlinear filter such as the median filter. In application, the median filter removes outliers and shot ...

16

I agree with pichenettes's answer but I would like to add that it is pretty common practice to use a simple inexpensive low-order analog anti-aliasing filter, and do the rest of the anti-aliasing filtering in the digital domain. This implies of course that you do not process at maximum sampling rate but that you downsample after the digital anti-aliasing ...

15

No, this does not make sense. Say your ADC sample rate is 1kHz. A 100 Hz sine wave and a 900 Hz sine wave will yield exactly the same sequence of digital samples once fed into your ADC - but you want to pass the former and attenuate the later. How do you expect your digital filter to produce different outputs when fed the same input? The only thing that ...

12

One approach would be to cast the problem as least-squares smoothing. The idea is to locally fit a polynomial with a moving window, then evaluate the derivative of the polynomial. This answer about Savitzky-Golay filtering has some theoretical background on how it works for nonuniform sampling. In this case, code is probably more illuminating as to the ...

11

Just to support Matt's answer and provide a few more details: Most modern ADCs do most of the hard antialiasing job in the digital domain. Reason is that digital filters tend to produce less by-products for a much lower cost. The actual chain is: Analog Input. Analog Anti-aliasing filter. Oversampling (eg, at 8x). Digital Anti-Aliasing Filter. Decimating (...

9

The problem with the moving average is that the average is not robust to the presence of the outliers - so you would need a very large window size to "dilute" the outliers. Try a non-linear filter instead, like a median filter: Apply a median filter on your signal - you would need a window size of at least 300 samples. Compute the difference between the ...

9

Yes, you are correct. Multiplication in time domain means convolution in frequency domain and vice versa. Multiplying your signals $x[n]$ and $y[n]$ will give an output: \begin{align} z[n]&=\{2\cdot 5, 4\cdot 1, 1\cdot 8\}\\ &= \{10, 4, 8\}\end{align} Remember that this output is in time domain. When you convolve $x[n]$ and $y[n]$, you will get $... 8 For a start, any non-linear system will not have an easily-identifiable frequency response. So, it's really a nonsensical question. I intend no offense; nonsensical questions are often the most enlightening! However one way to try to answer your question is to assume that the LTI filter involved is the mean (rather than the median) of the windowed data. ... 8 Linear filters in the spatial domain have a direct equivalent in the frequency domain, so you can transform your data and filter between spatial<->frequency domains and get equivalent results. However the transforms that we use for converting between spatial<->frequency domains are only valid for linear systems - a non-linear filter such as a median ... 8 Your first order filter recursion for some real constants$a,b,c$is $$y[n] = a x[n] + b x[n-1] - c y[n-1]$$ with the two initial memory states$x[-1]$and$y[-1]$at$n=0$. Your "no transient" condition can be translated to$y[0]=0$and a necessary second condition so that you can solve for both of your memory states. The second condition could be, ... 6 I'm pretty new to this myself, so please correct me if I get this wrong. Using your example, J = ordfilt2(I, 9, true(5)). ordfilt2 will move over the 2d array I in blocks of the same size as true(5). For each of these 5x5 blocks, sort all the elements from smallest to largest. Now fill in the corresponding block in J with a bunch of copies of the 9th ... 5 You are looking at the wrong metric of "correctness". Nearest neighbor is introducing significant discontinuities that are showing up as massive quantities of noise in the result. The problem is that you should be comparing to the result you would have gotten if you had sampled at 26.25MHz in the first place. Let's try it (sample a 12Hz sine wave at 26 Hz ... 5 In previous sections of the book, the fact that a discrete-time signal's spectrum is periodic may have been mentioned. It can be described formally as follows: $$X(e^{j\omega})=\frac1{T} \sum_{k=-\infty}^{\infty}X_C\biggr(j\biggr(\frac{\omega}{T}-\frac{2\pi k}{T}\biggr)\biggr)$$ being$X_C(j\omega)$the Fourier Transform of the continuous signal, and$T=1/...

5

In a linear filter, the output will change linearly with a change in the input. You could plot some sort of straight line from the relationship between the two. A median filter can change non-linearly with certain input changes. e.g. take an input vector where all the data values are different: a change in a non-middle value won't affect the median output ...

5

I need to preprocess raw ecg data in R, here is a sample already standardized. I'm not an expert in signal processing nor experienced in working with medical data,... Not being an expert on how the heart works and how its phases manifest themselves on the ElectroCardioGram (ECG) is not a problem. But it would help immensely if you mentioned what is the ...

5

Sampling at a higher rate will distribute the quantization noise over a wider frequency, thus reducing the noise spectral density due to that quantization noise, with a lot of caveats. For more details on that see What are advantages of having higher sampling rate of a signal? In your last paragraph, if you are referring to running the same filter at a ...

5

You can achieve this result by using two combs filters : https://en.wikipedia.org/wiki/Comb_filter Put simply, the comb filter consists of adding a delayed version of the signal to itself, causing destructive or constructive interference. For instance, with $K = 20$ and a negative gain value after the delay line, you can significantly decrease or suppress ...

5

A personal rule: in general, it can be better to perform non-linear operations before linear ones. One reason behind that is that a lot of practical concerns are related to outliers or suspect behavior, which can easily be smoothed out (and become indistinct from other signals) by linear filters. Let me reformulate. If $f_i$ denote filters, and $s_i$ ...

4

For this operation to work, you need to imagine that your image is reshaped as a vector. Then, this vector is multiplied on its left by the convolution matrix in order to obtain the blurred image. Note that the result is also a vector the same size as the input, i.e., an image of the same size. Each row of the convolution matrix corresponds to one pixel in ...

4

A filter bank is a collection of bandpass filters designed to split a signal into a number of bands. The centre frequencies of the band pass filters can be spaced linearly or according to a non-linear spacing depending on the intended application. $H(z)$ denotes the $z$-domain transfer function of a filter in the bank.

4

Wavelets are ideal for localized events. The Fourier Transform represents a function as a sum of sines and cosines, neither of which are localized. The spectrogram does keep some time information, at the expense of frequency resolution In your case, the signal is not localized at all. The spectrogram smears your 15 Hz band over several Hz, as it captures ...

4

You can design that filter manually without problems. Matlab just uses a very simplistic approach to comb filtering with a delay line. In order to keeps things as simple as possible I would recommend you use a series of notch filters to remove each partial of your harmonic noise separately. That also gives you more control over how much of each harmonic ...

4

A finite impulse response (FIR) digital filter implements the following convolution sum $$y(n)=\sum_{n=0}^{N-1}h(k)x(n-k)\tag{1}$$ for each output sample $y(n)$, where $x(n)$ is the discrete-time input signal, $h(n)$ is the filter's impulse response, and $N$ is the filter length. The values $h(n)$ are also called filter taps, and $N$ is then referred to as ...

4

In Short: The order does matter. Detailed: Downsampling by a factor of 2 without filtering, will cause aliasing in frequencies of 500Hz and more. Since your signal is bandlimited to 600Hz, the frequency range of 400Hz-500Hz will be corrupted. So (theoretically) the frequency range 0Hz-400Hz will be the same with or without filtering. If you were only ...

4

Yes, the order does matter. In a real system with noise (as opposed to an idealized model) if you decimate before filtering, all the noise in the bands you aren't interested in will alias back in, raising the noise floor of your system. In your example, if you downsample by two before filtering you would have twice the noise in your bands of interest ...

4

In general it's only possible to implement causal and stable filters. There are exceptions where marginally stable filters are used, but this doesn't apply here. So if you want to invert a given filter, this is only possible if its zeros are inside the unit circle of the complex plane (such filters are called minimum-phase filters). The zeros of the given ...

4

Consider an $D$-tap FIR filter with liner phase, the group delay (measured in samples) is $$g=\frac{D-1}{2}\tag{1}$$ and therefore, if it is measured in seconds it will be $$g=T_s\frac{D-1}{2}\tag{2}$$ where $T_s=1/F_s$. The CIC filter which is also denoted as recursive running sum filter is indeed a special implementation of a moving-average filter. The ...

4

In order to be able to choose an optimal value for the delay $\Delta$ it's important to understand how the system works. The purpose of the delay is to decorrelate the desired signal $s(n)$ and the signal component $s(n-\Delta)$ at the input of the adaptive filter. This means that $\Delta$ must be chosen such that the autocorrelation $R_{ss}(k)$ of $s(n)$ is ...

4

A first order lowpass filter is usually implemented like this: $$p[n] = \alpha p[n-1] + (1-\alpha) pi[n]$$ Where $p[n]$ is your filtered power estimation, $p[n-1]$ is the previous result, $pi[n]$ is your new measurement (probably the product of instantaneous voltage and current measurements), and $\alpha$ is a positive parameter just less than 1. The ...

Only top voted, non community-wiki answers of a minimum length are eligible