New answers tagged

1

I read that the coefficients are always 1 for moving average so this is what I did - is that correct? Technically no. For a moving average filter of length $N$ all the coefficients are $1/N$. In practice most people use $1$ for all coefficients and then scale the output with $1/N$ It gives the same result and it's typically more efficient, but if you were ...


1

The green curve in your plot corresponds to the correct result. The red curve is wrong, because the weights in the vector cnvweights are in the wrong order (left and right halves are interchanged). The correct way to compute those weights is cnvweights <- convolve(rep(1/n,n), rev(rep(1/n,n)), conj = TRUE, type = "open") According to the R ...


0

Here’s are pretty good source on the subject: http://www.dspguide.com/ch15/4.htm A single moving average is a boxcar. Two is a triangle. Beyond that, it will start to approach a Gaussian.


1

HINT: How many zeros of $H(e^{j\omega})$ do you count? Does that say anything about the (minimum) order of the corresponding polynomial?


1

As mentioned in a comment, I would probably try to re-design the filter at the new sampling rate. Take equidistant samples of the magnitude of the existing filter between DC and the new Nyquist frequency as a desired response. Since you want to make sure that the new filter has zeros at integer multiples of $60$ Hertz, split your new filter response into two ...


2

It would be better to show that property using pencil and paper, because you're fooling yourself with that Matlab code. Of course we have $$\delta[n-n_0]\star g[n]=g[n-n_0]\tag{1}$$ Now define $h[n]=g[n-n_1]$. According to $(1)$ we have $$\delta[n-n_0]\star h[n]=h[n-n_0]\tag{2}$$ And, consequently, with $h[n]=g[n-n_1]$, $$\delta[n-n_0]\star g[n-n_1]=g[n-n_0-...


3

First of all, that's VHDL, not verilog. your input data is 8-bit wide and i'm gonna assume that it's signed data. Assuming I use SNF notation, your input data is S1:7N:0F i.e 1 bit for the sign, 7 for the whole part and 0 bit for the fractional part. Now, I don't know what your coefficients are, I need that info to give you the best answer but I'm gonna ...


3

Is this because of poles? Yes. A steep drop or rise in a filter's frequency-domain response can only be achieved with a filter that has a long memory. In a FIR filter, this long memory can only come from, well, being long. In IIR filter, this long memory can come from having poles that are close to the unit circle.


4

Your assumption why IIR filters can have steeper transitions from passbands to stopbands compared to FIR filters of the same order is correct: IIR filter have poles away from the origin of the complex plane, and poles inside the unit circle close to zeros on the unit circle cause the corresponding frequency response to change rapidly with frequency. The FIR ...


0

The given impulse response is a scaled version of the impulse response of a highpass Hilbert transformer with delay $\tau=N/2$ ($N$ odd) with frequency response $$H(e^{j\omega})=\begin{cases}-j\,\textrm{sgn}(\omega)\,e^{-j\omega\tau},&\omega_c<\omega<\pi\\j\,\textrm{sgn}(\omega)\,e^{-j\omega\tau},&-\pi<\omega<-\omega_c\\0,&-\omega_c&...


7

This depends a lot on how you implement it. A single biquad takes about 10 arithmetic operations. (To be precise a Transposed Form II takes 4-5 multiplies and 3 adds, depending on how the gain management is done). Arithmetic operation translates into clock cycles of your processor. That depends a lot on the efficiency of your instruction set and how good yo ...


4

I don’t think you’re alone, but essentially this is simply a problem of optimization. Let’s say you have a processor with a 88MHz clock. That’s 2k clocks per sample at 44kHz. If we take the term ‘most’ to mean 50%, of the clocks, then that leaves 1k clocks per sample for filtering. Running 8 filters leaves 125 clocks per filter. That’s a decent amount of ...


2

This is just an empirical formula found by Kaiser for determining the necessary filter length for a given transition width. That formula is given as Equation $(7.30)$ on page $332$: $$M=\frac{A_s-7.95}{2.285\,\Delta\omega}+1\tag{1}$$ I think that Kaiser came up with a formula for determining the filter order (hence without the $+1$ in the equation), and the ...


1

Is it possible to write a code, in a for-loop style, that only calculates the decimated data, and outperforms the performance of built-in functions? Yes. (the way you asked this, here would be where the answer is over, but it's not what you meant, sooooo let's continue) "for loop style" isn't very specific, and any algorithm that implements some ...


2

The expressions Finite Impulse Response (FIR) and Infinite Impulse Response (IIR) refer to the time-domain response of the filter. When an impulse is fed into the FIR filter in the time domain, it's response goes to zero within a finite amount of time. The response of the IIR filter does not. Low Pass Filter (LPF), Band Pass Filter (BPF), High Pass Filter (...


1

Stopband attenuation is just how much the filter attenuates components of the input signal that lie in the filter's stopband. Stopband attenuation is actually a function of frequency, but very often the term is used to refer to the minimum stop band attenuation, which is usually achieved at the stop band edge(s). The term stopband ripple is used for filters ...


Top 50 recent answers are included