texts: Sensor Data Fusion with Orientation Sensors in 3D Euclidian Space

texts:
Preconditions

For measuring the position of a mobile device in 3D space, I utilize two sensors with different characteristics that measure device orientation.

Sensor A (a combined sensor of accelerometers, a compass and a gyroscope) does a great job of estimating the device orientation, but is subject to compass drift. Therefore, the rotation measured drifts around the axis pointing down to the earths core. Notice the gap in the image where the sensor "jumped" to balance previous drift.

Sensor B (a camera with feature extraction and motion estimation) is capable of detecting rotations around the gravity axis very well, but is prone to incremental errors, since all measured rotations are relative and have to be added to gain an absolute value. Notice the incremental error around the axis pointing away from the camera in the image below.

However, for motions around the gravity axis, the results of B are still preferable over A. For the other axis, taking the measurements of A would be better.

Problem

I'm familiar with the concepts of Kalman filters for data fusion. What boggles my mind however, is that I would like to weight different rotational components of the given sensors differently when combining the data.

What mathematical approaches to represent the rotations could I use for an elegant solution?

What I've considered

Representing the rotations as Euler angles might be difficult, since Euler angles are aligned with the coordinate system. This works fine as long as I hold the device even, but no longer for complex movements.

Representing the rotations as Matrices or Quaternions is also not useful, since the rotation is represented in a way where it is not possible to access or modify single components.

Please leave a comment if those considerations seem wrong.


texts: Determine whether the system is a FIR or IIR by looking the transfer function

texts:
I have the following system:
$$
y[n]=\frac{1}{3}(x[n+1]+x[n]+x[n-1])
$$
After the Z-Transform we get

$$
\frac{y[z]}{x[z]}=\frac{z^2+z+1}{3z}
$$
which is of course the transfer function of the system. Now, I know that it would be a FIR if $\sum h(z) < \infty$ with $h(z)$ the impulse response. But As far as I know, it should be clear if it is FIR or IIR by just looking the transfer function. How can I know that?


texts: Calculation of inverse impulse response in the frequency domain

texts:
I want to calculate the inverse impulse response of a LTI system in the frequency domain. I generate a simple impulse response $g$. For this I generate a vector of 100 zeros. I set the value of the 20th sample to 0.5.

I calculate the frequency response function by calculating the Fourier-Transformation $h=\mathcal F(g)$.
I invert every single frequency bin in $h$ where $h_{inv}[k]=\frac{h[k]^*}{|h[k]|^2}$ (This is the formula for the inverse of a complex number)
I do a inverse Fourier-Transformation $g_{inv}=\mathcal F^{-1}(h_{inv })$
I plot $g$ (blue) and the calulated inverse $g_{inv}$ (red)

Question: Why is the impulse of $g_{inv}$ at 82 samples? Is $g_{inv}$ my inverse impulse response?
Matlab code:
g=[zeros(1,19) 0.5 zeros(1,80)];
h=fft(g);

h_inv=conj(h)./(abs(h).^2);
g_inv=ifft(h_inv);

figure
plot(g)
hold on
plot(g_inv)


texts:
In my thesis I try to explain what kernel based methods are, especially the meaning for object detection.

I know kernel based methods like Mean- and CamShift and I know how to use them. I understand how the shift work. But: What does the kernel do, what does he describe?

