18

Downsampling and upsampling are operations that change the sampling rate of a signal. Each one of them is composed of two steps, changing the sampling rate and filtering. Usually, the amount of change is expressed as a ratio. When downsampling, we are trying to take the signal from some $Fs$ to some $Fs_n < Fs$. The key problem with doing this is that we ...


6

Interpolation (sampling frequency 44.1 kHz ➔ 88.2 kHz) Your original 44.1 kHz sampled signal has frequencies up to 22.05 kHz, so you should lowpass filter at 22.05 kHz after dilution with zeros. Your filter should have a gain of 2. Otherwise the signal amplitude drops to half because you set half of the samples to zero. Like Jim Clay says, you can combine ...


6

Your questions still leave me wondering as to what you're actually designing. For software implementation on modern x86 CPUs, CICs make almost no sense, but they are extremely elegant in hardware. These filter definitions are ridiculous if you're planning to use a FIR – a transition width of 1mHz means that a minimum phase equiripple filter [1, (5.75), p. ...


6

Your interpolation operation is an upsampling operation with subsequent low-pass filtering. This translates to zero-padding in the frequency domain. Given your original signal $x[n]$, you upsample it to become $$y[n] = \begin{cases}x[n/M]& n/M \in \mathcal{Z} \\ 0 & \text{else}\end{cases}$$ to become an M-times upsampled signal. Then, your ...


4

The root of your problem is that you are not familiar with the Nyquist Sampling Theorem. First of all, I question your premise that your sample rate is 70 MHz and that you can represent your signals, which range from 0 to 70 MHz, at this rate. The Nyquist sampling theorem indicates that you can only represent signals up to half the sample rate, which is 35 ...


4

So, let's not forget what SNR is: it's a relation of powers present. The thing that improves SNR is a propoer low-pass: it leaves the signal power alone and reduces the power of the noise. An ideal low-pass filter will leave zero noise outside its specified bandwidth – so it doesn't matter whether you "cut off" these bandwidths using decimation or not, ...


3

You have the right idea about Interpolation/Decimation and the steps involved. Two points: Interpolation: When you insert zeros between samples, the spectrum is now the new sampling frequency wide (88.2kHz in your case) with copies of the original spectrum showing up at multiples of the original frequency (44.1kHz in your case). When you lowpass filter, ...


3

Yes, your method is correct, and will work just fine. You can reduce the computational load by combining the upsampling (insertion of zeros) and low-pass filter into a single interpolating filter, and combining the low-pass filter and removal of samples into a single decimating filter, but that is not necessary to get correct results.


3

One advantage of the polyphase filter is when hardware resources are limited. The polyphase approach replaces a $L$ tap filter with $N$ filter sets of $L/N$ taps. Once you've done that you can just use a single $L/N$ filter set and swap coefficients.


3

The problem is in the input signals to your polyphase filters. They should be delayed and subsampled versions of the input signal, like in the following code fragment: M=8; % downsampling factor L=256; % length of input signal, integer multiple of M x=randn(L,1); % input signal h = fir1(127, 1/M); yp = zeros(L/M, 1); for i = 1:M, xtmp = [zeros(i-1,...


3

Don't be confused; you're doing everything correctly here: $$\begin{align*} f_{sample,in} &&\overset{\text{interpolate}}{\rightarrow}&& f_{sample,intermediate} &&\overset{\text{decimate}}{\rightarrow}&& f_{sample,out}\\ 22 \mathrm{kHz}&&\overset{\uparrow 20}{\rightarrow}&& 440 \mathrm{kHz} &&\overset{\...


3

In communications and in typical GnuRadio applications, decimation is most commonly used to reduce the sampling rate of an oversampled signal, in order to reduce the computational complexity of the system. Consider this example: You design a stereo FM receiver in GnuRadio. The FM signal is approximately 200 KHz wide, so you sample the downconverted signal ...


3

This answer assumes that some passband flatness is required. Two-path all-pass half-band IIR If you can accept the phase distortion, may I recommend the HIIR half-band lowpass filter library by Laurent de Soras. It implements half-band elliptic lowpass filters as a sum of all-pass filters that are 180° out of phase in the stop band. It is a very efficient ...


3

Try adding a gain of 16 before your low pass filter, or equivalently using a low pass filter with a passband gain of 16 instead of 1.


3

I do a lot of decimation in the frequency domain. Little details are important. 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. Ensure that the ...


3

I may have originally misinterpreted your question so I'll change my answer here. As to why we don't typically just sample at our a decimation rate (i.e. the Nyquist rate for the bandwidth of interest). It really comes down to the practicality: If you had a 200hz signal of interest, yes you could sample at 400hz assuming there was absolute no noise in your ...


3

What you are calling decimation is in fact downsampling: keeping one of every $k$ samples from the original signal. Proper decimation involves a digital low-pass filter in order to eliminate all components above $\pi/k$ (or $f_s/(2k)$ in continuous time) since these components cannot be represented at the new lower sampling frequency (and will result in ...


3

I will explain why method 2 is often a better choice over method 3. The frequency domain approach is equivalent to the "Windowing" method of filter design- in that to do that approach correctly you should window your data before taking the FFT. For an anti-alias filter design in the time domain approach, the least squares filter design algorithm outperforms ...


3

Sample rate conversion systems (expansion or decimation) are time-varying operators. For your example system of decimation by $M$ : $$ y[n] = T\{x[n]\} = x[Mn] $$ you can easily see that results of shift in the input and output are not the same; i.e., $$ y_1[n] = T\{ x[n-d] \} = x[Mn - d] $$ and $$ y_d[n] = y[n-d] = x[M(n - d)] \neq y_1[n]$$


3

First, 0.3dB is generally considered small potatoes in signal processing. Second, the documentation for scipy.signal.decimate states that it uses an 8th-order Chebychev filter by default (without specifying the ripple, dangit!). Chebychev filters have some ripple in the passband; if the bulk of your signal's energy is falling into the troughs of the ripple,...


3

Imagine an incoming signal with 60dB SNR over the whole spectrum. The 60 dB isn't what matters here – what matters is that you've got the same power spectral density all over your spectrum, including the 39/40 that you'll alias onto your remaining band. So, if you don't want the SNR of that remaining band to be affected, you'd need infinite attenuation; can'...


2

After my trials, I realize that problem is directly about Warning: Image is too big to fit on screen; displaying at 67% warning. I use imwrite to my matrix and convert it to jpg file. After looking the image using jpg file , there is no problem.


2

If all you want to do is get an estimate of the DC component of your data then you can simply obtain the average value of your signal over a unit of time. This can be easily shown by looking at the expression for calculating the Fourier coefficients for 'f=0' (DC component). The easiest way to do this is via a moving average filter (http://en.wikipedia.org/...


2

The decimate function in matlab does 2 things. First, the signal is filtered. From your code, and the function doc page, I see that it uses Chebyshev Type I IIR filter of order 10 with normalized cutoff frequency 0.8/p(i) and passband ripple 0.05 dB. Next, the signal is downsampled. The filter can be created using [a_lp,b_lp] = cheby1(10,0.05,0.8/p(i)); ...


2

The definition of the Fourier Transform of a function $x(t)$ is $$ X(f) \triangleq \int\limits_{-\infty}^{\infty} x(t) \, e^{-j 2 \pi f t} \, \mathrm{d}t $$ Evaluating for $f=0$ you see $$ X(0) = \int\limits_{-\infty}^{\infty} x(t) \, \mathrm{d}t $$ As you can see the value at DC equals the area of the function. The definite integral of a function from $...


2

so, what's wrong with a simple 1st-order, 1-pole, IIR filter, where you're a little careful with the coefficient that soooo close to 1? $$ y[n] = (1-p) x[n] + p y[n-1] $$ where $ p = \cos(\omega_0) = \cos\left(\pi \frac{0.1}{54000} \right) $ but express the whole thing in terms of $1-p$ instead of $p$. $$\begin{align} y[n] & = (1-p) x[n] + p y[n-1] \\...


2

any low-pass filter with DC gain of 1 ( $H(1)=1$ ) is a candidate for DC extraction filter. this kind of "get DC" filter problem is pretty much equivalent and complementary to the "DC blocking filter" problem. i don't see why you wouldn't use a far lower order IIR filter for your LPF. you can get sharp without 768 taps (and, presumably 768 multiply-...


2

If you are only decimating by four, then a CIC filter is not the way to go. CIC filters have two advantages and one big disadvantage. The advantages are that they don't require any multipliers, just (large) adders, and they can efficiently decimate by really large factors. The no-multipliers advantage was a big deal years ago when multipliers were ...


2

All of the answers above are good in their own way. The reason that the Oppenheim-Schafer book and other similar resources use a gain of $L$ for upsampling and a gain of $1$ for downsampling is to maintain a constant amplitude for the signal before and after the operation. Do the processes of upsampling and downsampling affect the magnitude of the ...


2

This is a really very nice applied signal processing question. Unfortunately your lack of DSP and physics expertise, builds some barriers on the way of your understanding. Hopefully this answer helps to tunnel through. Now, your first question is about downsampling a discrete time signal. In fact there are already plenty of such questions here under the ...


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