category
stringclasses
107 values
title
stringlengths
15
179
question_link
stringlengths
59
147
question_body
stringlengths
53
33.8k
answer_html
stringlengths
0
28.8k
__index_level_0__
int64
0
1.58k
filtering
How to downsample my data readings from 0.5hz to 0.001667hz. Do I filter and downsample?
https://dsp.stackexchange.com/questions/61794/how-to-downsample-my-data-readings-from-0-5hz-to-0-001667hz-do-i-filter-and-dow
<p>I have a device that, in the lab, takes voltage readings every 2 seconds. However in real-life application the device would only wake every 10 minutes and then take a 100 readings whilst awake. How do i change my collected data to mirror real-life application? Only then can I interpret if my device is working as it ...
634
filtering
How to apply an atmospheric attenuation filter in the freq domain and then convert the filtered signal back to the time domain?
https://dsp.stackexchange.com/questions/76023/how-to-apply-an-atmospheric-attenuation-filter-in-the-freq-domain-and-then-conve
<p>This question is a part of a more general question the answer of which I don't know - <em>How to apply a filter in the freq domain and then convert the filtered signal back to the time domain?</em> Well, I partially googled the answer that I need to</p> <ul> <li>convert the signal in FFT</li> <li>multiply by the fil...
<p>FFT has a fixed frequency resolution and I don't recommend to do such a frequency modification with FFT. See more at this <a href="https://dsp.stackexchange.com/questions/6220/why-is-it-a-bad-idea-to-filter-by-zeroing-out-fft-bins">question</a>.</p> <p>You may use <code>Atmosphere.impulse_response</code> to obtain t...
635
filtering
Comparisons of FIR Causal filters of type HRIR in Discrete Time and Frequency Domains
https://dsp.stackexchange.com/questions/56755/comparisons-of-fir-causal-filters-of-type-hrir-in-discrete-time-and-frequency-do
<p>I have just implemented a Discrete Time Convolution between HRIR filter at a range of angles. I also implemented an Overlalp-and-Add method and FFT and IFFT to compute the same convolution in Frequency Domain. The HRIRs are the same measurements which are taken from a public database for both DT and Overlap-And-Add ...
<p><a href="https://i.sstatic.net/L7aJK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/L7aJK.png" alt="HRIR"></a></p> <p><a href="https://i.sstatic.net/VTfxB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VTfxB.png" alt="HRTF"></a> These are the figures of filtering at certain times in ...
636
filtering
Why is the second difference matrix of size n-2 x n in l1 trend filtering?
https://dsp.stackexchange.com/questions/82499/why-is-the-second-difference-matrix-of-size-n-2-x-n-in-l1-trend-filtering
<p>The l1 trend filtering is expressed by taking <span class="math-container">$||Dx||_1$</span> where D is the second difference matrix why is taken of size (n-2)xn rather than circulant matrix of size nxn. I have implemented in both ways but there is not much difference in the results</p>
<p>If you have a periodic signal then you naturally take a circulant matrix. However, in the non-periodic case the values at begin and end of the signal are unrelated, so it makes no sense to consider the wrap-around differences. Thus the convolution with with the filter of length 3 gives <span class="math-container">$...
637
filtering
How are two signals multiplied? And how is it different from convolving two signals?
https://dsp.stackexchange.com/questions/10453/how-are-two-signals-multiplied-and-how-is-it-different-from-convolving-two-sign
<p>Suppose that I have two signals $x[n] = \left\{2,4,1\right\}$ and $p[n] = \left\{5,1,8\right\}$ and I want to multiply them.</p> <ul> <li>How do you do that?</li> <li>How different is it from convolving two signals?</li> </ul> <p>I understand that multiplication in one domain is equal to convolution in other domai...
<p>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:</p> <p>\begin{align} z[n]&amp;=\{2\cdot 5, 4\cdot 1, 1\cdot 8\}\\ &amp;= \{10, 4, 8\}\end{align} </p> <p>Remember that this output is in time do...
638
filtering
low pass filter with minimal ringing
https://dsp.stackexchange.com/questions/23035/low-pass-filter-with-minimal-ringing
<p>I am trying to filter out some square wave signal to within a limited band (1/4 or 1/8 of the original), I realized that there's a lot of ringing in the wave when I use my filter (elliptical), I also tried Butterworth, and others (given in Matlab fir1, and classic iir filters) but the only filter that seems to give ...
<p>Generally the amount of ringing that you get is a function of the steepness of the filter in the frequency domain, regardless of filter type. At the same steepness an Elliptic will require a lower order but will have pretty much the same ringing as a Butterworth. </p> <p>Choosing between a linear phase or minimum ...
639
filtering
Do filters work on a &quot;per sample basis&quot;?
https://dsp.stackexchange.com/questions/32104/do-filters-work-on-a-per-sample-basis
<p>I'm confused because of filter <em>length</em>, whether (such) filters can be used to filter audio on a "per sample basis"?</p> <p>By per sample basis I mean that I would like to filter audio one sample at a time, but vary the filter parameters even one sample at a time.</p> <p>What then confuses me is, can the fi...
<p>Obviously, filters need more than one sample of input – I mean, a single sample is a single number, and how would a single number have something like a frequency? Filtering is something you apply to a digital <em>signal</em>, and <em>signal</em> is defined by being a <em>changing entity</em> – i.e. <em>different sam...
640
filtering
FIR filters: direct form / transposed FIR
https://dsp.stackexchange.com/questions/15412/fir-filters-direct-form-transposed-fir
<p>I am learning about FIR filters and I'm confused. I am trying to find out different types of FIR filters.</p> <ol> <li>Is direct form and n-tap FIR filter the same?</li> <li>What does transposed FIR filter do?</li> </ol>
<p>A finite impulse response (FIR) digital filter implements the following convolution sum</p> <p>$$y(n)=\sum_{n=0}^{N-1}h(k)x(n-k)\tag{1}$$</p> <p>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)$ ar...
641
filtering
Buffering block and filter length in real-time processing
https://dsp.stackexchange.com/questions/43488/buffering-block-and-filter-length-in-real-time-processing
<p>I have a signal sampled at 256 Hz, which I want to filter with a 50 taps long FIR filter in real time. Would it be a problem, if my data block size is only 32 samples? And should I then concatenate 3 blocks, convolve them with the filter and output only the middle part (to avoid discontinuities)?</p> <p>And more g...
<p>Your data block can be as short as 1 sample (although longer is usually more efficient), as long as you save each full convolution response vector to overlap-add/sum into all the following output blocks. Look up overlap-add/save fast convolution see how this can be done using an FFT/IFFT plus some add/save bufferin...
642
filtering
Frequency response of Low pass filter and High pass filter
https://dsp.stackexchange.com/questions/8279/frequency-response-of-low-pass-filter-and-high-pass-filter
<p>The transfer function of a Low pass filter is H(w). From this I want to develop a high Pass filter. I read in <a href="http://books.google.co.in/books/about/Digital_Signal_Processing_Principles_Alg.html?id=CTw6GoBh-vkC" rel="nofollow">DSP by Proakis, Sec 4.5</a>, that the high pass filter can be obtained by translat...
<p>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 Tran...
643
filtering
Notch filtering line noise outside of frequency band of interest
https://dsp.stackexchange.com/questions/22451/notch-filtering-line-noise-outside-of-frequency-band-of-interest
<p>Practically speaking, if one is interested in a frequency band well-separated from the line noise (say, for example, the 10-20 Hz band, with 60 Hz line noise), would it be advisable to notch out this line noise before bandpass filtering to the desired frequency range? It seems that, given of course an acceptable fil...
<p>A general rule of thumb is to filter as little as necessary, because every filter distorts your desired signal, even if just a little bit. Also: a notch filter is advised in a situation where narrow-band interference is present within your signal's band. The notch filter will reject the interference while having min...
644
filtering
What exactly does ordfilt2 do?
https://dsp.stackexchange.com/questions/12582/what-exactly-does-ordfilt2-do
<p>Can you please explain in simple terms what do the input parameters indicate in the <a href="http://www.mathworks.com/help/images/ref/ordfilt2.html" rel="nofollow"><code>ordfilt2</code></a> function in matlab?</p> <pre><code>B=ordfilt2(A,Order,Domain) </code></pre> <p>I have seen people use this function as <code>...
<p>I'm pretty new to this myself, so please correct me if I get this wrong.</p> <p>Using your example, <code>J = ordfilt2(I, 9, true(5))</code>. <code>ordfilt2</code> will move over the 2d array <code>I</code> in blocks of the same size as <code>true(5)</code>. For each of these 5x5 blocks, sort all the elements from ...
645
filtering
How to find the best Q format representation?
https://dsp.stackexchange.com/questions/66815/how-to-find-the-best-q-format-representation
<p>I'm currently working in a project in which I use the coefficients of a IIR Elliptical digital filter (9th order) and the voice signal from a recording of my cellphone but I'm having issues finding the best Q format to work its implemenation, any suggestions? Till now I've been analysing which are the maximum and mi...
<p>You need to calculate the transfer function from your input to each individual state variable.</p> <p>This depends A LOT on how you implement your filter: I strongly recommend splitting it in second order sections and using either Direct Form I or transposed Form II for each section. Section order and pole/zero pai...
646
filtering
What&#39;s the correct way to align two signals downsampled at 10 Hz?
https://dsp.stackexchange.com/questions/76732/whats-the-correct-way-to-align-two-signals-downsampled-at-10-hz
<p>I'm trying to build a dataset where one of the features is a signal which has originally been sampled at 500 Hz, while another feature is a signal which was sampled at 100 Hz. I want to downsample both of them at 10 Hz and then align them (they start at different times).</p> <p>What should I do after low-pass filter...
<p>To align the signals precisely fractional delay all-pass filters are used for time delay correction. This is assuming that the different processing channels each have a different time delay which in many cases won't conveniently be an integer of the final output sample rate. Fractional delay filters are resampling s...
647
filtering
Filter before or after multiplication of two signals?
https://dsp.stackexchange.com/questions/59425/filter-before-or-after-multiplication-of-two-signals
<p>I have two signals and want to multiply them, e.g. voltage and current are multiplied to get power. The result (e.g. power) shall be a filtered result, e.g. to see the average.</p> <p>Is it better to filter (digitally) each signal separately before the multiplication or to filter after the multiplication?</p> <p>...
<p>A personal rule: in general, it can be better to <strong>perform non-linear operations before linear ones</strong>. 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.<...
648
filtering
Is it not possible to perform non-linear filtering in frequency domain?
https://dsp.stackexchange.com/questions/8995/is-it-not-possible-to-perform-non-linear-filtering-in-frequency-domain
<p><a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/filtops.htm" rel="nofollow">This link</a> contains the following statement:</p> <blockquote> <p>In contrast to the frequency domain, it is possible to implement non-linear filters in the spatial domain. In this case, the summations in the convolution function are r...
<p>Linear filters in the spatial domain have a direct equivalent in the frequency domain, so you can transform your data and filter between spatial&lt;->frequency domains and get equivalent results. However the transforms that we use for converting between spatial&lt;->frequency domains are only valid for <em>linear sy...
649
filtering
How to use Kalman filter for altitude prediction based on barometer data?
https://dsp.stackexchange.com/questions/48911/how-to-use-kalman-filter-for-altitude-prediction-based-on-barometer-data
<p>I have barometer noisy data with known variance.<br /> I studied Kalman filter but I did not find an answer to this problem:<br /> My process model is: altitude is changed because of velocity that is changed because of acceleration that is normally distributed.</p> <p><span class="math-container">$$ s[k+1]=s[k]+v[k]...
<p>You might get good results when you consider the acceleration as an input $u$, so <a href="https://en.wikipedia.org/wiki/Kalman_filter#Underlying_dynamical_system_model" rel="nofollow noreferrer">the model</a> could then be written as</p> <p>$$ x[k+1] = \begin{bmatrix} 1 &amp; \Delta t \\ 0 &amp; 1 \end{bmatrix} x...
650
filtering
What is the necessity of shifting the impulse response of a filter to the front of the time domain buffer and windowing?
https://dsp.stackexchange.com/questions/88074/what-is-the-necessity-of-shifting-the-impulse-response-of-a-filter-to-the-front
<p>I was reading the answer to <a href="https://dsp.stackexchange.com/questions/46671/decimation-and-filtering-in-the-frequency-domain">this question</a> provided by Phil Karn.</p> <p>In the answer, it has been said:</p> <blockquote> <p>Ensure that the impulse response of your lowpass filter is shifted to the front of ...
<p>Well, as mentioned by the original answer, &quot;I assume you already know the basic rules for fast convolution: the FFT length N is equal to the data blocksize L plus the length of the filter impulse response M minus 1. Each operation uses L samples of new data plus M-1 samples of data from the old block.&quot;</p>...
651
filtering
How to perform a gaussian blur using FFT?
https://dsp.stackexchange.com/questions/44098/how-to-perform-a-gaussian-blur-using-fft
<p>I am trying to implement a gaussian filter with matlab.Here is my implementation: So far All I get as output is a black image. Any hints?</p> <pre><code>clear all; close all; I = double(imread('Put your path here'))/255; I=rgb2gray(I); sigma=1; [M,N,s]=size(I); f1=-fix(M/2):ceil(M/2)-1; f2=-fix(N/2):ceil(N/2)-1; [...
<p>Here is the working code,</p> <pre><code>clear all; close all; clc; I = double(imread('Cameraman.tif'))/255; % Divide only if image value in [0-255] range figure,imshow(I);title('Cameraman original') %I=rgb2gray(I); % NOTE: This is only for RGB images, commented otherwise sigma=3; [M,N,s]=size(I); f1=-fix(M/2):ce...
652
filtering
Upsampling of a signal
https://dsp.stackexchange.com/questions/89492/upsampling-of-a-signal
<p>A low-passed signal, bandwidth limited to 4KHz is originally sampled 10 KHz. If I want to resample it at 20 KHz, I take these steps. Are these correct? Am I missing an step?</p> <ol> <li><p>First we need to filter the signal. Since the bandwidth is limited to 4KHz, we need a LPF with cutoff freq. of 4KHz.</p> </li>...
<blockquote> <p>First we need to filter the signal. Since the bandwidth is limited to 4KHz, we need a LPF with cutoff freq. of 4KHz.</p> </blockquote> <p>If the signal is already bandlimited, there is no need for this filter.</p> <blockquote> <p>Now we need to upsample it at 20KHz. We do this by simply inserting zeros ...
653
filtering
What is zero-phase filtering and forward-backward filtering?
https://dsp.stackexchange.com/questions/54047/what-is-zero-phase-filtering-and-forward-backward-filtering
<p>I am pretty familiar with IIR and FIR filtering and I have implemented them in my several projects. However, recently i found something called zero phase filtering. I have tried to understand it but not going well. All i know is that zero phase filtering is filtering that do not produce any phase delay and distortio...
<p>Zero-phase filtering is a non-causal procedure, so it cannot be done in real time, only offline for IIR filters or pseudo real-time, i.e., with a sufficient delay for FIR filters. A zero-phase filter needs to have a purely real-valued frequency response, and, consequently, it must have an impulse response that is ev...
654
filtering
Constraint on a filter
https://dsp.stackexchange.com/questions/10513/constraint-on-a-filter
<p>First of all thanks for your patience: it is the first time for me posting a question in this forum. I am not a DSP expert, but I should get by if you give me in depth explanation.</p> <p>This is an example of my raw data </p> <p><img src="https://i.sstatic.net/lqtUx.png" alt="enter image description here"></p> <...
<p>Beware. A Gaussian random walk has a non-zero distribution width that increases with time. Thus the double integral of that random walk will likely very quickly zoom off the edge of your solution space. A linear filtering of that random walk won't behave any better. Whether or not mixed with the "real" accelerat...
655
filtering
Can somebody help me solve this signal accumulation problem?
https://dsp.stackexchange.com/questions/10995/can-somebody-help-me-solve-this-signal-accumulation-problem
<p>Investigation of the method of suppression of random noise by coherent signal accumulation</p> <p>Purpose - to identify opportunities for the coherent accumulation for cases of stationary and quasi-stationary signal. Suppose that the input is the mixture of observed signal and a random white noise (i.e. noise with ...
656
filtering
Detecting &amp; Removing steps in signal
https://dsp.stackexchange.com/questions/12672/detecting-removing-steps-in-signal
<p>Given the signal shown below, what is the best way to remove the steps and local maximas it contains. The signal contains some steps which can last up to 100 Samples before they return to about the same value as before the step (Marked with red circles). There are also some peaks which last only for one sample which...
<p>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.</p> <p>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 3...
657
filtering
Role of the rank of the filter mask matrix in image processing?
https://dsp.stackexchange.com/questions/15850/role-of-the-rank-of-the-filter-mask-matrix-in-image-processing
<p>I'm reading a material where it says that a filter mask or kernel can be separable if the matrix of the filter mask has a rank 1. The two slides which describes this are as below:<img src="https://i.sstatic.net/vAIiA.png" alt="enter image description here"></p> <p><img src="https://i.sstatic.net/Lv2AJ.png" alt="ent...
<p>Separable just means you can do it in the x-direction and then in the y-direction and have it come out the same as if you did it in both dimensions simultaneously to begin with. It's not too hard to see that this will work for an average filter. If the filter is averaging over a 3x3 grid then in the 2-d case you tak...
658
filtering
Removing transients in highpass filtering with MATLAB
https://dsp.stackexchange.com/questions/16869/removing-transients-in-highpass-filtering-with-matlab
<p>I've made a simple first order IIR highpass filter with a zero at z = 1 and a pole at z = 0.9. Its frequency response looks like this:</p> <p><img src="https://i.sstatic.net/bDtTx.png" alt="enter image description here" /></p> <p>Now, I filter a DC signal using this filter. Here's the MATLAB code I use to do it:</p>...
<p>Your first order filter recursion for some real constants $a,b,c$ is </p> <p>$$ y[n] = a x[n] + b x[n-1] - c y[n-1] $$</p> <p>with the two initial memory states $x[-1]$ and $y[-1]$ at $n=0$. </p> <p>Your "no transient" condition can be translated to $y[0]=0$ and a necessary second condition so that you can solve ...
659
filtering
Texture-like measures for quantifying density of data in binary images
https://dsp.stackexchange.com/questions/24295/texture-like-measures-for-quantifying-density-of-data-in-binary-images
<p>Consider the following black-and-white image. It depicts a freehand sketch.</p> <p><img src="https://i.sstatic.net/TMV3q.png" alt="enter image description here"></p> <p>I wish to characterize the "density" of sketch strokes. For e.g. the hair strokes are densely grouped together. So are strokes near the wrists and...
<p>I ended up using the <a href="http://in.mathworks.com/help/images/ref/radon.html" rel="nofollow">radon transform</a> in 8 canonical directions. I then normalized the resulting distribution and computed its entropy. The numbers seem to correlate with level of texture in the image.</p>
660
filtering
Derive velocity and acceleration from position
https://dsp.stackexchange.com/questions/26248/derive-velocity-and-acceleration-from-position
<p>I generate random spike data that represent the ouput from a rotary encoder. Here the output of my algorithm: <a href="https://i.sstatic.net/lJIYf.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lJIYf.jpg" alt="enter image description here"></a> The first plot is position, then velocity and then accel...
<p>There are several ways to calculate the derivative of a stochastic signal. I will show you two methods.</p> <p>First of all, adjust the output of a second order transfer function to your data: $${\omega_n^2}/({s^2+2\zeta\omega_n s+\omega_n^2})$$ Once you are satisfied with the fit, put an additional $s$ in the nume...
661
filtering
How do I smooth-over transition from a time-series generated by one system to a time-series generated by another system?
https://dsp.stackexchange.com/questions/33805/how-do-i-smooth-over-transition-from-a-time-series-generated-by-one-system-to-a
<p>So I have generated a time-series with length on 2N samples, where the first N are generated by one auto-regressive system and the N+1 to 2N are generated by another, similar, auto-regressive system. </p> <p>Here's a picture of the transition itself:<br> <a href="https://i.sstatic.net/KrqYc.png" rel="nofollow noref...
662
filtering
Smoothing a staircase
https://dsp.stackexchange.com/questions/33821/smoothing-a-staircase
<p>I have some data from a position encoder, so naturally i want to estimate its speed. However, the data is very quantized, so it's difficult to smooth enough to differentiate easily: </p> <p><img src="https://i.sstatic.net/eMRcm.png" alt="data"></p> <p>Each step level is about 70-140 data points long on average, s...
<p>Looks like your data is virtually free of noise. That, combined with a very high sampling frequency would mean that at the jumps the data is exactly at the threshold between two quantized values. Set up nodes at the middle points of the vertical jumps and construct splines that connect the nodes. The easiest is to j...
663
filtering
Wiener filter to estimate constant signal
https://dsp.stackexchange.com/questions/34707/wiener-filter-to-estimate-constant-signal
<p>I want to compare the performance of a Wiener Filter and the Kalman filer to estimate the value of a constant $d$ using mesurements corrupted by a white noise. That is, my measurements are of the form $$x(n) = d + v(n)$$ where $v(n)$ have a normal distribution with mean $0$ and known variance $\sigma^2$. </p> <p>Us...
<p>You can use this code</p> <pre><code> function w=WienerFIRFilter(input,desired,M) auto_corr=xcorr(input,M,'unbiased'); r=auto_corr(M+1:end); % positive lags only R=toeplitz(r); %correlation matrix cross_corr=xcorr(input,desired,M,'unbiased'); p=(cross_corr(M+1:end)); w=inv(R)*p' end ...
664
filtering
Extracting narrow-band ZigBee signals(4 MHz) from a wide-band WiFi signal(20 MHz)?
https://dsp.stackexchange.com/questions/37016/extracting-narrow-band-zigbee-signals4-mhz-from-a-wide-band-wifi-signal20-mhz
<p>I am planning the following.</p> <p>First sample the 20 MHz WiFi channel (WiFi channel-1 in figure).</p> <p>Put band pass filters (5 MHz wide) around each of the ZigBee center frequencies (11, 12, 13, 14).</p> <p>Re-sample the chunks to 4 MHz.</p> <p>Is there anything wrong with this approach ?</p> <p><a href="...
<blockquote> <p>Put band pass filters (5 MHz wide) … Re-sample the chunks to 4 MHz.</p> </blockquote> <p>Don't do that! If you reduce the sampling rate to 4 MS/s, you need to filter to 4 MHz bandwidth anyway. So you could instead just use 4 MHz wide filters and get rid of the resampling filter.</p>
665
filtering
Analytical expression for step response of digital bessel filter
https://dsp.stackexchange.com/questions/37301/analytical-expression-for-step-response-of-digital-bessel-filter
<p>If I apply a digital Bessel filter to a perfect step function, I get something that looks like the following:</p> <p><a href="https://i.sstatic.net/iMDYj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iMDYj.png" alt="enter image description here"></a></p> <p>The green line is the input step respons...
<p>Yes, there is an analytical response, though it might not look like you would like to have it:</p> <p>Your Bessel Filter can be written in Z-Domain as </p> <p>$$H(z)=K\frac{\prod_{i=0}^7(z-z_i)}{\prod_{i=0}^7(z-p_i)}$$</p> <p>where $z_i$ are the zeros and $p_i$ are the poles of the z-Transform. Now, to get the st...
666
filtering
Filter Implementation
https://dsp.stackexchange.com/questions/43143/filter-implementation
<p>I am rather new to the world of signal processing, and am struggling to understand a fundamental concept: How are filters actually implemented?</p> <p>I have read a significant portion of <a href="http://www.dspguide.com/" rel="nofollow noreferrer" title="DSP for Scientists and Engineers">this online book</a>, and ...
<p>There are a few different ways to proceed. They involve doing some algebra but it is more an issue of tedium. The notation of your analog filters is a little non standard, essentially your $p$ is $s$ in most books. </p> <p>Traditionally, phase wasn't considered important in hearing so standards tended to be specifi...
667
filtering
Real time FFT &amp; IFFT with low pass filter
https://dsp.stackexchange.com/questions/59678/real-time-fft-ifft-with-low-pass-filter
<p>I am processing the signal from MPU6050. Applying FIR filter in the frequency domain and then taking IFFT to get filtered signal but getting some spikes in the output signal. Searched a lot about it and found here exit spectral leakage. Found some solutions like zero paddings and windowing but nothing is working. Ca...
<p>The sharp peaks are actually due to segmentation and concatenation, you need to have overlapping segmentations. The peaks occur on the edges of segments mostly. In following figures I tried to show what I mean, blue curve are Hanning function coefficients. I did not understood why your application is so, but if it i...
668
filtering
Help identifying filter
https://dsp.stackexchange.com/questions/75095/help-identifying-filter
<p>Apologies in advance for asking something so basic, this is not my field at all so I'm a bit lost where else to find this info. I'm trying to understand this piece of code that detects sudden drops in a signal, it goes something like this:</p> <pre><code>filter = [ones(1,10)*-0.05 ones(1,10)*0.05]; filterResponse =...
<p>This is a moving difference filter which acts as a discrete time derivative and is less sensitive to high frequency noise. When all the samples in the waveform are the same (DC) the last ten samples will cancel out the first 10 samples for DC cancellation but when a change occurs within a 10 sample interval compared...
669
filtering
Detrending PPG signal
https://dsp.stackexchange.com/questions/76067/detrending-ppg-signal
<p>I'm filtering a raw PPG signal sampled at 100sps</p> <p>After applying a bandpass filter my signal looks like this <a href="https://i.sstatic.net/C25nN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/C25nN.png" alt="PPG with trend" /></a></p> <p>As you can see, It has a trend (a low pass component whi...
<p>I assume you want to remove the trend which behaves like that:</p> <p><a href="https://i.sstatic.net/pnkx7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pnkx7.png" alt="enter image description here" /></a></p> <p>Probably some kind of a parametric model will do the work.<br /> Something as simple as...
670
filtering
A filter removing forbidden information in the stop-band
https://dsp.stackexchange.com/questions/77018/a-filter-removing-forbidden-information-in-the-stop-band
<p>Is it possible, and how could it be done, to make an extension of filters that converts the signal in the filter's stop-band into noise with no information content or at least with zero correlation to the input signal in that frequency range, with only an arbitrarily small degradation of the signal in the pass-band?...
<p>Well, the naive approach would of course be using the complementary of your band-pass filter (letting through the allowed information) as band-stop filter, and use that to shape uncorrelated noise to be where the stop-band of the original filter is. Then, add both.</p> <p>If you don't want to do that, for example be...
671
filtering
Method for splitting time-sampled signal into two signals
https://dsp.stackexchange.com/questions/85536/method-for-splitting-time-sampled-signal-into-two-signals
<p>Update: the yellow area in the graph below can be ignored, it shows power produced. I'm only interested in the blue line, and how to separate power consumed by the heating system from the rest.</p> <p>I have data for a signal (blue line) showing overall power consumption. The spikes come from a heating system. The i...
<blockquote> <p>Are there any methods to achieve this?</p> </blockquote> <p>Not without some additional information. You may be able to partially separate this by carefully studying the spikes from the heating system. Many heating systems are binary: they are either on or off and during the &quot;on state&quot; the pow...
672
filtering
Other techniques like overlap save/overlap add
https://dsp.stackexchange.com/questions/8771/other-techniques-like-overlap-save-overlap-add
<p>I know overlap save and overlap add are used for long data sequence filtering. Are there any other similar or better techniques like these? </p>
<p>The main alternative that I can think of is the hybrid method proposed by <a href="http://alumni.media.mit.edu/~billg/projects.html#conv" rel="nofollow">Bill Gardner</a> and <a href="http://www.freepatentsonline.com/6421697.html" rel="nofollow">patented by Lake DSP</a> (now part of Dolby). <a href="http://www.cs.ust...
673
filtering
Anisotropic Diffusion Filter - Intuition Behind Parameters
https://dsp.stackexchange.com/questions/14658/anisotropic-diffusion-filter-intuition-behind-parameters
<p>I need to know what is iteration and divergence in anisotropic diffusion filter technique.</p> <blockquote> <ul> <li><p><strong>Isotropic diffusion</strong> $$\frac{\partial I(x, y, z)}{\partial t}={\rm div}\left[c\cdot \nabla I\left(x, y, z\right)\right], \quad \text{where } c \text{ is the diffusion coefficie...
<p>This paper - <a href="https://www.scribd.com/document/406513369/The-Structure-of-Images" rel="nofollow noreferrer">The Structure of Images</a> describes quite nicely to get to the diffusion equations from the point of view of a filter. It's about the isotropic case, but anisotropic is really just an extension of tha...
674
filtering
Filtering Frequency Bands Out of a Signal
https://dsp.stackexchange.com/questions/28965/filtering-frequency-bands-out-of-a-signal
<p>Let's say I have a 2 second data set taken at 220Hz sample rate and I would like to filter out the frequency bands associated with the EEG Spectrum: $$\begin{align} \Delta:&amp; [1,3]\text{ Hz}\\ \theta:&amp; [4,7]\text{ Hz}\\ \alpha_1:&amp; [8,9]\text{ Hz}\\ \alpha_2:&amp; [10,12]\text{ Hz}\\ \beta_1:&amp; [13,17]\...
<blockquote> <p>What would be the most simple approach to do this ?</p> </blockquote> <p>I'm a GNU Radio person. So the simplest approach was this GNU Radio companion-designed flowgraph:</p> <p><a href="https://i.sstatic.net/LFQ7o.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LFQ7o.png" alt="Bandpass f...
675
filtering
A question about sampling theory
https://dsp.stackexchange.com/questions/29880/a-question-about-sampling-theory
<p>Let`s say I have a signal </p> <p>$m(t)=\cos(4\pi t) + \cos(6\pi t)$</p> <p>so we can say the signal is containing frequencies $f_1= 2\mathrm{Hz}$ and $f_2= 3\mathrm{Hz}$. The cut-off frequency of the low pass filter is equal to $f_c= 3.5\mathrm{Hz}$, and the sampling frequency is $5\mathrm{Hz}$.</p> <p>Is there ...
<p>Given two signals $x_1(t) = \cos(2\pi 2t)$ and $x_2(t) = \cos(2\pi 3t)$ which have frequencies of 2 and 3 Hz respectiveley, if you sample them uniformly with a sampling rate of 5 samples per second (or a sampling period $T$ of $\frac {1}{5}$ = 0.2 seconds) you will get the following two discrete time signals $$x_1[n...
676
filtering
Using the Dirichlet kernel as a lowpass filter
https://dsp.stackexchange.com/questions/93959/using-the-dirichlet-kernel-as-a-lowpass-filter
<p>I have a question about using the Dirichlet kernel as a filter. Let us suppose that I have samples of a continuous function sampled with frequency <span class="math-container">$F_s=10 \,\texttt{Hz}$</span>. The function is band-limited and the sampling frequency is well above the Nyquist frequency, but there is nois...
<p>The Dirichlet Kernel is a &quot;Time Aliased Sinc Function&quot;, and using it as the coefficients for the low pass filter avoids truncation issues we would see as the OP describes correctly with the truncated Sinc function, but leads to greater distortion in the frequency domain for the frequency response correspon...
677
filtering
Sample rate of digital modems--how do they do digital filtering if sampling below Nyquist rate?
https://dsp.stackexchange.com/questions/93664/sample-rate-of-digital-modems-how-do-they-do-digital-filtering-if-sampling-belo
<p>I can't find this answer anywhere. I have a couple satellite modem manuals and they refer to digital filtering functions that they do, but they say almost nothing about their sample rate. I always thought, without considering it too much, that all the modems I've worked with were only sampling at a rate high enoug...
<p>All modems sample at higher than the symbol rate up until timing recovery is resolved, at which point the received waveform can de down-sampled to 1 sample per symbol.</p> <p>As for a digital IF: digital IF means the waveform is centered on some higher frequency, higher than its occupied bandwidth, and can be repres...
678
filtering
How to apply two FIR filters in sequence with a single overlap-save FFT step?
https://dsp.stackexchange.com/questions/96583/how-to-apply-two-fir-filters-in-sequence-with-a-single-overlap-save-fft-step
<p>I'm trying to convolve an input signal <span class="math-container">$x[n]$</span> with two FIR filters <span class="math-container">$h_1[n]$</span> and <span class="math-container">$h_2[n]$</span> in sequence, using block-based overlap-save FFT processing. I want my output to be: <span class="math-container">$$ y[n]...
<p>Convolution it commutative, i.e. <span class="math-container">$$ y[n]=(x[n]*h_1[n]) * h_2[n] = x[n]*(h_1[n]*h_2[n]) $$</span></p> <p>Hence you only need to convolve the two impulse responses once and then implement a single overlap-save with the resulting IR.</p> <p><span class="math-container">$$h_3[n] = h_1[n]*h_...
679
filtering
Savitzky-Golay filtering (not smoothing) in real time
https://dsp.stackexchange.com/questions/83038/savitzky-golay-filtering-not-smoothing-in-real-time
<p>I would like to filter some data in an online sense i.e.</p> <p><span class="math-container">$$y(t) = a0 + a1*y(t-1) + a2*y(t-2) + ... $$</span></p> <p>the order not important.</p> <p>My understanding of the SG is that it is really a smoother - I have to take some point and use points around it, in this case I would...
<p>I found the answer from playing around. They are easily computed with <code>scipy.savgol_coeffs</code> e.g.</p> <pre><code>In [0]: signal.savgol_coeffs(7, 1, pos=0, use='dot') Out[1]: array([ 0.46428571, 0.35714286, 0.25 , 0.14285714, 0.03571429, -0.07142857, -0.17857143]) </code></pre> <p>Matches th...
680
filtering
Savitzky golay with missing observations
https://dsp.stackexchange.com/questions/95291/savitzky-golay-with-missing-observations
<p>Has anyone attempted to use savitzky-golay filters in conjunction with interpolation of missing observations? It seems very logical to do so, but I was wondering if there are any good reasons for not doing it since my search has yielded no results.</p>
<p>Savitzky-Golay filters, based on polynomial models, lend themselves well to non-uniform or lacunary sampling, one way of treating missing observations. However, they will likely become more expensive with irregularities. Hints can be found in post <a href="https://dsp.stackexchange.com/q/1676/15892">Savitzky-Golay ...
681
filtering
How does filter works in noise reduction?
https://dsp.stackexchange.com/questions/69055/how-does-filter-works-in-noise-reduction
<p>On <a href="http://www.cs.toronto.edu/%7Efidler/slides/2019/CSC420/lecture2.pdf" rel="nofollow noreferrer">page 22 of the slide</a>, the 1D array is [1, 1, 1, 1, 1], but the dots are uneven. Then why their values are the same? What's the value of the point that the arrow is pointing at? Though it gives Moving averag...
<p>The illustration is showing your data (labelled as &quot;original&quot;) and the result of convolving your moving average filter with your data (labelled as &quot;smoothed&quot;). The filter/kernel is [1 1 1 1 1]/5 and gives each of the five samples equal weight. Effectively, it takes the average of the five samples...
682
filtering
DSP signal filtering and number formats
https://dsp.stackexchange.com/questions/72661/dsp-signal-filtering-and-number-formats
<p>I'm working on a dsPIC33, using Audio Codec Board - Proto to read audio samples and for reproduction.</p> <p>In order to implement a relatively simple signal processing algorithm, I'm reading audio samples and I'm supposed to process them and pass them to DAC for reproduction.</p> <p>The dsPIC33 I'm using filters th...
<blockquote> <p>I suppose that conversions from signed 2's complement to Q15 and vice versa are necessary.</p> </blockquote> <p>Yes &amp; No. Q15 (signed) uses 2's complement, the bits are the same so no conversion is necessary. The difference between a Q15 and Q0 aren't the bit them selves but your interpretation of ...
683
filtering
How to apply convolution on a buffer
https://dsp.stackexchange.com/questions/8380/how-to-apply-convolution-on-a-buffer
<p>I'm trying to do some simple filtering for an audio signal using a window-sinc low pass filter. Supposing that my buffer has M values and the filter kernel size is N, after convolving these two arrays I would obtain an output of m+n-1 values. Which part should I take into consideration? I'm asking this because, if I...
<ul> <li>Output the first M samples of your convolution result</li> <li>Keep the remaining samples and ADD those to the result next buffer</li> </ul> <p>Google "overlap add" for more information. While overlap add is a frequency domain method, it explains the framing and buffer handling well.</p>
684
filtering
Why is successive decomposition of a signal performed only on low pass component?
https://dsp.stackexchange.com/questions/18850/why-is-successive-decomposition-of-a-signal-performed-only-on-low-pass-component
<p>The question says it all. In typical (wavelet-like) decomposition of a signal, why is only the low pass component chosen for successive decomposition ?</p>
<p>Wavelets decomposition separates out the details/fluctuations/high-pass information from the image or signal. At each step details are separated out from the remaining of the signal. The processing is therefore only applied on the coarse part not the part that already has the details. </p>
685
filtering
amplitude compensation after filtering and mixing audio
https://dsp.stackexchange.com/questions/23419/amplitude-compensation-after-filtering-and-mixing-audio
<p>I am working on a mixer which lets me mix dry and wet signal in a user defined ratio. Wet signal is basically just the all pass filtered signal. The mixing takes place in frequency domain and so does the filtering. So the requirement here is, after mixing I have to compensate for amplitude loss, i.e. the output sign...
686
filtering
Median Filter for salt and pepper noise removal
https://dsp.stackexchange.com/questions/27147/median-filter-for-salt-and-pepper-noise-removal
<p>Why median filter is considered as good for removal of salt and pepper noise? What are the other filters used for the same?</p>
<p>Median filter is considered good because unlike averaging filter which ruins the edges of an image by blurring it to remove the noise, median filter removes only the noise without disturbing the edges.</p> <p>Well, median filter is the best and only filter to remove salt and pepper noise.</p> <p>Hope this helps:)<...
687
filtering
Pulse shaping and Baseband filtering
https://dsp.stackexchange.com/questions/28087/pulse-shaping-and-baseband-filtering
<p>I'm slightly confused about baseband pulse shaping. Let's assume I have a complex data vector in an arbitrary complex constellation (QAM for example). I would like to pass this complex vector through a pulse shaping filter (RRC or RC).</p> <p>As far as I know RC/RRC filters have a real impulse response, thus I can ...
<p>Your complex baseband signal before modulation is given by</p> <p>$$s(t)=\sum_{m=-\infty}^{\infty}a_mh(t-mT)\tag{1}$$</p> <p>where $a_m$ are the complex symbols, $h(t)$ is the impulse response of the transmit filter, and $T$ is the symbol period. As you correctly assumed, $h(t)$ is usually real-valued, so you need...
688
filtering
Filtering noise from FFT, where noise is known to be shifted delta function
https://dsp.stackexchange.com/questions/28230/filtering-noise-from-fft-where-noise-is-known-to-be-shifted-delta-function
<p>I have an input sequence $x=\{x_1, x_2 , ... x_n\}$ of reals, where $n=2^m$ for some $m$. I wish to calculate FFT of $x$.</p> <p>$X=FFT(x)$</p> <p>However, before I calculate the FFT, the signal $x$ gets corrupted with noise $\eta$, so $\hat{x}=x+\eta$, and calculated FFT, $\hat{X}$ is FFT of $\hat{x}$, rather th...
<p>High-pass filter the input with a zero-phase filter to eliminate the signal of interest, leaving only the high-passed noise. If the signal is periodic, you can do this in the frequency domain and convert back to time domain by IFFT. Find the time of the peak and deduce the magnitude of the unfiltered delta function ...
689
filtering
Filtering for Wright-Fisher HMM
https://dsp.stackexchange.com/questions/41578/filtering-for-wright-fisher-hmm
<p>I am trying to understand what filter may be suitable for the following HMM:</p> <p>The signal is a Wright-Fisher one-dimensional diffusion characterised by the SDE</p> <p>$$dX_{t}=\frac{1}{2}\left(\alpha(1-x)-\beta x\right)dt+\sqrt{X_{t}(1-X_{t})}dB_{t}$$</p> <p>with unknown parameters $\alpha$ and $\beta$. This...
690
filtering
How to eliminate negative frequencies from IQ signal
https://dsp.stackexchange.com/questions/46301/how-to-eliminate-negative-frequencies-from-iq-signal
<p>I have a 192kHz IQ signal from an RF receiver, and i'm trying to remove signals in the negative (or positive) frequency spectrum.</p> <p>I see that the negative frequency signals are -90 degrees phase shifted from I, where positive frequencies have the usual +90 degrees shift I vs Q.</p> <p>Here's the problem:</p>...
<p>I managed to do this now by having a 3 step process after converting the I/Q data to complex numbers. This is far from me understanding what i'm doing, but it's eliminating negative frequencies.</p> <ol> <li><p>I shift the the frequencies by multiplying each i/q sample with the complex output of an oscillator at fr...
691
filtering
Implementing FIR/IIR &quot;alike&quot; filter in R
https://dsp.stackexchange.com/questions/49105/implementing-fir-iir-alike-filter-in-r
<p>I am new to signal processing. I am trying to simulate something similar to IIR/FIR filter with $k$ delays to imitate acoustic echo reflection. The difference equations for FIR and IIR respectively are as follows:</p> <p>\begin{equation} y(n) = x(n) + \sum_{D=1}^kA(n)x(n-D)+v(n)\;\;\;\;\; (1) \end{equation} \begin{...
<p>The function <code>filter()</code> in the <code>signal</code> package does exactly what you are asking for. Note that, by default, it uses <a href="https://en.wikibooks.org/wiki/Signal_Processing/Digital_Filters#ARMA_Filters" rel="nofollow noreferrer">ARMA filters</a> (a combination of AR and MA). Thanks to that, yo...
692
filtering
How to filter a sequence of frames?
https://dsp.stackexchange.com/questions/49155/how-to-filter-a-sequence-of-frames
<p>I'm have a sequence of 2-dimensional MxN frames. I have concatenated these frames to form a 3-dimensional MxNxT matrix. Now i want to filter this 3D volume by 2 types of filters (a 2D log-Gabor in xy-direction, and a 1D gaussian in z-direction).</p> <p>Here is my MATLAB implementation:</p> <pre><code>[yGrid,xGrid...
693
filtering
ARMA &amp; MA methods: how do you know the error terms?
https://dsp.stackexchange.com/questions/52563/arma-ma-methods-how-do-you-know-the-error-terms
<p>Reading the ARMA model for the first time, and I'm confused.</p> <p>Let's say I have a time series</p> <pre><code>x = [1, 2.1, 2.9, 3, 4.1] </code></pre> <p>According to the ARMA model, <span class="math-container">$X_t$</span> is a linear combination of previous values and errors, something like</p> <p><span cl...
<p>In the context of discrete-time statistical signal processing, an ARMA-(p,q) random process is defined as (assuming zero initial conditions)</p> <p><span class="math-container">$$ \sum_{k=0}^p a_k ~ x[n-k] = \sum_{k=0}^q b_k ~ v[n-k] $$</span> </p> <p>or equivalently</p> <p><span class="math-container">$$ x[n] =...
694
filtering
Applying a filter on an input sequence in matlab
https://dsp.stackexchange.com/questions/55106/applying-a-filter-on-an-input-sequence-in-matlab
<p>Given a input sequence <span class="math-container">$x = {x_1, ... x_n}$</span> and a filter with l elements <span class="math-container">$h = [h_1, ..., h_l]$</span> with l &lt; n. We want to filter the input sequence with the specified filter. </p> <p>My first thought was to compute the convolution between <span ...
695
filtering
Noise Reduction: How can I filter out saw or other tool noises?
https://dsp.stackexchange.com/questions/55828/noise-reduction-how-can-i-filter-out-saw-or-other-tool-noises
<p>I recently came across old recording from the 1930's. Unfortunately not only is the quality low, it's a bunch of carpenters talking as they saw things and make all sorts of other noises. </p> <p>I've tried:</p> <ul> <li>Various filters </li> <li>Audacity's native Noise Reducer</li> </ul> <p>and yet no luck, I fin...
696
filtering
What is used to initialise difference equations that require data from the output?
https://dsp.stackexchange.com/questions/56084/what-is-used-to-initialise-difference-equations-that-require-data-from-the-outpu
<p>Given some difference equation for a filter like </p> <p><span class="math-container">$y[k] = ax[k] + bx[k-1]+ cy[k-1]$</span>, </p> <p>how would you initialize it? Since it needs an old output value (feedback) to calculate the new output value, it seems like the equation will keep on chasing its own tail. I would...
<p>If there is no good reason to choose otherwise, you would initialize with zeros, so in your case <span class="math-container">$y[-1]=0$</span>. Other initializations may be useful in certain situations, e.g., when processing blocks of data to avoid transients between blocks.</p> <p>Note that if the filter is stable...
697
filtering
how does the Frequency spectrum of a signal change in the logarithmic space?
https://dsp.stackexchange.com/questions/58781/how-does-the-frequency-spectrum-of-a-signal-change-in-the-logarithmic-space
<p>I am trying to implement basic homomorphic filtering but I can't seem to understand what happens in the frequency domain when you take the natural logarithm of the function.</p> <p>In Matlab I'm getting not a number or infinity everywhere. </p>
<p>Plus is the simplest operation : <span class="math-container">$z = x+y$</span>. Fourier is inherently linear, and good at addressing it. However, most processes and data combination are nonlinear, and they should be dealt with. The second simplest operation is <strong>multiplication</strong>. Homomorphic filtering d...
698
filtering
Meaningful output of FIR filter output
https://dsp.stackexchange.com/questions/62337/meaningful-output-of-fir-filter-output
<p>I have implemented FIR filter using tapped delay line method. I start getting output as soon as first input sample is passed to it, I am wondering from which sample I will get the proper output(without transient outputs) from filter.</p> <p>Does it depend on location of highest magnitude tap or it's just dependent ...
<p>If it's a <strong>linear phase</strong> FIR filter, then the inputs signals will be shifted (delayed) by an amount of <strong>group delay</strong> at the output.</p> <p>For a linear phase FIR filter of length <span class="math-container">$L = 2K+1$</span> the group delay will be <span class="math-container">$N = K$...
699
digital filter
Digital filter: selection
https://dsp.stackexchange.com/questions/42146/digital-filter-selection
<p>I am going through digital filter design. But I really get confused with so many </p> <ol> <li><p><strong>Digital filters</strong> : </p> <ul> <li>IIR </li> <li>FIR </li> <li>Moving Average</li> <li>Linear phase filter</li> <li>Allpass filter</li> <li>Comb filter </li> </ul></li> <li><p><strong>Analog filter:<...
700
digital filter
Digital Filters
https://dsp.stackexchange.com/questions/74874/digital-filters
<p>If I want to remove the baseline drift in my ECG signal, which digital filter should be used without distortion and shift in my filtered output? What are the necessary things I have to look for the proper type of filters (like Chebyshev, Butterworth filter, etc)?</p>
<p>The easiest approach would be use a high pass FIR filter, mostly because it has a linear phase shift (constant group delay). Chebyshev, Butterworth are IIR type filters so their phase response is nonlinear (mostly) and may change the output.</p> <p>Also one can considered using wavelet decomposition to eliminate low...
701
digital filter
Digital filter selection for sensor
https://dsp.stackexchange.com/questions/42230/digital-filter-selection-for-sensor
<p>I am having a LM35 sensor which gives $10\textrm{ mV}$ signal per degree rise of temperature. Now I have one question, which digital filter will be the best for this ?</p> <p>This sensor will be use in very noisy industrial environment. Also digital filter have some cutoff frequency what should be the cutoff freque...
<p>It depends a lot on the kind of noise and how fast you need the sensor to track the true temperature, and how fast you need to read the temp.</p> <p>If you expect large outliers, a median filter is robust to those kinds of perturbations and they can have a relatively short effective window, and a corresponding fast...
702
digital filter
Real digital filter property
https://dsp.stackexchange.com/questions/29659/real-digital-filter-property
<p>I am a beginner to study about the filter notion and property</p> <p>Being a real digital filter, (here "real filter" I means that its impulse response is real-valued)</p> <p>this formula is established. But I have no idea how to prove it</p> <p>$$ |H(\pi +w )|=|H(\pi -w)|$$</p> <p>What should be $H(w)$ or $|H...
<p><strong>HINT:</strong></p> <p>From the definition of the DTFT</p> <p>$$H(\omega)=\sum_{n=-\infty}^{\infty}h[n]e^{-jn\omega}\tag{1}$$</p> <p>derive the following facts:</p> <ol> <li>$H(\omega)=H(\omega+2\pi)$</li> <li>$H(\omega)=H^*(-\omega)$ for real-valued $h[n]$</li> </ol> <p>where $*$ means complex conjugati...
703
digital filter
What is considered a Digital Filter
https://dsp.stackexchange.com/questions/82575/what-is-considered-a-digital-filter
<p>Would upscaling from a DVD to 4k on a TV be considered Digital Filtering? Would an AI trained to suppress noise and enhanced desired signal be considered a Digital Filter?</p> <p>I'm trying to figure out what counts as Digital filtering and what does not.</p> <blockquote> <p>In signal processing, a digital filter is...
<blockquote> <p>Would upscaling from a DVD to 4k on a TV be considered Digital Filtering?</p> </blockquote> <p>No, that's scaling. It might involve filtering, especially for <em>anti-imaging</em>.</p> <blockquote> <p>Would an AI trained to suppress noise and enhanced desired signal be considered a Digital Filter?</p> <...
704
digital filter
Notch Digital Filter
https://dsp.stackexchange.com/questions/87124/notch-digital-filter
<p>I am given a notch digital filter with the <span class="math-container">$z$</span>-transform being: <span class="math-container">$$W(z)=MF(z)F(z^{*})^{*}=M\frac{z-q}{z-p}\frac{z-q^{*}}{z-p^{*}}$$</span> where <span class="math-container">$M$</span> is the normalisation factor, <span class="math-container">$q=e^{-i2\...
<p>You probably know that a LTI filter is stable if and only if the poles of its transfer function are inside the unit circle.</p> <p>So I guess you ask for a direct way of showing it in the case of your filter.</p> <p>The transfer function of a filter is the <span class="math-container">$z$</span>-transform of its imp...
705
digital filter
Subtract a digital filter from another filter
https://dsp.stackexchange.com/questions/43331/subtract-a-digital-filter-from-another-filter
<p>How to subtract a digital filter from another one, if their lengths are different. How to make the length equal.</p>
<p>If (and only if) the filters (either FIR or IIR) are linear, then you can subtract their coefficients term-wise, supposing they are correctly aligned (below, on the $0$ index), treating them as infinite series with trailing zeroes when the coefficients are not defined. For instance with:</p> <p>$$h = [h_0, h_1, h_2...
706
digital filter
Digital filter performance with noncontinuous signal?
https://dsp.stackexchange.com/questions/9701/digital-filter-performance-with-noncontinuous-signal
<p>First of all, I'm new to DSP so excuse my simplified words. I'm testing the performance of a digital filter on a (partly) noncontinuous signal:</p> <p><img src="https://i.sstatic.net/X5ECG.png" alt=""></p> <p>As you can see, the signal is not continuous at some points (like it is stopping and starting over again) ...
<p>It is not surprising that the filter output resembles the filter's step response at discontinuities of the input signal. It's like applying a (modulated) step at the input. Apparently the cut-off frequency of the high-pass filter is higher than the frequency of the sinusoid, so the output goes to zero after each dis...
707
digital filter
Digital filter output understanding
https://dsp.stackexchange.com/questions/95524/digital-filter-output-understanding
<p>I have following digital signal which has been retrieved via sampling of an analog signal with sampling period <span class="math-container">$T_s = 100\,\mu\mathrm{s}$</span></p> <p><a href="https://i.sstatic.net/JfBcY72C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JfBcY72C.png" alt="enter image de...
<blockquote> <p>Based on that it could be said that the original filtered signal contains 300Hz sine with variable amplitude.</p> </blockquote> <p>Pretty much. The FFT can only give the total energy in that frequency bin of the entire signal. The energy at a specific frequency can definitely vary over time, but the FF...
708
digital filter
Converting a simple analog Butterworth filter into a digital filter
https://dsp.stackexchange.com/questions/63538/converting-a-simple-analog-butterworth-filter-into-a-digital-filter
<p>I was just studying an old circuit analysis textbook that was describing how to design a Butterworth filter, and that seemed easy enough.. then, I started to wonder if I can take this analog filter and convert it into a digital filter. Its not really an exercise in the textbook, i was just curious how to convert the...
<p>Converting the analog filter <span class="math-container">$H_a(s)$</span> into a digital filter <span class="math-container">$H_d(z)$</span> using the <strong>bilinear transform</strong> where T is the sampling period:</p> <p><span class="math-container">$\Large H_d(z) = H_a(s)\bigg|_{s=\frac{2}{T}\frac{z-1}{z+1}}$...
709
digital filter
Digital filter as physical device
https://dsp.stackexchange.com/questions/70010/digital-filter-as-physical-device
<p>I'd like to find some book or books to get information about how digital filter is built depending on specifications. Like depending on price, or speed and etc. As I know it could be built by some D flip-flops and summation blocks, but there are more kind of them depending on specs, so if it's possible to get book o...
<p>Digital Filters as dedicated pieces of hardware are quite rate these days. Most filtering just happens on general purpose CPUs such as ARM core and may be partially accelerated by specific instruction sets or co-processor (e.g. NEON). Your smart phone or your laptop do a lot of digital filtering every day.</p> <p>De...
710
digital filter
Digital Filter Design Accuracy
https://dsp.stackexchange.com/questions/42816/digital-filter-design-accuracy
<p>Having only dealt with digital filter scarcely, the question dawned to me when I used the firls function in matlab to design an equalizer with a certain gain response. </p> <p>In general, can we prescribe an arbitrary shape as the equalizer filter response and hope to obtain a FIR/IIR filter that matches this shape...
711
digital filter
Digital filters and the Z-transform
https://dsp.stackexchange.com/questions/13612/digital-filters-and-the-z-transform
<p>Why is it that we Z-transform a difference equation to get a the transfer function of an digital filter?</p> <p>How come a digital filter is given in the Z-domain, and what is the Z-domain?</p> <p>And for that sake, why do analog filters operate in the S-domain, and what is the S-domain?</p>
<p>The S-transform allows you to deal with differential equations in an algebraic manner - so they become easier to solve. Since continuous/analog filters consist of integrators and differentiators the S-transform is therefore a natural way to deal with these systems.</p> <p>The z-transform provides an algebraic way o...
712
digital filter
Digital Filters deal only with samples, right?
https://dsp.stackexchange.com/questions/30851/digital-filters-deal-only-with-samples-right
<p>I'm new to digital filters. So I'm trying to get things right and I can't find an explicit answer to my question on the internet.</p> <p><strong><em>Question: Digital filters only accept samples as input?</em></strong> I mean the input can not be zeros nor ones. It can only be samples. If that's the case, then the ...
<p>You are almost right: digital filters do deal with samples, but a sample can be any numerical representation of a given signal value at a given instant (so in general, they may accept zeros or ones).</p> <p>Moreover, a sample is usually represented by a binary word (e.g. 0001), so a digital filter actually deals wi...
713
digital filter
How does a digital filter work?
https://dsp.stackexchange.com/questions/51755/how-does-a-digital-filter-work
<p><em>To introduce my situation:</em> I'm developing a digital synthesizer in a form of a C++ library, working with low level APIs like WASAPI, ASIO, ALSA etc. It's probably not very practical and I'm mostly "reinventing the wheel" but my intention is to learn about digital synthesis in depth. So far I have successful...
<p>Consider a moving average over N samples- this is a simple FIR filter where each new output is the average of the past N samples. It is easy to see how high frequency noise can be filtered out (so is a low pass filter), and the longer time duration we include in the averaging window the lower will be the frequency c...
714
digital filter
Normalizing Negative filter coefficients for Digital filter design
https://dsp.stackexchange.com/questions/1427/normalizing-negative-filter-coefficients-for-digital-filter-design
<p>I am designing a High pass Digital filter. I calculated the filter coefficients using fdatool and got some negative filter values.</p> <p>Now, I need to convert them into values from 0 to 255.</p> <p>In case of low pass filter , I used </p> <pre><code>value = value*255/sum(value) </code></pre> <p>I have heard t...
715
digital filter
Basic tools for digital filter design?
https://dsp.stackexchange.com/questions/31153/basic-tools-for-digital-filter-design
<ul> <li>What tools to use for practicing elementary filter design?</li> <li>Is MATLAB all there is?</li> <li>Do I need some specific toolboxes?</li> <li>What functions do I need?</li> </ul> <p>I'm starting from the ground up in digital filter design and I thought that I need to decide on a program that lets me experim...
<p>There are lots and lots of software that can aid you in designing digital filters. MATLAB is probably the most used software, at least in the university sector. The <a href="http://au.mathworks.com/products/dsp-system/features.html#single-rate-and-multirate-fir-and-iir-filter-design%2C-and-adaptive-filters" rel="no...
716
digital filter
transformation methods for digital filters
https://dsp.stackexchange.com/questions/86536/transformation-methods-for-digital-filters
<p>i have the following question: in digital filter design what's the difference between the methods of transformations : bilinear vs impulse invariance vs Euler vs step invariance. thank you!</p> <hr /> <p><a href="https://i.sstatic.net/FwRTY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FwRTY.png" al...
717
digital filter
Manual filter or digital filter first for EEG?
https://dsp.stackexchange.com/questions/52050/manual-filter-or-digital-filter-first-for-eeg
<p>I am getting conflicting advise regarding how to clean my EEG data:</p> <p>1) Manually remove artefacts first and then apply digital filters</p> <p>OR</p> <p>2) Apply digital filters first and then manually remove artefacts</p> <p>The reason given for 1) is because artefacts are more visible and avoids accidenta...
<p>When it comes to preprocessing of EEG data, the first step is to filter the signal. Filtering is done such that it preserves information across different bands of the EEG data (alpha, beta, gamma, delta). Typically, many researchers use 0.5 - 50 Hz band in the first step (removes DC components). Note that the filter...
718
digital filter
Reverse engineering a digital filter
https://dsp.stackexchange.com/questions/60098/reverse-engineering-a-digital-filter
<p>I have 2 simultaneous signals that both are designed to measure eye movements. They are sampled at 250 Hz. We have 12 subject recordings. For 3 stable periods in each subject, we choose 256 points and did an FFT. Prior to the FFT, the data were mean-centered and detrended with a 2nd order polynomial. They were also...
<p>Signal 1 was an average of a left and right signal and signal 2 was a binocular signal.</p> <p>I followed the suggestion of MBaz, and computed the frequency response of the filter for each segment (N = 3) for each subject (N=12). Then I averaged the frequency responses of the filters. Here is the result: <a href="...
719
digital filter
Finding The Coefficients of the digital filter?
https://dsp.stackexchange.com/questions/2760/finding-the-coefficients-of-the-digital-filter
<p>I want to design a digital filter for pulse shaping. Pulses are of 100us Fall time. and the sampling rate is 100MegaSamples/sec. and the Shaping time is 5us. What should my coefficients be??? And how to obtain them using matlab or any other related software.</p>
720
digital filter
For linear IIR digital filter, what happens for negative frequencies?
https://dsp.stackexchange.com/questions/24386/for-linear-iir-digital-filter-what-happens-for-negative-frequencies
<p>By negative frequency, I refer to Fourier transform. Often, the frequency response of a digital filter is only displayed for positive frequencies. For a linear IIR digital filter, what happens for negative frequencies? Are frequency response for negative frequencies mirror images of what happens for positive frequen...
<p>It may be easier to start with analog signals. If the filter's impulse response $h(t)$ is real, then its frequency response $H(f)$ is conjugate symmetric: $H(-f)=H^*(f)$, where $(\cdot)^*$ indicates complex conjugate. Since $H(f)=|H(f)|e^{j\angle H(f)}$, then conjugate symmetry implies that $|H(f)|=|H(-f)|$ and $\an...
721
digital filter
Digital Filter Design using difference equations
https://dsp.stackexchange.com/questions/53218/digital-filter-design-using-difference-equations
<p>I am reading a chapter on digital filter design from analog filter design using difference equations. What they do first of all is that they map <span class="math-container">$s$</span> (Laplace variable) to <span class="math-container">$z$</span> (<span class="math-container">$z$</span>-transform) by the following r...
<p>Let me show you a quick and easy way to see that <span class="math-container">$z=\frac12+\frac12 e^{j\phi}$</span> is a circle in the complex plane with center <span class="math-container">$\frac12$</span> and radius <span class="math-container">$\frac12$</span>. First, note that <span class="math-container">$z=e^{j...
722
digital filter
Mapping of Classic Filters for Digital Filter Design
https://dsp.stackexchange.com/questions/79400/mapping-of-classic-filters-for-digital-filter-design
<p>Of the four classic analog filter types: Butterworth, Chebyshev, Elliptic and Bessel- are any of these relegated to obsolescence for purposes of digital filter design in comparison to optimized algorithms such as least squares (<code>firls</code>), Parks-McClellan (<code>firpm</code> or <code>remez</code>), maximall...
<blockquote> <p>and simulation where &quot;copying the analog&quot; would result in the better solution.</p> </blockquote> <p>That' missing the point a bit. It's not that one cares much about matching or copying the &quot;analog&quot; but that digital IIR filters have some very nice and useful properties.</p> <p>For ex...
723
digital filter
Fields of math needed for digital filter design
https://dsp.stackexchange.com/questions/26582/fields-of-math-needed-for-digital-filter-design
<p>I want learn digital filter design. My knowledge of math is at high school level. I can learn math through the Internet. Then, what fields of math do I have to learn? </p>
<p>If you have the balls to learn math by yourself. The two fields of Mathematics that you need to dominate in order to do filter design are: Functional Analysis and convex optimization. Pretty much every filter design is the result of an optimization problem, like: Find these set of $N$ numbers such that the absolute ...
724
digital filter
Python butter filter: choosing between analog and digital filter types
https://dsp.stackexchange.com/questions/40697/python-butter-filter-choosing-between-analog-and-digital-filter-types
<p>I have a system that performs wireless sampling of data about every 7.5ms (133Hz). Due to it being wireless, I get occasional data drop out. I want to construct a LP butter filter with cut-off frequency of 10Hz using Python's scipy butter method and then downsample everything to a lower frequency. </p> <p>One of th...
<blockquote> <p>Isn't running this filter offline in python automatically assume that it's digital?</p> </blockquote> <p><a href="https://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.signal.butter.html" rel="nofollow noreferrer"><code>butter()</code></a> doesn't filter your signal, it just designs the filt...
725
digital filter
Digital filters in LabVIEW
https://dsp.stackexchange.com/questions/37591/digital-filters-in-labview
<p>I am very new in signal processing and using digital filters. I have to use a low-pass filter to analyze my data in LabVIEW and have a question about it. Any help and advice is appreciated.</p> <p>I am trying to simplify my problem here:</p> <p>Let’s say there is a digital sine wave (made by LabVIEW) with $V_{offs...
<p>Let me answer your two questions in turn:</p> <p>For your first question, generally, yes that is correct; if you filter a 10KHz sinewave that has a DC offset with a filter that has a cutoff frequency below the frequency of the sinewave, then the sinewave would be rejected. The amount of rejection specifically depen...
726
digital filter
Calculating the cutoff frequency of a highpass digital filter
https://dsp.stackexchange.com/questions/67670/calculating-the-cutoff-frequency-of-a-highpass-digital-filter
<p>I am new to DSP and I am trying to find the cutoff frequency of a HP digital filter. I know the equation that describes the system, its frequency response: <span class="math-container">$H(e^{jω})= 1 - \frac{e^{jω}}{2} - \frac{1}{2e^{jω}}$</span> and of course amplitude response / phase diagrams.</p> <p>I have <a hr...
<p>Concerning the cut-off frequency, there's really not much of a difference between analog and digital filters. <span class="math-container">$3\textrm{ dB}$</span> is common, but any other value is fine, as long as you specify it and people know what you're talking about.</p> <p>In the case of the given filter, it's ...
727
digital filter
Issue Understanding Time Delay of a Digital Filter
https://dsp.stackexchange.com/questions/80795/issue-understanding-time-delay-of-a-digital-filter
<p>I am new to the world of digital filters and am educating myself with the book <em>Introduction to Digital Filters by J.O Smith III,</em>. The author derives the frequency response of a very simplistic filter:</p> <p><span class="math-container">$$y(n) = x(n) + x(n-1)$$</span> <span class="math-container">$$H\left(e...
<p>To help your intuition, consider a sinusoidal signal with frequency <span class="math-container">$\omega_0$</span> and some arbitrary but constant phase <span class="math-container">$\phi$</span>:</p> <p><span class="math-container">$$x[n]=A\sin(\omega_0n+\phi)\tag{1}$$</span></p> <p>Delaying the signal <span class=...
728
digital filter
Impulse Invariant method for digital filter design
https://dsp.stackexchange.com/questions/68903/impulse-invariant-method-for-digital-filter-design
<p>One of the known methods for discretizing analog filters is impulse response invariant. We get the impulse response in time domain, discretize it and then get the Z transform.</p> <p>What I am trying to understand is why the freq response of the resulting digital filter has a freq response magnitude scaled by (1/T) ...
<p>This is just as it turns out when you do the math. The discrete-time Fourier transform (DTFT) of the sampled continuous-time impulse response <span class="math-container">$h(t)$</span> is</p> <p><span class="math-container">$$H_d(e^{j\omega T})=\sum_nh(nT)e^{-jn\omega T}\tag{1}$$</span></p> <p>With</p> <p><span clas...
729
digital filter
Expression for stopband deviation of a digital filter
https://dsp.stackexchange.com/questions/91648/expression-for-stopband-deviation-of-a-digital-filter
<p>Beginning from the basic definition of decibel that expresses the ratio of two amplitudes as <span class="math-container">$20\log_{10}(A_{2}/A_{1}) $</span>, how do we arrive at the expression <span class="math-container">$-20\log_{10}(\delta_{s})$</span> measured in dB, for the stopband deviation of a digital filte...
<p>The stop band ripple, <span class="math-container">$\delta_s$</span> is measured with respect to the pass band amplitude (usually 1).</p> <p>That means:</p> <p><span class="math-container">$$ 20 \log_{10}\left (\frac{\delta_s }{ 1 } \right) = 20 \log_{10}\left (\delta_s \right) $$</span></p> <p>but this is the stop ...
730
digital filter
Transition bands and passband gain in digital filter design
https://dsp.stackexchange.com/questions/46454/transition-bands-and-passband-gain-in-digital-filter-design
<p>In an ideal design, a digital filter has a target gain in the passband and a zero gain (−∞ dB) in the stopband. In a real implementation, a finite transition region between the passband and the stopband, which is known as the transition band, always exists. The gain of the filter in the transition band is unspecifie...
<p>In an actual design you need to allow for a smooth transition from the passband to the stopband because the magnitude response of a realizable (i.e., causal and stable) filter is smooth; it can't jump. Of course you can try to approximate a jump in the magnitude, but you'll always get a smooth magnitude response (cf...
731
digital filter
Sample-rate, filtering, digital-filtering and aliasing
https://dsp.stackexchange.com/questions/55053/sample-rate-filtering-digital-filtering-and-aliasing
<p>I am strugling with a question that I hope someone can help me with.</p> <p>I am recording single molecule events which I detect is picoampere square deflections.</p> <p>I wish to use as gentle low-pass bessel filtering as possible.</p> <p>The lowest filter settings my amplifier allow are 10 kHz and 100 kHz, and ...
<p>An ideal square pulse - which I assume is a model for your up-and-down deflections - would have an infinite bandwidth, but the bulk of the energy is within a bandwidth of <span class="math-container">$1/T$</span>, where <span class="math-container">$T$</span> is the pulse duration. Roughly speaking, therefore, the ...
732
digital filter
Implementing digital filter by padding with zeros
https://dsp.stackexchange.com/questions/18323/implementing-digital-filter-by-padding-with-zeros
<p>I am making a 9th order digital bandpass filter with lower and upper corners of 200 kHz and 40 MHz respectively. I am using this filter to filter a 1D time domain signal which is 64k samples long sampled at a frequency of 150MHz. </p> <p>I have done some digital filtering before in university, so I know what to ex...
<p>Zero padding your input signal does not change your sampling frequency, it just changes (in this case probably very slightly) the time duration of your input signal. An example would be that whether you filter one second's worth of data or two second's worth of data doesn't have any impact on the sampling frequency...
733