I know, wikipedia have articles about kernels but I still don´t get it. :(

Q1: What could be an subset for an image?

Q2: How does the kernel project the points in an image?

Q3: Could you give me an simple example to understand kernels?

Thank you in advance!


texts:
Let's say I have a 4-sensor square-shaped array in 3d space, with sensors at

$$ s_1 = [1 \ 0 \ 1] \\
s_2 = [2 \ 0 \ 1] \\
s_3 = [1 \ 0 \ 2] \\
s_4 = [2 \ 0 \ 2] \\ $$

And a single source somewhere out in space, in the y>0 hemisphere. I want to localize that source.

Between each two sensors, I have a phase shift (I'm looking in the time domain). I use that phase shift to create an incident angle for each sensor pair.

But since I'm in 3d space, the set of points which satisfies that incident angle looks like a cone, for each sensor pair. So what I'll have is 4 cones between the four sensor pairs (I'm not counting diagonals of the square). And I'll want to find their intersection, which will represent the location of my source.

The question: how do I go about doing this? It seems to involve some very complicated geometry. What's worse is that the each of the four sensors will be arbitrarily located (1.3, -2.9, 3.4), etc. Somehow I'll need to create cones for each sensor pair at arbitrary locations in 3d space and find their intersection. Any tips or leads? I'm using MATLAB: I was thinking of starting here.


texts:
I have a DSP exam coming up this summer and I got an abysmal mark on an assignment earlier this year. Obviously, the lecture slides are not enough for me to understand DSP, so I am wondering where can I go to form an understanding of DSP from the ground up.
The topics are purely math-based and do not include any programming or Matlab skill
My skills in calculus are also quite bad.


texts: Is Unsharp Mask (USM) Equivalent to Applying Laplacian of Gaussian Filter Directly on the Image?

texts:
There are some educational materials, like Alex Pan - CS 194-26: Image Manipulation and Computational Photography - Fun With Frequencies and Gradients, which demonstrate the unsharp masking technique used for sharpening the image is almost equivalent to applying a Laplacian of Gaussian (LoG) filter on the image:

However, as far as I know and understand, the LoG is basically the Laplacian of the smoothed-image and therefore it just gives us the high frequency components of the image, e.g. details such as edges, and not a sharpened version of the image (as is obtained with unsharp masking). Since I have seen the image above a few times in lecture slides/notes of various image processing courses, I was wondering whether I am wrong in my reasoning or there is some other point which I have missed.


texts: How to compute beam pattern given a delay-and-sum filter in spectral domain?

texts:
Given a two-mic system (the mic spacing $d$ is known), how can I compute the beam pattern (see the Figure below) over frequency and angle $g(f,\theta)$ for a pair of spectral filters ($H_0$ for channel 0, and $H_1$ for channel 1)?

Both $H_0$ and $H_1$ are complex vectors.


texts:
What exactly is the image power law mentioned at page 15 in here:

Is it related to Gamma correction or the statistical power law Or anything to do with PSF of a camera?


texts: Isn't Gardner's algorithm and Early-Late gate the same thing?

texts:
I'm reading about some symbol synchronization methods and I find these two (ELG and Gardner) very similar.

Early-Late gate takes 2 samples, one at $t=T-\delta$ and the other at $t=T+\delta$, then from that you get the timing error; Gardner takes also 2 samples for $\delta=T/2$, one at $t=T-T/2$ and the other at $t=T+T/2$.

I can't really see the difference between these two, although there must surely be a few. Could someone explain that to me?

Thanks.


texts:
so there is this paper I'm reading and trying to understand fully: Towards Practical Identification of HF RFID Devices
http://dl.acm.org/citation.cfm?id=2240276.2240278

I don't want to link the PDF here, but maybe you can catch it from ACM or somewhere else.

Now what we need to know: They record a signal for $5 \mu s$ with 4 GS/s. From the normalized amplitude of the signal $l$ at time $t$ called $f(t,l)$ they obtain $F(\omega, l)$ by FT.

$$
F(\omega, l) = \frac{1}{\sqrt{M}} \sum_{m=0}^{M-1} f(t,l) \exp (-2 \pi i \frac{t\omega}{M})
$$
Where M is the length of signal considered and $0 \leq t \leq M − 1$ is time. Now quoting:

  We then remove from $F(\omega, l)$ its DC component and the redundant part of the spectrum;
  we denote the remaining part of the spectrum by $\vec{s}_{l}$.

So now for the spectrum between 0 to 100 MHz the vector $\vec{s}_{l}$ contains amplitudes for 20000 frequencies $(D=20000)$. To reduce the dimensions the authors filter the signal with a bandpass.

  A projected vector $\vec{b}_{l}$, also called filtered features, is extracted
  from the basic features $\vec{s}_{l}$ using a bandpass filter transformation $W_{BPF}$:
  $$
\vec{b}_{l} = W_{BPF}^{t} \vec{s}_{l}
$$
  The feature extraction from N captured responses for a given RFID device is
  then given by $G = W_{BPF}^{t}S$ where $G$ is an array of  $\vec{b}_{l}$ and
  $S = [\vec{s}_{0} \dots \vec{s}_{l} \dots \vec{s}_{N}]$ is a matrix that
  contains the basic features of N captured responses.

  In our implementation, the transformation $W_{BPF}$ consisted of a Chebyshev Type I bandpass filter with filter order of 100 [Williams and Taylors 1988]. The filter was used to keep the frequencies in a target frequency range enclosed between the upper and lower bandpass edge frequencies, denoted by Fp1 and Fp2 respectively; the latter were experimentally determined. We chose the filter order to be high for better bandpass filtering quality. Using this technique the basic feature dimensionality can be effectively reduced to only tens of frequencies (dimensions) comprised between Fp1 and Fp2.

Later on in the paper they state the following:

  Therefore, we applied feature selection by filtering with parameters Fp1 = 11 MHz and Fp2 = 15 MHz. This procedure reduced the features (fingerprint) dimensionality to D = 40.

And now my question (lately).

Why is the dimensionality now 40? If we have amplitudes of 20000 frequencies between 0-100 MHz and filter from 11 to 15 MHz shouldn't there be 800 left?
How does this bandpass matrix $W_{BPF}^{t}$ look like?

Thanks for reading and greetings,

para


texts:
Here is simple code to illustrate overshoot using bessel filter:

sig = (np.random.rand(300)-0.5)*2
b, a = signal.bessel(5, np.asarray([10e3, 400e3])/(0.5*1e6), btype='bandpass')
sig_f = signal.filtfilt(b, a, sig)
print(np.amax(sig_f))
plt.plot(sig, label='input')
plt.plot(sig_f, label='filtered')
plt.legend()

I need a zero phase bandpass filter. I want to reduce overshoot as much as possible, that's why I'm using Bessel filter. But I still have some overshoot in some cases.

In this example, I would like to understand which parameters of my input signal/filter are closely related to overshoot. In my case, is it related to sharp transition in my signal? How can I prevent overshoot?


texts: How do I explain a complex exponential intuitively?

texts:
What is a complex exponential, explained intuitively?
How do I explain to an adolescent a complex exponential function?


texts: Separating a signal into its constituent components

texts:
First off, I apologize for possibly incorrect use of jargon, as I am new in this area.

I have a type of signal that I am assuming can be described by an arbitrary number (let's say $n$) of basis vectors, which are linearly independent. I am measuring a signal through one sensor, which gives me a vector of amplitudes. I am able to measure an arbitrary number (let's say $m$) of mixtures of the basis signals, which gives me $m$ measured signals.

The length of my vectors is 150000, sampled at a frequency of 2.5 MHz.

So here is what I think my system of equations will look like.

$$ Y = A X $$

where $Y$ is the matrix containing the mixtures (measurements) and has dimensions of $ m \times 150000 $, $X$ is the matrix containing the basis signals, and has dimensions of $ n \times 150000 $, and $A$ is a coefficient matrix that has dimensions of $ m \times n $.

I need to solve for $A$. However, since $X$ is non-square ($ n \ll 150000$), it does not have an inverse. I guess I could calculate the pseudo-inverse. Does this make sense?

I have also looked into Principal Component Analysis and how it is used in various types of spectroscopy. It seems to me that PCA assumes a set of basis signals, and I don't know whether that has a physical meaning in my case, since my signals are stochastic (but stationary). I used the PCA routine on matrix $Y$ in MATLAB, and it gave me some signals very similar to the input ones, but I did not know what to do with them.

Any ideas?

I think I do have a valid physical model for my signals. Should I perhaps use model-based blind source separation (BSS) ?

Thanks in advance for taking the time.


texts:
I have one example test question by this kind:

So in this ebook (Digital Signal Processing Using MATLAB) as the DSP references and not found C/D block equations on it?

and this c/d search results?

Thanks for your attention.


texts:
Given a signal
$s(t) = e^{j(t+\pi)}$,
I conclude that the signal is periodic with period $T=2\pi$, so its power should be
$$P = \frac{1}{T}\int_{-T/2}^{T/2}|s(t)|^2dt= \frac{1}{2\pi}\int_{-\pi}^{\pi}|1|^2dt = \frac{1}{2\pi}t|^{\pi}_{-\pi}=\frac{\pi-(-\pi)}{2\pi}=1$$

Is the formula for the power of a periodic signal correct?


texts:
I've been using a program for identifying harmonics for a wave after doing a fourier analysis.

http://www.phon.ucl.ac.uk/resource/sfs/esynth.htm

I would like to be able to tweak some of the harmonics involed in a wave and also to add harmonics.

The program mentioned above permits this kind of operations but it isn't precise.

Does anyone know of a good tool for harmonic analysis and synthesis like the one mentioned above?

ps:It's important that the program exports the harmonics to a file.

thanks.


texts: Why is the first axis of STFT frequency bin

texts: When taking the STFT of an audio signal, the first axis is the frequency bins by convention, and the second axis is how it elapses through time. Is there a reason?


texts: Is there a need of Point interpolation before proceeding for gaussian smoothing of an incomplete distribution?

texts:
Suppose there is a distribution that has values sampled on the interval 1-25 with corresponding sample values that have to be smoothed. For example:

n    f[n]

3    123
5    234
8    246
10   567
14   253
18   251
24   132

The first column has sample points between 1-25 but does not have samples for all points on the interval. Should interpolation of other points in the distribution be done so that we have approximate values for all points between 1-25 before applying Gaussian smoothing?


texts: Distortion of OFDM signal when using RRC filter

texts:
I am trying to transmit OFDM signal in pass-band based on RRC filter, but what I noticed that the signal before the RRC filter is completely different compared with signal after the RRC filter (It means the signal is destroyed when using RRc filter).  I tried to follow the signal without using any channel, I noticed the issue starts when using the RRC filter. For example,  I used only the system as follows:
signal --> ifft --> upsampling --> RRC filter --> RRC filter --> downsampling --> fft --> received signal

What is expected is the received signal equals to signal, but I get very different results.
what I get is a different signal. Why ? should that be equal? I think I must be the same.
Finally , when I delete the filter, Everything is OK.


texts: Relation between variance of gaussian noise and intensity variance in Bilateral filter

texts:
So I implemented the code for bilateral filter from here and ran it for various values of spatial sigma and intensity sigma. I noticed that when I add gaussian noise to an image with variance say 0.02, and then try to filter it with bilateral filter, and if I enter value of spatial sigma say 18 and of intensity sigma as 0.02, the filtered image looks apparently same as the noisy one.

I am guessing that 'intensity sigma' (or sigma r as mentioned in this paper) tells us the difference in intensity levels between neighbouring pixels that we are allowing (though I am not sure if this is correct). So when we are smoothing with sigma r value same as variance of gaussian noise, essentially it makes no change since the intensity difference in the noisy image is within the same bounds as allowed by our bilateral filter.

It smooths the picture nicely with sigma r = 0.25.


texts: Passband filter before Hilbert transform

texts:
I have a .wav file of human speech sampled at 48kHz. Before making the analytic signal with:

hilbert(s_real)

lets say in range 200 - 3,500 Hz, I probably need to do pass-band filtering, say 300 - 3,400 Hz. Does it matter for subsequent Hilbert transform, what type of filter is applied: Bessel, Butterworth, Chebyshev or Elliptic?


texts: Finding impulse response $h(t)$ by impulse matching; problem understanding Example 2.3 in "Linear systems and signals", Lathi 3rd edition

texts:
Before the example it has been stated that in a system described by
$$
Q(D)y(t) = P(D)x(t), \quad (1.) \iff \\
(D^N + a_1D^{N-1} + ... + a_{N-1}D + a_N)y(t) = (b_{N-M}D^M + b_{N-M+1}D^{M-1} + ...+b_{N-1}D + b_N)x(t)
$$
if $N = M$, setting $y(t) = h(t)$ = impulse response, we will get
$$
h(t) = b_0 \delta(t) + \text{characteristic modes}
$$
If $N > M$, $b_0 = 0$ so we get
$$ h(t) = \text{characteristic modes}, \quad (2.)$$
Where the characteristic modes has been defined as the exponential terms/functions in the solution to the differential equation $Q(\lambda) = 0$. Then comes an example (Example 2.3) of a method, "impulse matching", to find the unkown coefficients of the $N$ characteristic modes in $h(t)$ in equation (2.), which I do not understand.

Find the impulse response $h(t)$ for a system specified by
$$(D^2 + 5D + 6)y(t) = (D+1)x(t), \quad (2.20)$$
In this case, $b_0$ = 0. Hence, $h(t)$ consists of only the characteristic modes. The characteristic polynomial is $\lambda^2 + 5\lambda + 6 = (\lambda + 2)(\lambda + 3)$. The roots are $-2$ and $-3$. Hence, the impulse response $h(t)$ is
$$ h(t) = (c_1e^{-2t} + c_2e^{-3t})u(t) , \quad (2.21)$$
letting $x(t)$ = $\delta(t)$ and $y(t) = h(t)$ in Eq. (2.20), we obtain
$$ \ddot h(t) +5\dot h(t) + 6h(t) = \dot \delta(t) + \delta(t), \quad (2.22)$$
Recall that initial conditions $h(0^-)$ and $\dot h(0^-)$ are bot zero. But the application of an impulse at $t=0$ creates new initial conditions at $t=0^+$. Let $h(0^+) = K_1$ and $\dot h(0^+) = K_2$. These jump discontinuities in $h(t)$ and $\dot h(t)$ at $t=0$ result in impulse terms $\dot h(t) = K_1 \delta(t)$ and $\ddot h(0) = K_1 \dot \delta(t) + K_2 \delta(t)$ on the left-hand side. Matching the coefficients of impulse terms on both sides of Eq. (2.22) yields
$$ 5K_1 + K_2 = 1, \quad K_1 = 1 \implies K_1=1, K_2=-4$$
We now use these values $h(0^+) = K_1 = 1$ and $\dot h(0^+) = K_2 = -4$ in Eq. (2.21) to find $c_1$ and $c_2$. Setting $t=0^+$ in Eq. (2.21), we obtain $c_1 + c_2 = 1$. Also setting $t=0^+$ in $h(t)$, we obtain $-2c_1 - 3c_1 = -4$. These two simultaneous equations yield $c_1 = -1$ and $c_2 = 2$. Therefore
$$ H(t) = (-e^{-2t} + 2e^{-3t})u(t) $$

I do not understand the part in boldface. Why does the jump discontinuities result in impulse terms and what is the logic behind the calculation of the impulse terms from the jump discontinuities?


texts: STFT window width vs. detectable Hz range

texts:
Assuming 44100 samples per second in a short 4-8 second-long audio .wav file, if I want perform FFT to detect the power spectrum, amplitude, and phase shift from 20 Hz to 10000 Hz (humans lose the ability hear above 10000 Hz with increasing age), I am thinking I will need window lengths of at least 4410 samples?  This is because, within a second, a 20 Hz cycle will occur every 2205 samples (44100/20), but due to Nyquist, I will need twice the 2205 or 4410 samples.

For human hearing, what is the typical window width used so that deconvolution will result in clean audio quality?  For some reason, I think the long wavelengths of 20 Hz will require window widths no shorter than 4410 samples.  Given this, why are their STFT matrices shown in reports which have 1024 bins in the time domain for 4 second .wav files?  (see the image below from the NMF chapter at musicinformationretrieval.com).  The 1024 bins must be based on the jump size -- that site never states that they employ windows widths of 4410 with much shorter jump sizes.

UPDATE

The goal is to replicate the NMF results presented here via OOP with a compilable programming language (.NET) -- not an interpretive language like R, Matlab, Librosa, etc.  Their STFT results were obtained using Librosa by merely invoking the syntax S = librosa.stft(x). It would be futile to chase down Librosa's default settings for FFT bin spacing and window jump length for STFT matrix generation by Librosa because I am not using Librosa.


texts: What is Magnitude and Phase actually represents in Fast Fourier Transform?

texts: When we reconstruct the image from its magnitude only using Inverse Fast Fourier Transform, then why the resulting image looks nothing like but the original image? Can someone please explain me in detail, what is the role of magnitude and phase in FFT and IFFT?


texts: Why when the SINR of transmitting signal is very large ,the device cannot decode the received signal at the same time?

texts:
$A$ transmit $x$ and receive the $y$ at the same time.If the SINR for transmitting $x$ is very large,$A$ cannot decode the $y$ signal.Why?

In my opinion,If the SINR for transmitting $x$ is very large,it means that SINR for receiving $y$ is very small,so the error probability for receiving $y$ will be very large,so the $A$ cannot decode the $y$ signal.

Is my thinking right?


texts: Is it appropriate to use PSD on the analysis of a plucked guitar string?

texts:
I'm using python 2.7 to compare tonal differences in guitar stings.

I've found that in matplotlib, there are some great built-in features such as
matplotlib.mlab.magnitude_spectrum
and
matplotlib.mlab.psd

The magnitude_spectrum function seems to be the no brainer, as it is the FFT of the signal, showing each specific harmonic. However, when comparing various guitar strings, it's tricky to pinpoint each peak to compare. The PSD function gives very nice smooth graphs, which is perfect for obvious visual comparisons.

My understanding is that PSD's are useful for random signals but not necessarily known signals. Is this true? And is there any reason I shouldn't be using the PSD for guitar string comparisons?

Here's what the PSD and magnitude_spectrum graphs look like:

Note that these are plucks of the same string and not different strings. I'm trying to make sure that my plucks are consistent prior to comparing various strings.


texts: What is the difference between monocular and stereo image?

texts:
I read somewhere in SE about stereo and mono videos. Stereo videos are captured by using two cameras with which we are allowed to measure depth accurately. But what about still images? what is difference between stereo image and mono one?

Another question: if I apply an algorithm on a stereo data set, the same result will be acquired as mono data set? to what extent segmentation of stereo images is different in comparison with other type of images?


texts: Why do we not use square filters without windows?

texts:
This question may sound like "why do we use window functions", but it's not. So here it's:

What we currently do: If we have a function $g(t)$ and its Fourier transform $G(f)$, and a window $W(f)$ and its time domain version $w(t)$, where $t$ is time and $f$ is frequency. The convolution theorem says that convolving $g(t)$ and $w(t)$ is equivalent to multiplying the spectra of each of them. So, to apply a low-pass filter, we ideally apply a square filter at some cut-off frequency. But this doesn't work, because then $w(t)$ has to be infinitely long, because the Fourier transform of the the square window I have to apply is an infinitely long sinc. So to get rid of this sinc, we apply the window to minimize the side-lobes.

This whole story is fine, but here's my problem: This whole story is based on that we're doing all this in the time domain, and hence we use convolution. But consider this (which I know is not an innovation, but I want to understand why that doesn't work): I take my function $g(t)$, calculate its Discrete Fourier transform $G(f)$, multiply it by my perfect square window and filter the spectrum (or in other words, remove the frequencies that I don't like), and then do the reverse transform. What's the problem with that?


texts:
I was trying to solve the Z-transform for u[n] - u[n-N], where u[n] means discrete unit step function, and N is some finite integer. I solved this using 2 methods.

Method 1 :

Taking z- transform using time-delay property and keeping in mind that delta[n] has z-transform = 1; I get:

which suggests that ROC is |Z| > 0

Method 2:

I know that z transform of $u[n] = \frac{z}{z-1}$ with ROC |Z| > 1

using this and the time-delay property on both u[n] and u[n-N] I say that:

which on making the denominators of the 2 fraction equal and simplifying becomes :

Which suggests ROC |z| > 1 .

The result in method-1 makes sense since the signal is a finite duration signal and taking z=0 would essentially mean a divide by zero situation while calculating the z transform.

But Method-2 is something that results from simply applying the properties of z-transform on some pre-known result for a special signal.

Why are the results different then?


texts:
I have been studying about Frequency Domain from many days but still i am not able to clear one of the confusion. We say that in frequency domain an image is represented as waves. What I am able to think is that if we take out an intensity profile column wise (i.e one row of intensity values), we have pixel location and at each pixel location we have some intensity value. So using these values with instensity values on y axis and location on x axis, we can draw a wave for one particular row. Now we find DFT coefficients. These DFT coefficients are multiplied with various waves of different frequencies and added. Ultimately we get the original image. Similarly we do it for 2nd row , 3rd row and so on. But when I saw the following image I got confused.

If we take its fourier transform and see its image in frequency domain we get 3 dots in the middle at frequency location 4. I know we get these dots at frequency location 4 because the image has frequency 4. Now the question is why do I get only one row of 3 dots? Why not each row contains 3 dots as I have discussed earlier? Please explain. Thank You.


texts:
We want to compute an N-point DFT of a one-second duration compact disc (CD) audio signal x[n], whose sample rate is $f_s = 44.1Khz$ with a DFT sampling of 1 Hz.

(a) What is the number of necessary x[n] time samples N?

(b) what is the time duration of the x[n] sequence measured in seconds?

I said:

$f_s = 44100 hz$
$f_o = 1 hz$

(a) $N = f_s / f_o  = 44100 / 1 = 44100?$

(b) $T_s * N = (1/f_S) * N = (1/44100) * 44100 = 1 sec?$

Could I call $f_0$ the fundamental frequency of the DFT and assert that this frequency (1 hertz) corresponds exactly to a time period equal to the length of the x[n] sample range (1 second)?

Is that the definition of the fundamental frequency of DFT...that its the frequency corresponding to the entire sample time period of x[n] of length N...which also happens to be the smallest frequency increment of DFT of which there are exact N frequency buckets that add up to the sampling frequency.


texts: Why in Overlap Save Method in DSP output length comes out to be same as input length?

texts:
I  know that when we do convolution of $x(n)$ (Length $L$) and $h(m)$ (Length=$M$), length of output data comes out to be $L+M-1$, but when we break a large sequence of data and find output using Overlap Save Method, length comes out to be same as input.

Why do the extra $M-1$ points are appearing in this case?
In more expressive way, be $y(n) = x(n)*h(n)$:

Suppose Case 1.:

$x(n)$ (length $L$),
$h(n)$ (length $M$), leads to
$y(n)$ (length $L+M-1$)

using simple linear  convolution
Case 2.:

$x(n)$ (length $3L$),
$h(n)$ (length $M$), leads to
$y(n)$ (length $3L$)

using the Overlap Save Method that evaluats output after breaking input in 3 equal parts of
length $L$.


texts: Question related to Deconvolution and Fourier Transform

texts:
Currently I am completely new to Signal Processing and I am about to kick off a project related to the system identification.

The general idea is given a pair of sent and received signals, I have to find the impulse response in it, i.e. the system. And I'm currently thinking if I can use the technique in deconvolution to handle this problem, so I am doing research on it and got completely messed. Here are some question I would like to ask.

As far as I got from some website, or posts here, I found that if there is no zeros in the fourier transform of the input, I can use direct division on H(w) = Y(w) / X(w), but the question is, if I received the signal datas, the dimensions on X and Y are different, How can I do the the point-to-pont division? or is there any other way to do this? or is it wrong?

Some say that I have to do some filtering/ regularization on the data, but the question is pretty much the same.

It will be much appreciated if you could anwer my question, and many thanks if you could provide me with some readings or books to tackle this problem.


texts:
After a long time away from school, I'm a bit rusty and struggling with this question:

  Determine if the following discrete system is LSI: $y(m,n) = mn*x(m+n) + mn*x(m-n)$

So here's what I've done so far (note that the '*' means regular multiplication, I just added for better readability IMO).

1) Test linearity:

Let $r(m,n) = \alpha x_1(m,n) + \beta x_2(m,n)$, so $y(r(m,n)) = mn*(\alpha x_1(m+n) + \beta x_2(m+n)) + mn*(\alpha x_1(m-n) + \beta x_2(m-n))$

Now, evaluate $y(\alpha x_1(m,n)) + y(\beta x_2(m,n)) = mn* \alpha x_1(m+n) + mn* \alpha x_1(m-n) + mn* \beta x_2(m+n) + mn*\beta x_2(m-n)$

If this is correct, then the system is linear.

2) Test for Shift-invariance:
Let $g(m,n) = y(m,n)$, evaluate:

$g(m-m',n-n') = (m-m')(n-n')x(m-m'+n-n') + (m-m')(n-n')x(m-m'-(n-n'))$

