# Tag Info

19

You could use a 2nd order IIR notch filter as I describe in this post Transfer function of second order notch filter - That post demonstrates a 50 Hz IIR notch with 1 KHz sampling. [Update: As @user47050 astutely points out in the comments, the IIR notch would also have minimal delay regardless of notch bandwidth, since the dominat delay in the IIR notch ...

9

This is an uncertainty principle kind of problem: there is no way to make a reliable filter with little delay that will suppress a narrow band around 50Hz since the narrowness of a criterion in frequency space necessitates a certain width of observation in the time domain. Basically the compactness of a phenomenon in time and in frequency cannot be ...

8

Are you sure you shouldn't be using numpy.correlate instead of numpy.convolve? To estimate delay, you want to cross-correlate your signals, not convolve them. You'll possibly end up with a much larger delay by convolving. Trying something simple: x = [1, 0, 0, 0, 0 ]; y = [0, 0, 0, 0, 1 ]; conv = numpy.convolve(x,y); conv array([0, 0, 0, 0, 1, 0, 0, 0, ...

6

Spherical head, distant source For a spherical head with the ears at opposite points on its surface, a planar wave from a distant sound source reaches an ear on a straight line through air or if blocked by the head then partially through the shortest path along the surface of the sphere. If the sound source is at the same vertical coordinate $z$ as the ears,...

6

This is basically what @hooman suggests: fit a parabola to the three points near the peak of the sample cross-correlation of the data. Using the formula for $p$ here: $$p = \frac{1}{2} \frac{\alpha - \gamma}{\alpha - 2\beta + \gamma}$$ where $\alpha,\beta,$ and $\gamma$ are the values of the sample cross-correlation just before the peak, at the peak, and ...

6

If you are not changing the delay length very often, and you don't want to have a Doppler effect that comes from continuously changing the delay length, then try a cross-fade. Both delay lengths should be running simultaneously for a moment, and you would fade the old one out while fading the new one in.

6

Your mathematical derivation is correct, your $H[k]$ is the single-tap equalizer (i.e. one tap for each subcarrier, and the subcarriers do not mix with each other. That's the orthogonal in OFDM). Let me try to explain this a bit more general, without going into coherence bandwidth and flat fading. To my understanding, explaining it with $B_c$ and flat ...

5

Lagrange parabolic estimator The standard Lagrange polynomial parabolic interpolation peak finding formula from Peter's answer, $$p = \frac{1}{2} \frac{\alpha - \gamma}{\alpha - 2\beta + \gamma}$$ has bias as function of the true delay $d$ if the cross-correlation peak is that of a critically sampled sinc. If the sampling frequency is increased, the ...

5

As your plot shows, the second form allows for the correlation peak to be negative. Now, what does a strong negative cross correlation mean? It means the signals are very similar, except one has a negative sign in front of it, i.e., $x_1 \approx -x_2$. Whether or not this makes sense depends a lot on the actual application. In the application you describe, ...

5

I joined this community only to answer your question as I had a similar problem about 2 years ago, in ECG domain though. What I've found (unfortunately I cannot trace the source back) is a very simple solution for a digital notch filter of taking the signal delayed by half of the period of the frequency you want to filter out and get the average of it with ...

4

If you consider the transfer function of a causal IIR filter $$H(z)=\frac{B(z)}{A(z)}=\frac{\sum_{m=0}^M b_mz^{-m}}{\sum_{n=0}^N a_nz^{-n}},\quad a_0=1$$ then you always get the same number of poles and zeros, regardless of the choice of $M$ and $N$ (as already pointed out by Robert). However, what is meant by a system with "more zeros than poles", is a ...

4

Hard to believe, that you actually looked. You probably don't even need a DSP for that, a normal microcontroller should be sufficient. For example, the STM32F4-Discovery board comes with an ARM Cortex-M3 that has several ADC channels that can do 2.4MSps each and up to 7.2MSps in interleaved mode. There's a DAC for signal output as well. But since your ...

4

The thing you're looking for is known as an "all-pass filter", which has a flat amplitude response, but modifies the phase relationships within a signal. This would be a separate stage from the one that limits the bandwidth. Note that the 50-500Hz bandpass filter is going to modify phase relationships, too, so the all-pass filter will need to be designed so ...

4

In the sampled digital realm, poles at the origin represent delay, which may be necessary to make a filter implementation strictly causal. This delay usually requires no additional arithmetic ops (as a pole elsewhere than zero would require). Sometimes when describing a filter where delay is irrelevant (offline processing, etc.), the filter is centered at ...

4

The term delay line comes from (analog) telecommunications where timing between different signals needed to be adjusted by delaying one of them. For example, the chrominance and luminance channels in a cathode-ray-tube colour television. The reason it's called a line is because that's all it really is: a wire. The website linked to above has the following ...

4

You can fit a curve to the points around the peak of the crosscorrelation ontained by xcor and find the peak of the fitted curve. Ideally you know the cross correlation function of your signals and you fit that function. For practical purposes a parabola also would do. As a rule of thumb for this approach to work properly the bandwidth of your signal should ...

4

The problem here is a discontinuity in the signal, which results in the click you're hearing. A possible solution is to make the delay variation as smooth as possible so that step-like discontinuities are avoided. If $x(n)$ represents the signal associated to the delay-line control (e.g. a knob) and $y(n)$ represents the signal associated to the effective ...

4

Standard Savitzky-Golay filters are linear phase (type I) FIR filters. So they have an odd number of filter coefficients $2N+1$, and the delay equals $N$. For a good overview of Savitzky-Golay filters see this article by Ronald Schafer. For the definition of the four types of linear phase FIR filters see this answer.

4

I assume this a for real-time processing. Otherwise, you could simply discard the number of samples corresponding to the group delay. 1st solution - Use an IIR notch filter. You could use this solution Analytically designing a notch-filter for specified frequency 50 Hz The group delay will be minimal, probably negligible, if you're not close to 50 Hz. ...

3

From the KVR forum link above, dig in from this section: a Tape or Bucket Brigade Delay is better emulated using a fixed delayline with a variable sampling-rate. Classic digital delays typically modulate the length of the delay-line while, Tape and BBD modulate the speed to change the delay. It's similar to a guitar where to change pitch you can ...

3

Typically simplistic models for don't work very well and don't result in externalization (out of head localization). The diffraction effects are quite complicated and at higher frequencies the details pinna (ear lobes) and shoulder reflections are quite relevant. Interaural time and level differences are also highly frequency dependent. It's much more ...

3

Correct answer is in the comment already but for completion: Your transfer function is $$H(z) = b_0 + b_1 \cdot z^{-1}, \mbox{ with } b_0 = 1, b_1 = .9$$ which makes the inverse $$H^{-1}(z) = \frac{1}{b_0 + b_1 \cdot z^{-1}}$$ which corresponds to the difference equation $$y(n) + 0.9 \cdot y(n-1) = x(n)$$ or $$y(n) = x(n) -0.9 \cdot y(n-1)$$

3

If you have a continuously varying delay like, for example, a chorus or flanger, you need a to implement a time varying fractional delay in addition to your regular (integer) delay line. If you only need to change the delay occasionally in discrete steps, a cross fade will work fine.

3

You are seeing the difference between "wide band FM" and "narrow band FM" in your modulated waveform. Observe your modulation index for each case and then review the sideband levels versus mod index using Bessel functions. (The modulation index is the ratio of the frequency deviation over the frequency modulation). The first case is wide-band FM as your ...

3

Calculating a delay between two signals is not as simple as you described and it cannot be generalized as easily either. The case for two sinusoidal signals seems trivial, as the delay then agrees with the phase (divided by the angular frequency) of the Fourier component (of this pointwise multiplication) for the respective frequency. This is not ...

3

The OP asked about a phase shift specifically but from the written details without seeing the actual demodulator implementation, I suspect he may possibly be asking how to implement the delay that is used for some simple FM demodulation approaches. I want to mention the possibility that this may actually be a delay element and not a phase shift in the sense ...

3

Have you considered trying a constant jerk model as opposed to a constant acceleration model? Perhaps a higher order model would capture the acceleration better. See, for instance: K. Mehrotra and P. R. Mahapatra, "A jerk model for tracking highly maneuvering targets," in IEEE Transactions on Aerospace and Electronic Systems, vol. 33, no. 4, pp. 1094-1105, ...

2

The transient edge or pulse shape of a tone burst represents a modulation. The resulting modulated signal will contain frequency components higher than the tone frequency. Thus you may need a sample rate much higher than just over 2X the tone frequency to reproduce a waveform accurately enough for cross-correlation to match the edges of the pulse envelopes....

2

I also suggest a general purpose microcontroller. Your problem involves no processing and your data appears to be digital - so you don't even need an onboard ADC and DAC. The only thing you need is RAM and some very lightweight logic. It would be silly to record digital data bit by bit - you only need to record the number of clock ticks between transitions....

2

The problem is that you are using "upsample", which merely inserts zeros in between the original samples, instead of "interp", which upsamples and then low-pass filters.

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