# Tag Info

## New answers tagged matlab

4

You don't want np.ones_like(num) in the denominator. That's making a denominator of all ones, with lots of possibly unstable poles. Your denominator in Python needs to be [1,0,0,0,0,0,...]. Or just [1] if possible.

3

One problem with your design is that the quantized numerator coefficients don't add up to zero anymore, so you lose the desired notch at DC. That can be done differently, because even with quantized coefficients you can have a (double) zero at DC. Just make sure that $b[0]=b[2]$ and $b[1]=-2b[0]$. The real problem is the denominator polynomial. It is well ...

1

When trying to measure similarity between signals we're basically building a metric. When doing so we need to ask what we want to be sensitive about. For instance, if you don't remove the DC Component (The Mean) and use something like an integral to measure similarity (Correlation / Convolution based) then you are sensitive the added DC component. For ...

2

This filter amounts to a cutoff frequency of 24 Hz @ 44.1 kHz. That means your poles are extremely close to the unit circle so you require way more numerical precision than you can get with 16 bits. You need more resolution: even 24 bits are iffy for that low a cutoff frequency, but 32-bit should do nicely. This also depends on your requirements: how much ...

1

The scale values should be all $1$ except for the first Unless that's $1$ too. Multiply your output signal with that first scale value OR multiply the first three numbers in the first three row of you SOS matrix with that number before filtering. EDIT Turns out the filter designer makes this more convoluted than it needs to be. Just multiply all the scale ...

0

You can add a constant factor to the weighting function to avoid amplifying the error when the denominator is small，like that c=R./(abs(R)+a); where a can be a constant

2

Cross correlation can be implemented in the frequency domain using FFT by multiplying signals. For a cyclic cross correlation you can use: cc = ifft(fft(x).*conj(fft(y))); You can also calculate the linear cross correlation using FFT by zero-padding the signals before the FFT. Related: Cross correlation with FFT and fftshift Edit: In order to calculate the ...

0

How you have justified that the filtered image is correct by applying Gabor filter to the input image.

1

According to your filter equations, your polynomials for $b1$, $b2$ and $a$ should only contain 1, zeros and -1. Your don't need to evaluate the last coefficient (num_exp, and others) at the complex exponential - That is done inside the freqz() Take a look at this example here So you should have: a=[1, -1] b1 = [1, 0, 0, ..., 0, -1] b2 = [1, 0, 0, ..., 0, -1]...

1

Hi I am confused about the implementation of AGC in Simulink example. I am unable to relate the given implementation to the algorithm given by MATLAB. Kindly help me in understanding the reason behind the difference in algorithm and implementation. Best Regards Sunny

2

When dealing with applying a 2D convolution in frequency domain we have to take into account 2 things: Extending the kernel to the dimension of the input data. Dealing with the implicit periodic extension of the frequency domain element wise multiplication. As you wrote in the comments, one way to do it is simple zero padding and fftshift(). Yet this might ...

1

The spectrum is periodic so you need circular convoluioint, not linear convolution You are smoothing the complex linear spectrum. Due to the phase of the complex ammplitude you will get significant interference in your smoothing window. Smoothing is typically in the energy domain and the phase is discarded. Complex smoothing is fairly difficult to do.

2

The discrete-time Fourier transform (DTFT) is always periodic. This is also the case for the frequency response of the discrete-time Hilbert transformer. For this reason, the ideal frequency response is not only zero at DC but also at Nyquist, which corresponds to index $2$ for a signal of length $4$. Consequently, the correct way to do what you're trying to ...

7

Using the duality property of the Fourier transform, you have that $$x[n] \overset{\mathcal F}{\longleftrightarrow}X[k]\implies X[n] \overset{\mathcal F}{\longleftrightarrow} \begin{cases}Nx[N - k] & \text{for} & k = 1, \ldots, N -1 \\Nx\left[(k)_N\right]&\text{for}&k = 0\end{cases}$$ You have then: \begin{align} X[0] & = Nx[0]\\ X[1] &...

7

Yes reversed (!) but not in the programming sense ! The sequence $N \cdot x[-n]$ which results after applying DFT twice to the N-point sequence $x[n]$ is a time-reversed (and amplitude scaled by $N$) sequence indicated by the minus sign in its argument. Remembering from your math courses, a function with a negated argument such as $f(-t)$ means the function $... 10 The sequence is exactly what you should expect: $$x[-n]=x[N-n]\tag{1}$$ Clearly, for$n=0x[n]$and$x[-n]$have the same value. It seems like you were expecting to see the sequence$x[N-1-n]$instead of$x[N-n]$. If you wanted that sequence you would need to modulate the result of the first DFT: N = 16; x = 1:N; c = exp(-1i*2*pi/N*(0:N-1)); x2 = real( ... 0 The formula is premised on the wavelet being analytic, or being nonzero only over non-negative frequencies:${\hat\psi} (\omega < 0) = 0$. (Note all wavelets also have${\hat \psi (0)}=0$per the admissibility criterion). From Daubechies et al,$\$ \begin{align} \int_0^\infty W_f(a, b) a^{-1} da & = \frac{1}{2\pi} \int_{-\infty}^{\infty} \int_{0}^{\...

1

Your signal (with initial par x0 =0.1) is already noise like and high frequency. It will be hard to distinguish it from the added white noise... One thing you can do is to interpolate (resample) the time series by a large enough factor and then later add the white noise. This will artifically help to separate the noise spectrum and your signal spectrum but ...

Top 50 recent answers are included