Now evaluate:

$y(m-m',n-n') = (m-m')(n-n')x(m-m'+n-n') + (m-m')(n-n')x(m-m'-n-n')$

The only difference being the signal of the last $n'$, which makes it not Shift-Invariant.

It is my first time doing this process with a 2D system, so I'm really confused, especially with the system being on terms of $x(m+n)$ instead of $x(m,n)$

I'm following this tutorial

Thanks in advance for the help!


texts: How does a Huffman encoded message gets unified before channel encoding?

texts:
I aim to understand the signal entire transmission pipeline. Currenlty, I am facing a problem regarding the handling of a Huffman encoded message.

Example:

Message $X$ contains symbols $a(50\%)$, $b(30\%)$ and $c(20\%)$.
Huffman Code with code word length $2$:

\begin{align}
cc &= 11 \\
bc &= 101\\
ac &= 011\\
\vdots &=\vdots\\
aa &= 0000
\end{align}
There are code words with different lengths. When I go further down the signal transmission pipeline i. e. modulation or channel coding, both requisite bit packages of equal length.

Question: Where and how do the Huffman encoded code words get unified in its length?

Suggestion which doesn't work:

I always take 8 bits regardless of the encoded symbol.
$$11111111 = cccccccc$$
$$101101101 (9\text{bits})\implies\text{cutoff 1 bit} \implies 10110110 (8\text{bit}) \implies bcbc?? \\\implies\text{doesn't work}$$


texts: Why does the separable filter reduce the cost of computing the operator?

texts:
A separable filter in image processing can be written as product of two more simple filters. Typically a 2-dimensional convolution operation is separated into 2 onedimensional filters. This reduces the cost of computing the operator.

Why is the cost of computing lower, if I use separable filter? I can not understand, why having 2 filters instead of one will increase performance


texts: I usually encounter that kind of channel model which is Basis Expansion Channel Model, But I couldn't understand its meaning exactly, and what is it. Could you please help me by providing a simple explanation for it And/Or documents & video which explain it in simple way?


texts: Best Method to Separate square wave and smooth wave

texts: I have a signal consists of a smooth wave and square waves. Is there comprehensive method can separate square wave and smooth signal? I looked for the likelihood ratio test but cannot find any approach to solving it.


texts:
I am rewriting a simulation written in Matlab to C. I have a problem with a transmit data. The data is filtered by a raised cosine filter. In Matlab it was implemented by using the following function firrcos:
h = firrcos(20,0.25,0.25);

Does anyone know how I can find the documentation of this function ( matlab code realisation)?
Does anyone have a simualtion such filter in Matlab or in C?
EDIT1
Given the order of the filter N=20, carrier frequency Fc=0,25, transition band tbW=0,25 and sampling frequency 8.
I need to initialise such filter in  Simulink.
how to determine a filter span and rolloff factor knowing only the parameters above?
EDIT2
Why the filter impulse response of the filter in Simulink does look different as its implementation in Matlab?
In matlab the upper limit is 0, in Simulink it is 10
EDIT 3
How to initialise h = firrcos(20,0.25,0.25); in simulink?


texts: Is Kaiser-Bessel filter good for notch filtering with time-sensitive data?

texts: I'm working with ECG signal processing and want to implement digital notch filter. Would Kaiser-Bessel filter be optimal for signals sensitive to time domain disruptions or should I use different filter?


texts:
I am looking for ANY advice anyone can give me regarding on this problem.

I'm looking to start a project on subtitles, basically, if we take a Youtube video of a breaking news story, subtitles are generated automatically without the need of physically inputting what the speaker is saying. Now, I understand the complexity of this problem, and, I am aware of the amount of training samples I would need in order to carry out such a project.

The question is this: I have had experience in using DTW and HMM in order to train and recognise simple words "Yes", "No" and gained a lot of experience from this and as part of my previous findings I found that the DTW algorithm is slow and therefore would not be efficient for this. For this project, I imagine real-time processing is involved. Would it therefore be a wise thing to implement a Hidden Markov Model for such a problem, or, would another model/algorithm be more suitable?

Here is my basic structure:

I will upload a 3 minute video to youtube, I will then extract the raw audio from this video and then extract the features (MFCC) which will then be used in order to train the model (HMM) which will /hopefully/ identify the spoken word.

Could anyone recommend any papers that could potentially help me with tackling such a problem?

Thank you for taking time to read this. If anything is not understood, please let me know.


texts: Most accurate method of Voice Activity Detection?

texts:
What is currently the most accurate Voice Activity Detection algorithm with high levels of background noise? I would also appreciate if it does not require any manual calibration. Bonus points for examples.

EDIT: I am referring to accuracy as yielding the lowest amount of false positives and negatives.


texts:
I've done something which is not exactly the jpeg algorithm. What I've done is that given an image $I$ of $N\times N$ size, I have computed the DCT of individual $8\times 8$ blocks.

Once this has been done, I have imposed that the top leftmost corner is left intact but the other elements be equalled to zero.

Then i compute the inverse-DCT on that block and use it to reconstruct my image.

The algorithm seems to work giving the following results

Given that I've ignored lots of steps in the jpeg algorithm (all the things related to huffman encoding, quantization matrix etc) why is this simple algorithm working?

Thanks.


texts: Realize Simulink block "Ideal ADC Quantizer" in Matlab

texts:
Yesterday I posted following topic: "FFT alternates '0' for a quantized SIN wave".
During post editing I was perturbed by some affair, I didn't formulate correctly the problem. So, my post was blocked (i.e. "hold on"). My subsequent update didn't modify the post status: it remains "hold on".

Since, I advanced in the problem resolution. The problem originates from erroneous quantization of SIN waveform. For quantization I use Matlab "quantiz" function, that take 2 parameters: "partition" and "codebook". After changing the fragment of code that is related to quantization (please, see below) the problem disappears, i.e. FFT displays correctly for all frequencies of SIN waveform.

dy = (2*A)/2^res;
partition = (-A+3/2^(res+1):dy:A-3/2^(res+1));
codebook = (0:2^res-1);
[index,yq] = quantiz(y,partition,codebook);
yq = 2*yq/(2^res-1)-1;

where:

A - amplitude of SIN wave (=1)

res - resolution of quantizer (10bit)

But nevertheless some incertitude remains: when I to solve the same task in Simulink (using "Ideal ADC Quantizer" block, the results of Simulink simulation are slightly different from Matlab simulation.

Any suggestions ?

Thanks

P.S. Here is Simulink model (with ADC settings)

Here is also comparison of 2 FFTs:

SIN waveform, quantized in Simulink (TOP)
SIN waveform, quantized in Matlab and imported in Simulink (Bottom)


texts: Machine learning to find an optimal set of parameters for a segmentation algorithm

texts:
Using machine learning to find an optimal set of parameters for a given segmentation algorithm.

In the "classical" case of machine learning, in the training phase, the data set is constant and the model fit -- produces a weight vector that maps the data set to the tag of each image label.

Now let's assume a given segmentation problem X, which is done using a given classic segmentation algorithm Y (classic, not Deep-Learning). The goal is to find an optimal parameter set for the Y algorithm under the set of ground truth segmentation. (Motivation: every segmentation algo. Have tuned, parameters, we want to learn them not to fine tune them)

I think about the two approaches of making the this:

Offline - Extraction of General properties - let's say Haralick texture features and try to fit a model connecting between the parameters of the segmentation algorithm Y to the Haralick texture features.
Online - Select random parameters for the Segmentation Y algorithm. Perform a segmentation for those parameters and a specific delta. Calculate the error and then updated the parameters accordingly.

Any thought or example of how the "online" approach could be performed would be welcome.


texts:
Is their an easier way to find variance of function of random variable?

Till now what I am doing is first find probability density function of (function of random variable) then integrate over range.


texts: Is Wavelet Transform better than FT if I'm only interested in knowing the frequencies and not interested of when did they happen?

texts: I'm still in the first stages of learning about these different transformations. But one thing that came to my mind while learning about them is the question above. I learned that FT can only detect the frequencies in a signal without giving us much knowledge about when these frequencies happen. Therefore, WT came here to be a great solution. However, does WT do any better job than FT in detecting the frequencies, or is the time problem the only improvement?


texts: On the application of chaos in signal processing

texts:
Paper: A novel channel equalizer for chaotic digital communication system (DOI, RS link).

I am having problem in understanding their claim which is that a nonlinear system, considered here to be a chaotic system given by Eq (1)
$x[n] = f(x[n-1])$ is represented as a symbolic system $x[n] = 0.b_nb_{n+1}...$ where the $b$'s are {0,1} and so a time series in terms of the binary expansion of a number $x[n]$ describes the dynamics of the system. This is explained in Section 2. Then they say that a linear filter of the form Eq(5)

$x[n] = \sum b[n-k]h[k]$

where the $b$'s are the information bit sequence and the output $x[n]$, is chaotic. So, this Equation according to them is a way of linearizing the nonlinear dynamics of Eq(1). If this is a linear representation, then how come it is chaotic?

I am unable to understand how the bits-- $b$'s that they are talking about is generated and how the binary bit sequence can be used as the input
to the filter of Eq. (5) to get a chaotic data sequence i.e. why
is this representation chaotic? One of the ways to produce symbolic dynamics of a trajectory of a map is by thresholding explained as:

b[n] = 1, if x[n] >= threshold, otherwise b[n] = 0

Is this how the $b$'s are generated from the same map or these bits are coming from some other source?


texts: How to describe correlated noise after the signal is oversampled?

texts: The Gaussian noise in discrete signal models is usually assumed to be independent and identically distributed variables (i.i.d.). Does this mean that the signal must be sampled with the sampling rate of 2W (where W is the bandwidth)? If the sampling rate is faster than 2W, the noise becomes correlated. Now I want to generate correlated noise samples in Matlab, but I am quite confused about how to describe the correlated noise theoretically? I also don't know how to generate correlated noise samples in Matlab. Could anyone explain this to me or give me any tips?


texts: How to Select Point Spread Function Empirically for Image Deconvolution?

texts:
When the captured image is blurring, one way of obtaining a clear image is via image deconvolution technique. In order to perform deconvolution successfully, usually we need to pay attention to the following issues:

Image content, which determines what kind of apriori information you will use (Total Variation, Laplacian and so on) during the image reconstruction procedure.
Image noise level, which determines the balance factor between apriori information and data consistence term.
Point Spread Function (PSF), which is used to measure how blurring the image is.

Here my question is related to PSF estimation. The simplest way of finding the right PSF is to use different PSFs to perform deconvolution, and then select the best one visually. Then my question is how we can tell which PSF is the best visually.


texts:
I am working with speckle noise reduction in ultrasound images. At present I am learning about anisotropic diffusion.I will explain first what I have  understood about anisotropic diffusion.
I learnt the difference between isotropic and anisotropic diffusion using the diagram below:

In case of isotropic diffusion diffusion of the pixel value takes place all across the image.This result in blurring of edges whereas in case of anisotropic diffusion smoothing or diffusion is carried out depending on the image edges and their direction.
It smoothens homogeneous image regions but retains image edges. (I know that the tool that is used to find the strength of the edges and the direction is gradient but I need some more explanation on what is gradient? How we calculate gradient? Please explain me in a lucid manner I have zero knowledge about gradient. Please explain me with easy explanation)
Based on this gradient value we perform smoothing. If the magnitude of the gradient is small then smoothing is done. If the magnitude of the gradient is large then smoothing is stopped.

This graph illustrates the relationship between anisotropic diffusion and gradient magnitude.In the figure the orginal signal is noisy but 2 major peaks are still visible.Applying the diffusison process to the original signal and using the gradient magnitude to attenuate the diffusion process at places where the diffusion process at places
where the edges is strong produce a signal in which the SNR is high.The diffusion at the edges of the signals is attenuated by using a function of the gradient magnitude.(This gradient magnitude equation is what I am unable to understand please see the following equation and explain me in detail. I don't Know why they use divergence and gradient )

( I couldn't able to understand these equations. please explain the equations in relation with the theory above)


texts: I have audio files with silence on 1.0 (max amplitude). I attach an example of audio waveform. I don't know why it is on 1.0? How can I convert it to have silence on 0 (as usual)? I noted that at the beginning of the waveform it is starting from 0 and goes to 1.0 - any ideas why? The files are telephone recordings, they are sampled with 8kHz and coded with GSM. I don't have more information about recording procedure.


texts:
I'm new in DSP, and  I'm working on dsp application involving machinery (Diagnostics based on noise), and to do this I need to make DEMON processing.
I want to process the signal like in the picture (Explaining demon process):

-Firstly I need to make a FFT spectrum.

-Secondly I have to design a sharp band pass filter.

-Finally I should extract the fundamental with the harmonics (I don't have a clear idea about passing from the third graph to the last one).

I don't know how to make this in MATLAB.
If there is any examples in Matlab or any algorithms I will be glad?


texts:
I am pretty new to inverse Fourier transforms and I would like to ask a question. Does anyone know how to bring back to the "sequence domain" this relation below? In other words, get the inverse DTFT of this expression? (Given that C, D and $a$ are constants and you know them):

$$ \frac{C \cdot e^{-j \omega}+D}{(1 - a \cdot e^{ j \omega })^2} $$


texts:
Probably a simple question to answer. I have been trying to use the fft function in MATLAB and have been succesful to get the amplitude spectrum of a known signal. But when working out the phase spectrum I am unsure if its the correct output.
Can anyone explain what the phase spectrum in fft is used for? I have researched other places but have not a satisfactory answer.
If for example I had a pure sine wave what would the phase spectrum show and how will I know if it is correct.
I can give example of my MATLAB code if necessary but if someone can give a basic explanation using MATLAB it will be much appreciated.


texts: Produce musical signal from instantaneous frequency

texts:
I'm implementing the Yin Algorithm in Python so as to extract the pitch of my voice when whistling or humming. My goal is to produce the Gate (Envelop Control) and CV (Pitch Control) signals which can be inputted to an analog synth. I'd also like to write a software synth which takes theses signals as input. That way I can play the synth with my voice.
The top graph below is the output of the YIN algorithm when I whistled a few notes:

I then tidied this up with a low pass filter to produce the signal in the second graph. Finally and perhaps naively,  I produced the third signal as follows:
from scipy.io.wavfile import write
sr = 16000 # sample rate
f = [518.8087307738297, 518.9079938888592, 518.9177212823167, 519.8298830180304, 522.3027794382949, 523.8695096842832, 524.859458031283, 525.4703986196301, 525.4431662533539, 525.6859351990167, 525.6523745060124, 525.9697551477367, ...]
out = [math.cos(2*math.pi*f[i]*(i/sr)) for i in range(len(f))]

So in other words:
cos(2 pi f t)

where f(t) is the signal in the second graph. I expected this to produce a signal similar to that of my whistling recording put with constant amplitude. However, I get a really chirpy sounding signal that doesn't remind me at all of my original recording. If I use the first signal in my graph as f(t) I get noise when I apply it to cos(2 pi f t). What am I misunderstanding here? Here are the signals from samples 20000 to 30000. How should I reproduce a signal reminiscent of my original recording if I have the instantaneous frequency?


texts: How to discard deviating values from standard deviation and running average

texts:
I'm building a inductive vehicle loop detector. By measuring the frequency of a LC-oscillator where the cars will pass over the inductor of the LC-Oscillator.

If the cars pass over the inductor the frequency will change over time according to one of the following profiles.

The frequency will also slightly change / drift based on environmental variables: like temperature, humidity or other variances in the environment of the loop.
To filter these last variations out, I used running average and std_variation based on: This post/comment on stack exchange. And was planning to detect vehicles when the frequency would go too many standard deviations away from the average.

The measurements made when there is a vehicle present shouldn't be added to the average calculation. This is easy to do when a certain threshold is passed.

But the problem is when a car is approaching the frequency will start to change but hasn't yet passed the threshold so these samples are added to the statistics. When a car approaches very slowly the standard deviation will be changed so much that the car will never be detected.

What solutions / alternatives / suggestions do you have to detect approaching cars and discard the values from the statistics for the reference empty loop.

Thanks in advance

Update: because I didn't get any response in the DSP section, I asked the question in the electronics section.


texts: Cross Correlation, how can any signals except the trivial cases be uncorrelated?

texts:
I have been working on a problem where I am trying to subtract two Power Spectral Densities (PSD's) from one another in the following way. $$|F(k) - G(k)|^2 = |F(k)|^2 - |G(k)|^2$$

Which is only valid if the cross correlation terms are 0.

It's my understanding that for signals $f$ and $g$, the cross correlation is given by
$$(f \star g)(\tau)  = \int_{-\infty}^{\infty} \overline{f(t)}g(t+\tau) dt$$
And now that the definition for these to be uncorrelated, $$(f \star g) = 0$$  has to be true for all $\tau$. But what i don't understand is that unless either $f$ or $g$ are just zero for all $t$ there will be a value of $\tau$ where $$\overline{f(t)}g(t+\tau) \neq 0$$ It then follows that if there are any non-zero points then there must exist other ones which cancel so that the integral ends up being 0.

It seems to me that the chances of this happening for any useful finite signal is next to nothing and so it's highly unlikely that anybody could ever use the spectral subtraction.

Can anyone explain what I am missing?


texts: Centre channel derivation using correlation

texts:
I would like to know the algorithm for  how centre channel is derived from rejecting left and right channel in audio upmixing process.
Can someone explain intuitively rather than hard hitting mathematical equations to describe the derivation process ...


texts: Why do we use white noise to estimate echoes?

texts: I'm interested in the case where I have received a signal as a composition of three echoes of the transmitted signal $x[n]$ (each echo has its amplitude and time delay). I know that in order to compare the signals I use cross-correlation. My question is if I use $r_{xx}[m] = \delta[m]$, would that make it easier to calculate the parameters of echoes? And, if so, can you explain me why?


texts: Applying a FIR filter to floating point array c#

texts:
I have designed using MATLAB a FIR filter with some coefficients.

I have an array that is normalized to -+1. The array is float.

I used this method to apply the FIR to the array but I'm not sure if this is fine:

public static float[] FirFilter(float[] b, float[] x)
    {
        int M = b.Length;// b == coffecients of FIR
        int n = x.Length;// x == mySignalSamples
        //y[n]=b0x[n]+b1x[n-1]+....bmx[n-M]
        var y = new float[n];
        for (int yi = 0; yi < n; yi++)
        {
            float t = 0.0f;
            for (int bi = M - 1; bi >= 0; bi--)
            {
                if (yi - bi < 0) continue;

                t += b[bi] * x[yi - bi];
            }
            y[yi] = t;
        }
        //return Convert.ToDouble(y);
        return y;
    }

Am I doing that right?


texts: What is the preferred method of aggregating audio FFT data given variable-size frequency bins?

texts:
I am coding a program which uses a FFT to process audio data. I need to aggregate the FFT output into three bins ("bass", "mid", and "treb") determined by two arbitrary frequency values. The end-goal is, more or less, a spectrum analyzer with 3 variable-size frequency bands.

As the magnitude of the complex numbers obtained from the FFT is bounded above by a known number B, it seems to me that the most intuitive method to aggregate the data would be to calculate average magnitude within a band and then convert the average to decibels referencing B.

This method leaves me with a serious concern, however... Since there are fewer measurements at lower frequencies, it serves to reason that there will exist a higher degree of spectral leakage in a low-frequency octaves than in high-frequency octaves. I fear that this will cause the average for the "bass" bin to trend higher than that of the "mid" and "treb" bins, thus causing a disconnect between the presented data and what is actually perceived. I am already applying a window function to incoming audio samples, but tests of my program suggest that this might still be an issue. As illustration (graph of several window functions, vertical gridlines at each octave, input is simple sinusoid):

Low freq spectral leakage

High freq spectral leakage

Is averaging as stated above the de facto standard for aggregating audio data in an application like the one I've described? Are there alternatives that may be better suited to my use-case?

Is the concern I mentioned well-founded? If so, are there any standard tactics to mitigate the problem?


texts: Can I determine a system's $z$-domain transfer function from its pole-zero plot?

texts: Is it possible to generate the z-domain transfer function from a pole-zero plot diagram?


texts: Frequent update of the Kalman Filter covariance matrices

texts:
I have inherited some code that does vehicle localisation based on two main inputs: sensor input from the vehicle odometry and map localisation based on matching camera images to road features. Both tracking routines works reasonably well, and the outputs from both are fed into a Kalman Filter (the OpenCV one is used) with a reasonably good output under normal circumstances. However, as we round corners, we get a lot of lateral drift and lose visual tracking, so to compensate (?), we double or so the covariance for the X, Y and Yaw values for the measurementNoiseCov, as OpenCV calls it, resetting them after we get back on track; depending exactly on how we fudge the values, the match to Ground Truth improves to some degree, but I think we're just stabbing in the dark and getting lucky occasionally.

Does this make sense?

We also further apply a Jacobian matrix to the X and Y covariance values (sorry, not familiar with the markup:

Jac = [cos(yaw) -sin(yaw) sin(yaw) cos(yaw)]
measurementNoiseCov = Jac * measurementNoiseCov * Jac.t()

Does this also make sense? I've tried reading up various papers, but I haven't really been able to make much sense of them.


texts: Discrete Fourier transform of an exponential decay

texts:
I have a vector with an exponential decay, using Numpy:

t=np.arange(128)
k=0.1
decay=np.exp(-k*t)

I would like to compute the discrete Fourier transform (DFT) of decay so I get the same result as applying np.fft.rfft(decay, n=128*2). I tried the formula described here plus some similar ones (without square terms in the denominator) but I never got the same result. The final result I want seems to be a one-sided Lorentzian? The reason I want to do this is because computing a Lorentzian is faster than computing an exponential and then applying fft.

To summarize, is there an easy way to compute the DFT for a given exponential decay function of known k?


texts: Effect of zero padding an odd symmetric FIR filter in the time domain

texts:
I have a symmetric lowpass FIR filter with 1149 time domain taps (all real  coefficients). For implementation purposes, it would be easier if the filter had 1200 taps.

Since it has an odd number taps, can I zero pad it to 1200 time taps and keep the phase and magnitude response the same?

It seems like these are my options:

[25 zeros, 1149 taps, 26 zeros] which delays the filter but doesn't change the frequency response
[51 zeros, 1149 taps]
[1149 taps, 51 zeros]


texts:
I have been trying to understand Discrete Fourier Time Series (NOT Transform).

It is defined as

$$a_k = \sum_{n=0}^{N-1} x[n]e^{jk\frac{2\pi}{N}n}$$

where N is the Time period and an integer (by definition), and $n$ goes from $0 ... N-1$.

Fair enough. But when N = 0.2 second as the time period of the wave, then how we define $n$, as $N-1$ is negative. I think here we should take $N$ as 200 miliseconds. And then loop $n$ from 0 ... 199.

But then the terms $x[n]$ (the samples) can be defined over either 200 milisec OR $2*10^8$ nanoseconds and so on. So for 200 ms case, we need 200 samples. But lets say I have taken 100 samples distributed equally over 200 ms time period. Now how we define $x[n]$ in this case, should I do like this:  $x[0]=1, x[1]=0, x[2]=1,...$ That is, set alternate values to zero?

Because in the above equation, I need 200 values of $x$.

Or Better (I think):

Define $1 sec = 500ss$, where $ss$ is a hypothetical new unit of time, in that case time period is $N=0.2*500ss=100ss$ (with the condition that the final value is an integer). In this case we can loop over 100 samples easily without worrying over setting alternate values.

Can anyone kindly help me with this or on my thinking above.

Best Regards,


texts: How to properly perform convolution on bitmap image?

texts:
Correct me if I'm wrong, I should read bitmap into matrix of float values where I would get numbers up to little more than 16*10^6, then I should expand my image matrix to size 2^k putting the original image matrix into top left corner of the new expanded matrix.

I should then expand given filter to that size (you could help me on this one I'm not sure how to do it, with what to fill it and how to reorganize it), then apply 2 dimensional fft on both matrices, then multiply them dot by dot and finally do inverse 2 dimensional fft to get wanted picture! Where do I get wrong? If I have filter like this:

0   0.2  0
0.2 0.2 0.2
0   0.2  0

What would this filter transformed to 16x16 filter looked like? Thanks for help, fft part was easy for me but this...


texts: Why does toning up a piano make it sound similar to that a string instrument

texts:
I have a .wav file of a piano being played at 220 hertz. When I tone this up to 880 hertz, it begins to sound "stringy". However, if I were to use the piano plugin in fl studio and play it at 880 hertz, the piano would still sound normal.
My question is why a piano starts sounding stringy at higher frequencies(although I do know that a piano is in a way, a string instrument) as well as how to I can tone up a piano audio file so that it still sound like a piano(I am hoping to find a way to programmatically tone up a piano audio file as opposed to a program)
Link to file of a piano being played at 220 hertz(from fl studio): https://drive.google.com/file/d/1bUzBVXYrKS2Mzcg4VFEoBjIXqgGz1sFk/view?usp=sharing
Link to file of the above file being sped up to 880 hertz:
https://drive.google.com/file/d/1H16aydDErdBrrkDtHScfgITqrmMdi1I7/view?usp=sharing
Link to file of a piano being played a 880 hertz(from fl studio):
https://drive.google.com/file/d/1sEN4nvYS6QJeU0gtOruKvQGvDoZpzTx-/view?usp=sharing


texts: Choosing right cut-off frequency for a LP filter in upsampler

texts:
I'm implementing a upsample function in Matlab but it's not perfect right now,for reasons I'm not sure. Here is my code:

U=5; %upsampling rate
N = U*length(x);

% Init
x_up = zeros(1,N);

% Zero-pad
ind=1;
for n=1:N
    if mod(n,U)==0
       x_up(n)=x(ind);
       ind = ind+1;
    end
end

%% Design a LP filter
tol = (1/U)/2;
[n,fo,mo,w] = firpmord([1/(2*U)-tol 1/(2*U)+tol],[1 0],[0.01,0.01]);
 b = firpm(n,fo,mo,w);

x_up = [zeros(1,n),x_up]; %To avoid group-delay
x_up = conv(b,x_up,'full');
x_up(abs(x_up)<0.01)=0;
% Remove leading and tailing zeros
x_up = x_up(find(x_up,1,'first'):find(x_up,1,'last'));
x_up = x_up(1:N);

And these are the results:

From theory perspective, everything looks like fine to me but how can I make my upsampler perfect?


texts: Why need an low pass filter after up-sampling?

texts:
I understand why there need an low pass filter before down-sampling, the sample frequency need to be at least twice of the max frequency signal, else there will be alias issue.

But base on the Wiki page, we need an lowpass filter after up-sampling.

  Upsampling requires a lowpass filter after increasing the data rate,
  and downsampling requires a lowpass filter before decimation.

I don't understand that, can anyone explain it?


texts: Acoustic features distinguishing the male and female voice?

texts:
I would like to use MFCC analysis to distinguish between a male voice and a female voice.

Are there any particular quantifiable characteristics consistent with, and exclusive to, either gender? (E.g., energy, fundamental frequency, excitation, the presence of certain waveforms, etc.)


texts: (Newbie question) Calculating the frequency spectrum

texts:
I'm quite new to this topic, with some basic knowledge however.
I need to analyse an audio signal for different characteristics.
Like the audio editor I use (an older Version of Audition, v.3)
I would like to calculate the occuring frequencies.

For every time stamp and
the overall occurences of the frequencies of the whole audio.

If I'm not totally wrong then for calculating the frequency spectrum
I have to take an interval (window) of samples.
The DCT/ FFT of that returns the complex fourier coefficients
(whose magnitudes are the amplitudes of the frequencies).
Correct so far?
What I do not understand:
What is the frequency spectrum of a specific time stamp then?
Or does it only make sense for a complete interval/ window of samples?
But Audition shows a different frequency spectrum for every time stamp...
Is it something like a "sliding window" there, calculated for the center sample?
Associated with the above:
If it should be (the middle of a) sliding window:
How to calculate spectrums for near-border timestamps
(which don't have complete surroundings)?
And how to calculate the overall occurences of the frequencies
of the whole audido?
I can't use the sliding windows for that, as it would count
frequencies multiple times (due to the overlapping) ...
Is it the average of all the side-by-side (= non-sliding) windows?
Or am I totally wrong with it?
Again: I hope my questions don't hurt too much. ;-)


texts: Are both halves of a symmetrical FFT result required to generate the original waveform?

texts:
Performing an FFT on a purely real signal produces a symmetrical result. I want to recreate the $50\textrm{ Hz}$ mains hum to actively subtract it from my signal, but:

are both halves of the FFT result required to do this?
Is there any drawback to only using one half of a symmetrical FFT result?


texts: How to choose the frequency grid when using DFT with numpy (FFT)

texts: I'm currently trying to learn how to calculate DFT using FFT with Python. However, I have been struggling to find how should I choose the frequency grid when plotting the final calculated DFT values out of the data samples that I have. Any helpful insights will be appreciated!


texts: How Can JPEG Be Used to Realize a Transfer Application with a Fixed Bit Rate?

texts:
For simplicity, assume a fixed bandwidth (5MB/s) and that each second an image with 12MP is generated. The quality of the image should be as high as possible (in terms of PSNR). Which compression rate is necessary and how would the task differ or become simplified when using JPEG 2000 instead?

Thoughts

When the image is a colored image with 24bpp, then the size of a 12MP image would be 12*10^6*24/8 Byte = 36 MB. That divided by 5MB yields a compression rate of approximately 7. Then transferring works as desired. However, I don't see how the task changes when using JPEG 2000.


texts: Metric Spaces: Why $L_\infty$ selects the maximum value

texts:
I have a basic question about the metric spaces. There are several metric spaces like $L_1$, $L_2$ to $L_\infty$. The $L_p$ metric is defined by the following equation:

$$d_p(x,y)=\left(\sum_{i=1}^{n}|x_i-y_i|^p \right)^{1/p}$$

Now, when $p = \infty$, then the equation of the matrix is following:

$$d_{\infty}(x,y)=\max_{i=1,2,\ldots, n}|x_i-y_i|$$

Now, I am taking the value of $x$ as $x = [1,2,3]^T$ (Transpose) and compute $L_p$ metric for, $p = 1,2$ and $\infty$.

My question is, why $L_\infty$ metric choose the maximum value.


texts: How to scale a signal to get desired variance

texts:
I am new to dsp, and I'd really appricate it if someone please help me with this problem. I guess it's a basic simple question, but I cannot get it write. Here is the question:

The variance of a random signal generated using MATLAB command randn is approximately 1. We need a random signal with variance 0.01. With which factor you need to scale the signal?

With amplitude? Like we need to multiple the amplitude of the signal by 0.1?


texts: What is the name of this transform similar to the Radon transform?

texts:
I have a 2D image (obtained using computed tomography) that I'm "transforming" for image segmentation purposes, and I'm looking for a formal way of describing the transformation I'm doing.

The transformation I'm doing defines a centre point $(x_0,y_0)$, angles $\theta_i$ from 0 to 360 degrees, and a set of centrifugal lines defined by $x_0 + L\cos(\theta_i)$, $y_0 + L\sin(\theta_i)$. For simplicity, we can imagine that the original image is circular and thus $L$ is simply the radius of the circle.

The result of the transform is simply the 2D "stacking" of the intensity function $I(x,y)$ on each line defined above. This is essentially "unrolling" a circular image into a 2D image.

It looks superficially similar to the Radon transform, but there's not integral involved - I'm simply copying the intensity values.

Does this have a formal name?


texts: Finding PHASE between two sinusoids with FFT/DFT (ArduinoFFT w/ C)

texts:
I am having trouble finding a known phase between two data sets, lets call them data set 11 and data set 12.
I am obtaining a sample size of 1024 samples, at a sampling rate of 500kHz with a total sample time of 2.048ms.
All data and code used in this question can be found at this repository - https://github.com/smake5730/fft_phase/graphs/contributors
As can be seen from the sample data below the two data sets show the voltage is leading the current by around 90°. (zoomed in)

When I compute the FFT with 1024 bins I get clear peaks. (zoomed in)

I apply the Hanning window during this and do not use zero-padding.
I use the location of the largest peak with the atan2(a/b) method to obtain the phase and find that I get the following below. The first data gives me +90° and the second data gives me -90°. The frequencies are correctly identified.

I have tried adding zero-padding to the end of the signal and it does not solve the issue. I have also tried upsampling and it does not give the correct phase either.
Does anyone have any ideas/hints on what I could try or where I am going wrong?

EDIT
As was pointed out below, my code takes individual bins and incorrectly matched bins were used in the second set.


texts: I've been searching for a few days for a simple c/c++ or python library that will help me gather parameters from a pulse similar to the one in the image below. I will be getting the data from an NI PXI oscope or digitizer and am looking for a library to help me out with the processing. I did discover that MathWorks has something that would work, but i'm looking for something more c++ or python. Anyone know if this exists?


texts:
I'm sampling a signal at 44100kHz, and I have 1024 samples on which I perform an FFT.
My bin resolution is therefore around 43 hz/bin, so the frequencies I get energy for are multiples of 43hz: 43Hz,86Hz,129Hz etc...

The problem is that I the frequency I need to calculate the energy for lies between those bins! Specifically, I have:
BIN[389]= 16750 Hz
BIN[390]= 16793 Hz
but I wish to calculate the energy for 16781Hz, 16824Hz,...

Is there a mathematical manipulation I can pull off to get the info I need? zero padding? Or perhaps multiplying my sample by an exponent before performing an FFT?

Thanks for the help


texts: Does low-pass filtering a square wave cause a 'ringing' to develop in the signal?

texts: Using the figure below as an example, I wonder if it is possible that the small oscillations in the signal at the time of each step shift could be caused solely by the application of a low-pass filter to a pure square wave?


texts: What happens when you wrap a 3x3 kernel at the corners of an image?

texts:
I am puzzled by what actually happens when you process border cases when applying an image filter. For instance if I apply a 3x3 Gaussian kernel to the top left pixel[0][0], the remaining pixels that are unable to convolute will go to the right and bottom of the image. But do you multiply them again or u replace the original pixels?

[1, 2, 1,
 2, 4, 2,
 1, 2, 1] // 4,2 & 2, 1 will convolute with the pixels in image but how about row 1,2,1 and col 1,2,1 ?


texts:
Suppose there is a two-deimensional image which consists of pixels. In every pixel, there are 0 to n apples with different colors， which can be digitalized(e.g.[0,10000]).

So we can plot a histogram for the color distribution of apples in every pixel. Some color may be more significant in this histogram. Let's call them color bumps.

The image below is for one pixel.

How to detect areas (they also consist of pixels ) with a particular color bump? In this kind of areas, apples in color channel, say [0.2,0.5] are more significant than apples in other channels.

The shape of an area is irregular generally. We can set color channel we are interested in and the lower limit of significane.

My idea is:

We need to find a pixel as a seed, let it grow, and set criteria to find the boundary where a growth stops.

Or we find pixels one by one, then connect pixels to from a continuous area.

Which kind of algorithm is good at this? You have ever met this kind of example in practise?


texts: Fast convolution with very high order FIR

texts: I am investigating the overlap-add and overlap-save methods for processing an audio signal with a FIR. The FIR is a measured impulse response of a reverberant space and may be of order greater than 100,000. It appears that in order for O-A to work, the signal block length must be at least this length to keep the amount of overlap less than one block length. For example, if the signal block length is 100 ms of audio (L = 4410) and the IR is 3 s of reverb (M = 132300) then each block convolution produces 127890 outputs that must be added to subsequent block convolutions. Am I missing something?


texts: How to specify 2-D coordinates of an object in matlab?

texts: This is the scenario: I marked two axes (figure below) on a board and a camera(global vision system) sees the board. I want to make the vision system to recognize $X$ and $Y$ axes and specify coordinates of an object (preferably a colored one )in the form of $(x,y)$. How can I do that? is there any functionality in matlab to help me?


texts: Fourier coefficients of sum of two functions with different fundamental periods?

texts:
If we assume $\quad x(t)\leftrightarrow a_k\:$ and it is periodic with fundamental period T.
How can we determine the fourier coefficients of the sum
$x(t-7)+x(-2t+3)$
I know that $x(t-7)\leftrightarrow e^{-jk7\frac{2\pi}{T}}a_k$
But, since these two functions have different fundamental periods we cannot apply linear combination rule. So how can we find the related coefficients? Thank you.
EDIT: After Stanley Pawlukiewicz's hints
$x(t-7)=\sum\limits_{k=-\infty}^{\infty}a_ke^{jk\dfrac{2\pi t}{T}}e^{-7jk\dfrac{2\pi}{T}}$
$x(-2t+3)=\sum\limits_{k=-\infty}^{\infty}a_{-k}e^{jk\dfrac{4\pi t}{T}}e^{-3jk\dfrac{4\pi}{T}}$
This new function is periodic with $\:T_0=T\:$ since $\:LCM(T,T/2)=T$ Thus,\begin{aligned}
\bar{a_k} = \left\{ \begin{array}{cc}
                a_k e^{-7jk\frac{2\pi}{T}}+a_{\frac{-k}{2}}e^{-3jk\frac{2\pi }{T}} & \hspace{3mm} \text{even}\;k \\
                a_k e^{-7jk\frac{2\pi}{T}} & \hspace{3mm} \text{odd}\;k \\
                \end{array} \right.
\end{aligned}


texts: Recognizing hand-written archaeological signs

texts:
I have 75 images of handwritten signs from which I extracted 7 Hu moments and solidity features. How can I find similarities among them to train a classifier and predict the value? I thought SVM was a good choice, but I don't have a target vector (what do I put? I do not know differences in signs that I can say there are, say, three labels, such as "circle", "triangle" or "square").

Is cluster analysis more appropriate? If yes, What is best method?
I am using the scikit-learn module in python.

http://scikit-learn.org/stable/modules/svm.html

http://scikit-learn.org/stable/modules/clustering.html


texts: FFT giving a huge magnitude of first frequency and pretty much zero after that

texts:
So I have a (visually) very noisy time series signal and I have applied the fast Fourier transform using numpy's fft function. I am wondering why I am seeing the magnitude of the coefficient for the first frequency very large, actually equal to the number of samples ( 256 samples ) in the data, and the rest of the coefficients very low.

I am assuming this means there there is no periodic signal being extracted from the data, but I wanted to get a second opinion about it. How do I interpret this result? Maybe I am doing something wrong.

Input Signal:

Frequency Coefficients:

Zoomed Picture:


texts:
I'm interested in how does "image synthesis" in audio synthesisers such as Metasynth work.

Image synthesis is when a picture is read into a program and "interpreted" into sound.

But how does it work?


texts: Laplace of step and integration are same?

texts:
Why do we have Laplace transform of a step function and integrator is same.

\begin{align}
\mathcal L\left[u(t)\right] &= \frac 1s\\
\mathcal L  \left[  \int dt\right]  &= \frac 1s
\end{align}

Please clear my doubt on this.


texts:
Could anyone suggest the best algorithm for a real-time Car recognition (say in a parking space)?
I am planning to implement the same on FPGA as well. Kindly suggest.
Thank you.


texts: What's the Q of a pole at the origin of the s-plane?

texts:
I'm writing a simple function in Python to return the Q of a circuit, given its poles.

The Q of a system with pole p, can be found using $Q=-\frac{\left|p\right|}{2*Re(p)}$.  Obviously, in a natural system, such a pole must come as part of a pair, and both would yield the same result.

For coincident poles on the real axis, this gives a Q of 1/2 (critically damped).  For poles on the imaginary axis, that gives a Q of $\infty$ (undamped).

Writing the function left me with the question, as a matter of completeness, of what to do if the pole is at the origin.  Is there a customary value to assign to poles at the origin?

Background material:

For anyone interested in where the equation relating pole location to Q comes from,   It derives from the 2nd order transfer function:

(source)

Graphically described here:

(source)

A decent discussion of Q and damping in 2nd order systems can also be found here:

(source)

which gives an excellent review of how the pole placement corresponds to various damping characteristics.


texts: Zero-Padding seems to CHANGE FFT of signal!

texts:
I am having trouble with zero-padding. As I understand it, in theory, zero-padding in the time-domain should 'sinc-interpolate' the FFT of the signal in the frequency domain.

This would mean, that 1) none of the values of the original signal change. 2) the overall profile of the FFT doesnt change- aka the peaks remain around the same point.

However, in simulations this does not work.

For example, I FFT the following sequence

  x=[0 1 0 1 0 1 0 1]

at an imaginary same frequency, Fs=1Hz. With no zero-padding (FFT-8),

  |X(f=.3125)|=4.

With 2x zero-padding (FFT-14),

  |X(f=.3125)|=2.6.

As $N \rightarrow \infty$, $|X(f=.3125)| \rightarrow 0\ $. Also, the peak of the FFT shifts from .3125 to .25 as $N \rightarrow \infty$.

Here is my code. The relavent parameter is ZP, which controls the amount of zero-padding (N=8*ZP):

ZP=0;       % of times of original length of signal to ZP with

x=[0 1 0 1 0 1 0 1];
x=[x,zeros(1,length(x)*2^ZP-length(x))];
X=fft(x);

Fs=1;
L=length(x);
df=.5*Fs/L;
t=(1:L)*(1/Fs);
f=(1:L)*df;

figure(12),
subplot(211), stem(x);
subplot(212), stem(f,abs(X)); xlim([-.02,.52])

test_pnt=.3125;
I=find(f==test_pnt);
title(['abs[X(' mat2str(test_pnt) ')]=' mat2str(abs(X(I)))]);


texts:
What does the spatial correlation of a signal say about it?How is it different from autocorrelation?

`


texts: Let a LTI system be causal and stable with the transfer function being... show that

texts:
if the system is an  IIR LTI causal and stable one, and the transfer function is

\[H(z)=\sum_{n=0}^{\infty}h[n]z{^{n}}= \frac{G}{1 -\sum_{k=1}^{p}a_kz{^{-k}}}\]

show that the cepstrum of this system can be calculated by the following equation
\[\hat{h}[n]= a_n + \sum_{k=1}^{n-1}\left ( \frac{k}{n} \right )\hat{h}[k]a_{n-k}, n\geq 1\]
where
\[\hat{h}[n]=\frac{1}{2\pi}\int_{-\pi}^{\pi}log[H(e{^{j\omega}})]e{^{j\omega n}} d\omega\]
is the complex cepstrum.
Im basically skipping a lot of parts in defining cepstrum but basically
\[\hat{H}(z)= log[H(z)] \]

Any Ideas what should I look into for answering this question?


texts: How do you find the phase of the DFT of a discrete signal?

texts:
My question is similar to this one and this one, but neither answers address my concern.

Suppose you have a signal x(n) = {-1,2,-3,2,-1} where we can assume x(0) = -3.  So this is an even signal.

How do you find the phase of the DFT of x(n)?


texts:
I am trying to compute the variance of AWGN in the system for finding the BER with $Q$ function.
The PSD of the AWGN is $N_0/2$, my answer was $N_0T$ but it was incorrect.

This is my calculation (incorrect):


texts: How do I find amplitude modulation effects in natural signals

texts:
It is relatively easy to discover overlaid (additive) signals in natural phenomena using wavelet decomposition, Fourier Transforms, CEEMD, etc, because addition in the time domain is the same as addition in the frequency domain.

However, I cannot find a clear reference on how to determine if amplitude modulation is occurring in a natural phenomena.   This type of relationship between known or unknown sources results in convolution in the frequency domain, and I can't figure out how to process a time series of data to elicit possible sources of such a signal.

Let's take for example a commonly available series - monthly sunspots.  There's clear peaks at 10 and 12 year intervals that can be seen by taking an FFT, resulting in the commonly known 11 year cycle average, which makes one suspect amplitude modulation somewhere in the natural processes of the sun.  How would one determine a suspected carrier frequency or prove that some sort of amplitude modulation is taking place?


texts:
I'm trying to figure out how to calculate the dBFS for a complex input. I have an AD9361 part which has a 16-bit A/D and I believe outputs I and Q samples. Now I know you can calculate the dBFS for a real valued 16 bit signal as

20log10(abs(sample)/32768).

But I don't fully understand how to incorporate a second data stream into this calculation.

My overall goal is to calculate the dBFS of the incoming signal and use it to compare against a set-point dBFS value for an AGC. and to adjust front-end attenuators as necessary.

Thanks!


texts: Python - preparing wav file so speech recognition (google) can return accurate results

texts:
I am trying to convert my wav files from playing tennis into text.  I intend to use Google Cloud so ideally this would work with their Speech Recognition tool.
TLDR:

Tried denoising
Tried slowing down
Tried different language settings in googles tool
Know it works using other examples

I know this transrcibes relatively well by using the asset fish example (see Onedrive link), and my own tests in an office environment.  However I am unable to make it work with the real files (in one drive labelled ben1 and ben2).
I have tried denoising the audio with noisereduce and to my ear this sounds great (a lot cleaner).  However googles tool is not able to pick up the words.  Playing with the fish example with noise added, google can still pick out the words quite well.
import soundfile as sf
from pydub import AudioSegment
convertto16bit(path_gen + "210418_BenJJO/", "Audio_Raw_210418")

#read in and cut to the appopriate piece
Ben = AudioSegment.from_file(path_gen + "210418_BenJJO/" + "Audio_Raw_210418upd" +".wav" )
Ben1 = Ben[1876*1000 : 1890*1000]
Ben2 = Ben[1817*1000 : 1822*1000]

#save
Ben1.export(path_gen + "210418_BenJJO/" + "ben1" + ".wav",format ="wav")
Ben2.export(path_gen + "210418_BenJJO/" + "ben2" + ".wav", format ="wav")

convertto16bit is my own function because the data is originally in Subtype: IMA_ADPCM format.  This isn't the problem as I do have some examples that work almost perfectly.  See Pascal2
An example of where I have tried to remove the noise.
import noisereduce as nr
data, rate = sf.read(path_gen + "210418_BenJJO/" + "ben1.wav")

# select section of data that is noise
noisy_part, nrate  =sf.read(path_gen + "210418_BenJJO/" + "bkgrnd_profile.wav")

# perform noise reduction
reduced_noise = nr.reduce_noise(audio_clip=data, noise_clip=noisy_part, verbose=True)

sf.write(path_gen +"210418_BenJJO/"+ "ben1_lessnoise_novol" + '.wav', reduced_noise, rate)

The audio in ben1 says "double fault, mistake, my advantage" but google returns only my advantage.  The background noise I have used to process the file comes from the hours worth of recording so I haven't uploaded that element.

I have also tried changing the speed of the speech, wondering if it cannot hear the difference.  However that also hasn't worked out.
def speed_change(sound, speed=1.0):
    # Manually override the frame_rate. This tells the computer how many
    # samples to play per second
    sound_with_altered_frame_rate = sound._spawn(sound.raw_data, overrides={
         "frame_rate": int(sound.frame_rate * speed)
      })
     # convert the sound with altered frame rate to a standard frame rate
     # so that regular playback programs will work right. They often only
     # know how to play audio at standard frame rate (like 44.1k)
    return sound_with_altered_frame_rate.set_frame_rate(sound.frame_rate)
ben2_slow = speed_change(Ben2, 0.9)
ben2_slow.export(path_gen + "210418_BenJJO/" + "ben2_slow" + ".wav", format ="wav")

Audio files are saved in this onedrive folder
Noisereduce example here
What steps am I missing to make this work?
Thank you in advance,
J


texts:
I know there are 4 types of FIR filters with linear phase, i.e. constant group delay: (M = length of impulse response)

Impulse response symmetrical, M = odd
Imp. resp. symmetrical, M = even
Imp. resp. anti-symmetrical, M = odd
Imp. resp. anti-symmetrical, M = even

each with its traits. Which of these types is most commonly used in FIR filter with linear phase design and why? :)


texts: Variant of discrete fourier transform that isolates phase delay?

texts:
I'm not quite sure of the mathematical terminology here but...

Is there a variant (or post-processing) of a Discrete Fourier Transform that separates the shape of a signal from any phase shift applied to the whole signal?

For example this image:

and this one:

should differ in at most 2 coefficients (one for each dimension in which it is shifted) in the frequency domain.

Alternatively is there a way to index images so that any image can be found in a database given a translated copy as a key?

Notes

My images are all 1D or 2D with power-of-two sizes (but not necessarily square.)
This project has nothing to do with OCR (even though I used a character glyph in the example.)  Please do not suggest OCR-specific algorithms/libraries!


texts: efficient Noise cancellation & suppression algorith to use in VoIP for low latency

texts:
I am working on Noise suppression and cancellation in VoIP media engine. I am looking for noise cancellation & suppression algorithms and its implementation available with real-time low latency algorithms.

I had worked with webRTC noise cancellation implementation and it works well, but I want to explore more on this. I googled this and am not getting any concrete output. I need help from the community and experts to get better an idea of available noise cancellation and suppression algorithms. Below are findings:

Noise cancellation available implementation:

WebRTC
Speex

Noise cancellation available Algorithm:

Least Mean Square Algorithm

finding more on Github is giving lots of results, but needs advise from experts to the way to proceed for choosing Noise cancellation & suppression algorithm for VoIP with low latency.


texts:
I want to apply the following steps in matlab

1) Read the audio data

2) Apply window function on that data

3) Apply fft on the result of window function

4) Make power spectrum of fft

5) divide power spectrum in Barks bands

[y,Fs,bits] = wavread('file1.wav');
Nsamps = length(y);
ham= hamming(Nsamps);
ham_fft = abs(fft(ham));
ham_fft = ham_fft(1:Nsamps/2);      %Discard Half of Points
plot(f, ham_fft)
xlim([0 1000])
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('FFT of Hamming Window of  a an audio');

I am not getting the correct waveform , want to draw the spectrum and then Divide into barks bands .


texts:
About filter design, mostly we want to control frequency amplitude response and the linearity of phase response. I wonder whether there are FIR filters specialized to delay signal?

For instance, let's say I want to process a multi-frequencies signal, delaying 1200Hz for offset = $\frac{\pi}{8}$ ($f_s$ = 44100) and leaving 500Hz unchanged.

Is such a FIR filter possible? How can I do it?


texts: How to combine a perfect signal with a limited dynamic range with a poor one with high dynamic range?

texts:
I have two sensors that measure speed $v(t)$ of a moving vehicle. The first sensor produces a signal $f(t)$ which is a very accurate estimation of speed. However, it only works for slow to moderate speeds and beyond a certain limit, it simply fails to report anything. Let's assume we can model this behavior with an additional output of this sensor using signal $h(t)$, which is $1$ while $f(t)$ is valid and is $0$ when $f(t)$ is invalid.

Now, the second sensor produces signal $g(t)$ for all speeds but it is not particularly accurate. When $h(t)$ is 1, i.e. when speed is low and the first sensor produces perfect results via $f(t)$, the signal from the second sensor could be modeled as:

Equation 1: $g(t) = \beta_{0}(t) + \beta_{1}(t)v(t) + \epsilon$

The parameters for this linear relationship, $\beta_{0}$ and $\beta_{1}$ are unknown. All we know is that they vary very slowly over time.

So the problem is to estimate $v(t)$ given the 3 signals $f,h,g$.

One solution is of course to forget about $g(t)$ and just report the last value of $f(t)$ when it becomes invalid. Effectively, it means to saturate the output at a certain high speed.

Alternatively, my initial idea was to use a form of rolling linear regression to estimate the $\beta$ parameters with a fixed window size $w$: When $h(t)$ is $1$, I simply report $f(t)$ and update $\beta_{0}$ and $\beta_{1}$. When it is $0$, I report a $\hat{v}(t)$ estimated using $g(t)$ and the last calculated $\beta$ coefficients. This is obviously very slow since I have to solve a linear regression at each sample.

Questions:

(1) Does the idea of using rolling linear regression make sense? If yes, how can I do it fast?

(2) Would it be possible to something like a Kalman filter to solve this problem? I'm not sure how to express this problem in a linear state-space model.

(3) I guess the most challenging question would be what to do in the case that $f(t)$ is quantized (e.g. an integer value) while $v(t)$ and $g(t)$ are not. I guess we might be able to simulate it by assuming a uniform distribution for $\epsilon$ in equation 1.


texts: Linear Chirp parameters from a segment of the signal

texts:
Edit:" please see the attached figure. The blue part is all I have. Also, you can neglect the noise term. Assume the signal is deterministic. Typical values of the unknown parameters $\alpha$ and $\omega_0$ are in the the range [0.25,5]. Note that all the parameters are unknown $A \omega_0, \alpha, \phi_0$. The setup hints at curve fitting which I did but don't prefer."

I have a small part from a chirp signal

$$s(t)= A \cos\left(\omega_0 t+ \frac\alpha2 t^2 + \phi_0\right)+n(t)$$

with very low start frequency $\omega_0$  and chirp rate $\alpha$.

The signal is sampled at high sampling frequency $f_s$. But the available time domain signal is short, i.e. barely a complete cycle. The amplitude of the signal and the phase shift are also unknown. Are there ways to figure out the chirp parameters other than curve fitting or spectrogram?


texts:
I am trying to use a scanner with vertical banding. The scan head's black and white point calibration numbers have a modulation pattern on top of them. I am not sure if the calibration's banding is what causes the modulation or vice versa.
Is there any way to modify the calibration to make it go away?
I symmetrically discarded the high power bins away from 0 and the banding was somewhat diminished but still present. Is there a better solution?


texts:
I want to take the DFT of the data shown in the image. Note: my data consists of $(x,y,z)$ values for which I have shown $(x,y)$ in the image (i.e. their location). '$z$' is the amplitude of the data points which I haven't shown. I have some questions:

Is 2d DFT for this data the same as taking multiple 1d DFT for all the rows? (Should I venture into the world of 2d Fourier to analyze this data of mine or is 1d analysis sufficient?)
As it can be seen ,my data is highly scattered, do I need to interpolate it before applying DFT? If yes, which interpolation would you suggest ? Or, can I use a non uniform DFT ?

I am a newbie to DSP and I understand my questions are elementary. So if you feel it does not need to be answered here, you may direct me to a web-page or a link to a question-answer/discussion which addresses this issue.

Also no data does not exist between the blue dots i.e the blue dots represents the points where I have the height (amplitude) value and the in between 'white' points I do not have the height (amplitude).


texts: How to design a filter with smoothness regularisation?

texts:
I am rather new to the DSP topic. However, I would like to filter a signal with lowest error and highest smoothness.

Until now, I was using tikhonov regularisation inside batch regression with some kind of kernels.

y=Ax, with x= (X[0], ... X[t])^T

The issue is however I do not know how to assess the error in the frequency domain then.

Could anyone advice where I might look for a discussion on this subject?


texts: What FPGA development tools recommended for building audio music synthesizers?

texts:
I want to experiment with FPGAs to build audio synthesizers. They would end up being manufactured in quantities of less than 100. I have very little knowledge of FPGAs, but I thought LabVIEW looks like the most intuitive programming option for a beginner. Another option is that I have a programmer friend who is learning OpenCL and keen to learn FPGAs.

I have built many analog synthesizers, and I have also studied simple digital hardware like counters, adders, shift registers.

I don't have this problem that other people seem to have about FPGAs, when they complain that it is not like sequential programming. I don't like the idea of using sequential programming to do real time audio. To me FPGAs seem more natural. This is a reason why I thought of using an FPGA with LabVIEW, as opposed to a microprocessor like the STM34.

Can anyone think of problems I am likely to encounter?


texts: identifying overshoots in given state space system with step inputs

texts:
Suppose I have the following state space system:
$$
\dot{x}(t) = Ax(t) + Bu, \quad y(t) = Lx(t), \quad x(0) = x_0
$$
where $A$, $B$ and $L$ are real matrices, $u$ is a constant real vector (so that the system is subjected to a step input at $t=0$), and $L$ is just an identity matrix. In addition, it is also known that all eigenvalues of $A$ are real and negative.

Given this information, can I know (without solving the system in time) if all states of this system will have a monotonic behaviour (i.e. if a given state is increasing it will keep on increasing and vice versa)? in other words, if any state of the system has "overshoot" like behaviour, is there some sufficient condition to detect it?


texts: what rule has coefficients to follow for an IIR filter to be stable?

texts:
I'd like to play with IIR filters, but not by designing them with algorithm but rather play with the coefficients directly.
i got a stability problem though, because of course IIR filters are sensitive to design, and we have to make sure the filter is stable and will not go to infinity.
So is there a rule that have to follow coefficients that would automatically make the filter stable ? (the sum or product of coefficients, etc)
especially for all pole filters if possible ?
thanks so much
Jeff


texts: Computationally Efficient Ways of Determining If Pixels Are Clumped

texts:
I'm working on an application where I get a video frame that's already segmented into good and bad pixels (as in -- the hardware either coughs up a pixel value or a flag that says "bad"). I want to come up with a figure of merit for the frame that's based both on the number of bad pixels and the amount that they are clumped, with one big clump being worse than a bunch of little ones.

Here's two pictures to illustrate: the left picture has 17 dots 10 pixels in diameter -- it's better, on the theory that the dots are artifacts that can be "seen around".  The right picture has about the same number of bad pixels, but they're all in one dot 41 pixels in diameter -- it's worse, on the theory that having so many bad pixels in a clump may occlude something interesting.

Things I can think to do:

Walk the perimeter of each clump (really inefficient)
Low-pass filter (originally I was thinking to use an FFT and look for high frequency content (not terribly efficient, and not terribly accurate, either, I think))
draw a box around the bad pixels by finding the largest vertical and horizontal extents, and compare the area of that box to the bad pixel count (this could have false negatives if there's a large blob and a few little dots)

Are there known good ways to do this?


texts: How to calculate phase for discrete time complex valued signal

texts:
I am studying Digital Signal Processing course for my Computer Science and Engineering major.

I have to calculate magnitude and phase of following
$$x(n) = e^{(-0.1+0.3j)n}$$
where
$$-10\le n \le 10$$

Here the "e" is Euler's constant. I can calculate the magnitude for an n, by putting a value of n from range and calculating value of imaginary and real part. But how do i calculate the phase? My concept is not clear on this. Kindly explain in detail and as easily as possible.


texts: Distinguish between two vocals by their timbre

texts:
Right now I'm working on a signal processing project, I'm not quite to the point where I'm implementing the DSP algorithms yet (still working on the low level hardware) although I'd like to get an idea of what I can do.

I'd say the goal at best is to be able to distinguish between the two vocal types in this song.  Basically at that point of the song, you can hear the main singers vocals and then a really sporadic background vocal.  The best case scenario would be to separate those two although I'm not quite sure how.  At this point I'll be doing a fast hartley transform implementation and a periodogram implementation, are there any other algorithms I could implement to achieve this goal of distinguishing between the to vocals?


texts: How to compare the qualities of two interpolation (image resizing) algorithms?

texts:
I am implementing image resizing algorithms (Bilinear, Bicubic, Lanczos and a few others).

How do I quantitatively compare them?

I am thinking of considering a large sample of images and running these algorithms on all of them and compare pair wise wrt a standard interpolation implementation. What metric shall I use here? Any other ways of doing the same?


texts: Why must outputs be the same for a pair of inputs for a causal system?

texts:
I'm trying to get a good understanding of causality and I can't wrap my head around the first definition of it, as noted in this Wikipedia article:

  Definition 1: A system mapping $x$ to $y$ is causal if and only if,
  for any pair of input signals $x_1(t)$ and $x_2(t)$ such that

  $$x_{1}(t) = x_{2}(t), \quad \forall \ t \le t_{0},$$

  the corresponding outputs satisfy

  $$y_{1}(t) = y_{2}(t), \quad \forall \ t \le t_{0}.$$

Can anyone help explain this?


texts: How is digital signal processing related to Computer Vision?

texts:
Keeping in reference this image,

I want to build a concrete understanding of interconnection between Digital Signal Processing and Computer Vision. What would be the applications of this co-relation?


texts: How to find a maximal possible value of a cross correlation

texts:
Is there any way of calculating a maximal possible value of a cross correlation of two signals whose maximal amplitude and sample rate is known?

To make things clearer, , signals in question are mostly the same signal but one is shifted in phase.
So, basically I want to know what will be the output of a cross correlation if they are not shifted, but without actually shifting one back and doing the CC to find out.


texts: Interpolation methods for radar and acoustic imaging and potential pitfalls

texts:
A) What are the most common methods used to remap data for current generation imaging radars and acoustic sensors?

B) What are some of the pitfalls in these methods?

For example, in the past,  at least, cubic splines have been used to map slant-range image data from synthetic aperture radar to a uniform "ground" grid. This can introduce spurious signals in ocean wave spectra.