texts: Why the Room Impulse Response (RIR) obtained form cepstrum is not correct?

texts:
I generate a synthetic room  Room Impulse Response(RIR) function to filter a speech signal, and want to reveal the RIR from the filtered signal by using complex cepstrum.

Generating the convolved signal:
sig= conv(speech,H);

Obtain the cepstrum:

eF = enframe(sig, 512, 128);
for i=1: size(eF,1);
cepF(i,:)=cceps(eF(i,:),1024);
end

and the mean of cceps is :

I expected to see some peaks in the cepstrum which correspondent to the echo relected by the walls. But it will never give the right result no matter using the cepstrum of the whole signal or by averaging the cepstrums of the segmented signal.

I used the matlab function cceps to calculate cepstrum. In matlab, the function cceps provide two method to calculate complex cepstrum and their result often differs. I think the calculation is quite simple, but actually it involves phase unwrap which is a blind problem. So is complex cepstrum an unstable value use? Or I overlooked some preliminary conditions.

The description for the cceps function in Matlab:

  xhat = cceps(x) returns the complex cepstrum of the real data sequence x using the Fourier transform. The input is altered, by the application of a linear phase term, to have no phase discontinuity at $\pm\pi$ radians. That is, it is circularly shifted (after zero padding) by some samples, if necessary, to have zero phase at $\pi$ radians.

  [xhat,nd] = cceps(x) returns the number of samples nd of (circular) delay added to x prior to finding the complex cepstrum.

  [xhat,nd,xhat1] = cceps(x) returns a second complex cepstrum, xhat1, computed using an alternative factorization algorithm. This method can be applied only to finite-duration signals. See the Algorithm section below for a comparison of the Fourier and factorization methods of computing the complex cepstrum.


texts: Intensity Transformation using Fuzzy sets

texts:
I'm doing a project on intensity transformation using fuzzy sets. In the book Digital Image Processing by Rafael C. Gonzalez. The author says this

  Consider the general problem of contrast enhancement, one of the
  principal applications of intensity transformations.We can state the
  process of enhancing the contrast of a gray-scale image using the
  following rules:

  IF a pixel is dark, THEN make it darker.
  IF a pixel is gray, THEN make it gray.
  IF a pixel is bright, THEN make it brighter.

and equation

$$v_0 = \frac{\mu_\text{dark}(z0) \times v_d + \mu_\text{gray} (z0) \times v_g + \mu_\text{bright} (z0) \times v_b}{
\mu_\text{dark}(z0) + \mu_\text{gray} (z0)  + \mu_\text{bright} (z0)}\tag{3.8-22}
$$

but how do we calculate the $ \mu_\text{dark}$, $\mu_\text{gray}$ and $\mu_\text{bright}$ values?

these are supposed to be the membership functions and how do we deduce the membership function values and calculate the new pixel values?


texts: should block diagrams in Direct Form 1/2 contain empty branches to fit structure?

texts:
When creating a block diagram in a well-recognized structure (Direct Forms 1&2 in particular), does one remove branches where the coefficient is 0?

This picture includes a coefficient of $b_1=0.00$ . Should the branch be removed or is it reasonable as well to still include it, so the structure is kept and people can easily see it's Direct Form 1?

I plan on using these diagrams for a beginnner's tutorial.


texts: What are integration scale and differentiation scale?

texts:
In scale-adapted Harris detector, the scale adapted second moment matrix is defined by:
$$\mu(x, \sigma_I, \sigma_D) = \sigma_D^2\ g(\sigma_I) *\left[ \begin{array}{cc}
L_x^2(x, \sigma_D) &L_xL_y(x, \sigma_D) \\
L_xL_y(x, \sigma_D) &L_y^2(x, \sigma_D)
\end{array} \right]$$,
while $\sigma_I$ is the integration scale, and $\sigma_D$ is the differentiation scale. What are they? Why use them?

UPDATE

According to @Dima's answer, I think $\mu(x,\sigma_I, \sigma_D)$ is actually something like this,
$$\mu(x,\sigma_I,\sigma_D) = \sigma_D^2\cdot g(\sigma_I)*\left(g(\sigma_D)*\begin{bmatrix}I_x^2(x) &I_xI_y(x) \\
I_xI_y(x) &I_y^2(x)\end{bmatrix}\right)$$, where $I_x,I_y$ are the 1st order derivatives. Is it right? If so, why bother convolving twice? And why multiply $\sigma_D^2$?


texts: What is this strange pulse in my audio output?

texts:
Firstly, if this is the wrong place for this, I'd be happy to know the correct place for this and I'll move it there.
I have two PCs which share an audio interface. My laptop is connected via USB and uses it as its sound card. My Desktop (runs Linux so will be called Linux PC from here on) inputs into inputs 3 and 4 of the interface which is routed out the monitoring outputs. If it's relevant, I'm using a Focusrite Scarlett 6i6 (2nd Gen). I was watching something on YouTube on the Linux PC about an experiment involving sound, one of those things that let you try at home. Interested, I opened my DAW on my laptop, set it to read inputs 3 and 4 (the Linux PC), and opened a spectrum analyser to take a look at the frequencies of sound.
My spectrum analyser shows the audio has a pulsing every 10 seconds with the pulse lasting around 7 seconds, with two pulses in unison at ~20kHz reaching up to ~24kHz and the second at ~40kHz reaching up above the scale which tops off at ~43kHz. My sample rate is 88.2kHz.
I've included a screenshot. The left is a spectrogram before applying a High Pass filter (via EQ) set at around 18kHz, the right is after filtering.

What is this?
I've looked at this question and accepted answer, which is the only thing I could find that has come close to be even remotely similar to what I'm seeing and I don't quite know if it's related or not. The post mentions to filter out anything above 1/2 the sample rate to filter out aliasing artefacts, but 1/2 my sample rate is 44.1kHz which plants the lower pulse well below this area and the higher one just below it.
The screenshot was taken when (seemingly) no audio was playing. I can't tell if the plugin has some kind of automatic gain control that makes the maximum amplitude fit in the spectrum's colour gradient or not, but when audio plays it is significantly weaker on the spectrum but definitely still there.
I've also recorded, intensely amplified and lowered the pitch and it sounds like data, but again, what data?


texts: Can anyone explain how does CZT (Chirp Z Transform) really help in 'spectral zooming'?

texts:
I found some explanation alongwith the Matlab Code here,
but I can't figure out, without a good example, why would this result in spectral zooming? (or develop some time intuition like viewing it as time resolution vs. frequency resolution thing). Any help (hopefully with an example) will be appreciated.


texts: determining walsh function components of signal after passing through non linear process

texts:
When a sum of sine waves is passed through a non linear process, harmonics and intermodulation distortion products are created, which are visible when applying an FFT to the signal. This causes potential problems when figuring out which sine waves were present in the signal originally.

Does something similar happen when a sum of walsh functions is passed through a non linear process and the walsh transform is applied?

Thanks,
B


texts: identify equilibrium region after large transient

texts:
I am looking at data from a mechanical system under an unsteady load. I'm trying to find the simplest way to identify the portion of the signal once the system reaches its new equilibrium. Here's a simple example.

Any suggestions for a simple and robust approach would be most welcome!


texts: Order of operations when creating a spectrogram

texts:
Signals noob here! I'm dipping my toes into your world by trying to recreate the Shazam algorithm, and I have a quick practical question:
When creating a spectrogram, is it better to take in a whole sound clip (say 5 seconds), and then chunk it into pieces for input to an FFT, or is it better to chunk it as the signal is being received and apply FFT as you go?
I'm asking from the perspective of ease of implementation, but if there are other considerations, I'd be happy to hear them.


texts: System Identification: smoothing in E-step of EM algorithm

texts: My question is, do the smoothed values affect the estimates obtained from the Maximization Step? If not then we could eliminate the smoothing. Once the estimates are obtained, they do not change apart from substituting the smoothed values $x_n^s, P_n^s$. So, why do smoothing?


texts: Frequency Response Question on LSI System

texts: Someone please explain me the question its seems very complicated to me. I just want know what the question asking and how to solve it i dont want fully solved solution. Thank you!!


texts: Real and Imaginary data from Network Analyzer

texts: I’m having a hard time grasping what exactly ARE the real and imaginary numbers in my s-parameter data. Most of the time I just set the NA up in logmag/phase to find the loss though, say, a filter or cable. My understanding is you can pretty much derive anything from the real/imag, especially s11. But are these numbers kinda useless (for lack of better term) until converted into other units?


texts:
I am sampling short bursts of signal (20ms length) in 30ms buffers in time domain.
The 30ms buffer consists from 4096 I/Q samples from which roughly 2550 cover the actual signal. Now I do in-place FFT on that.
If carrier signal is in the sampled data then it is found by FFT but the power of frequency bin varies depending where inside of the samples the actual signal is located.
If I have more noise after signal then FFT power is higher, if I have more before signal then it is weaker.
How I can overcome this problem ? I understand FFT will interpolate signal over the noise samples in this case.
I would like to have the same FFT power for signal frequency despite of location inside the processed samples.
Thanks
Michal


texts: How to report how a filter was designed (scientific papers) + how to calculate filter attenuation?

texts:
I am looking for a way to completely describe which kind of digital filters I used to process my data, although it seems only few publications in general report all the details.

I think I should describe at least

Which type of filter was applied (low-pass, high-pass, etc).
Cutoff frequencies
IIR / FIR
Phase response?
How the filter was designed?
Transition bands

Also, I would like to know the attenuation is reported? Sometimes it is written that attenuation was x dB per octave, how does one calculate that?

I'm using MATLAB's fdatool for filter design + command filtfilt (zero-phase) to do the filtering. Basicly I would like to cover all the selections I made.


texts: How do I calculate the correct amplitudes of a discrete Fourier transform (DFT)?

texts:
I have a set of samples values in time domain. I know they are uncorrelated and I have to extract the correct amplitudes. However, the values are only ~88% of what they should be.
As a test see the minimal working example in R below. I think it can be understood even if you are not familiar with the language. I generate the data uncorrelated data with rnorm() and then apply fft(). As a consistency check I show that Parseval's theorem is fulfilled, which it is. Is there anything I am not aware of?
MWE:
# dt <- 0.01 # time stesp
nSteps <- 100000 # Number of time steps
# df <- 1/(nSteps*dt) # frequency resolution

# t <- 0:(nSteps-1)*dt #
y <- rnorm(nSteps, mean=0, sd=1) # generate uncorrelated data. Should result in a white noise spectrum with sd=1
y_sq_sum <- sum(y^2)

# We ignore cutting to the Nyquist frequency.
# f <- 0:(nSteps-1)*df
fft_y <- abs(fft(y))/sqrt(length(y))
fft_y_sq_sum <- sum(fft_y^2)

print(paste("Check for Parseval's theorem: y_sq_sum = ", y_sq_sum, "; fft_y_sq_sum = ", fft_y_sq_sum, sep=""))

print(paste("Mean amplitude of my fft spectrum: ", mean(fft_y)))
print(paste("The above is typically around 0.88, why is it not 1?"))
```


texts:
I am developing an application that requires audio fingerprints. I have been reading a lot of articles and PDFs, now i think i have gotten myself confused. Based on my present understanding, I have some questions

After decoding the audio to its raw format, resampling and extracting the mono channel. Do i convert the bytes to integers or floats?
What is convolution and why is it necessary to convolve the audio samples
What is a window and its length
FFT transforms a signal from time domain to frequency domain. Am i correct? If yes, does the frequency components of an audio determine the contents/sound/noise/volume?
What operation can be carried out  on two audios of same content but different bitrate to normalize the bitrate and get the data that they share
What are low pass and high pass filters and how are the derived. What are their uses in relation to audio fingerprint operations
In the text Computer vision for music identification. After convolving the signals with a low pass filter and extracting every 8th sample. Then, a short term fourier transform with a window size of 2048 samples with successive windows offset by 64 samples. Also divide the power between 300Hz and 2000Hz in 33 logarithmically spaced bands.

Will these operations be applied to each of the samples retrieved after the convolution process? Can i get a simpler explanation?

32 learned filters and thresholds are applied to get a 32-bit descriptor for every time step (11.6 ms) of signal. This series of signals are known as the signature.

what are these learned filters and thresholds?

Wow :), that's a lot of questions. I am sure a lot of beginners will find the answers helpful.

Thanks


texts: Is the inverse of a causal system also causal?

texts:
If I have a causal system H(z) and I find the inverse of this system:

$$
G(z) = \frac{1}{H(z)}
$$

Is G(z) also causal?


texts:
It is common to say that the YUV color model is inspired from the human visual system (HVS), knowing that we have many more rods than cones, and consequently, we are more sensitive to light than color. However, it does not seem to be that simple. Rods become active under low light conditions, and cones are not totally insensitive to light. These details seem to be ignored by the literature. My question is: is it reasonable to build HVS models for image processing only based on the number of rods and cones?

For instance, in the paper "A new color image quality measure based on YUV transformation and PSNR for human vision system" by Yalman and Ertürk (http://journals.tubitak.gov.tr/elektrik/issues/elk-13-21-2/elk-21-2-20-1111-11.pdf), a new quality metric called CQM is proposed. It consists in computing separated PSNRs on the Y, U and V channels, and combining them with a weighted average, whose weights are adjusted according to the number of rods and cones. But, once again, is it reasonable knowing that rods become active under low light conditions?


texts: How to choose an interpolation method for seismic ground motion signals

texts:
I am working with seismic ground motion records from the PEER database. They are acceleration measurements that are band limited to 50 Hz and sampled at 200 Hz.

I use these records to drive an explicit finite element analysis of a structure to determine its response under the earthquake. This analysis runs with a 1e-5 time step (100,000 Hz). If I were to input the sampled records directly the FEA program would linearly interpolate the time steps between the samples, which would distort the signal.

Therefore I need to reconstruct the original signal and resample it at 100,000 Hz (or high enough that the interpolation doesn't affect accuracy much).

One property that I would like to preserve is the double integral of the signal, which gives displacement. This keeps the structure from drifting away over time. I do not care about the calculation time, as it only needs to be done once and is trivial compared to the FEA calculation time.

A previous answer discussed several methods for interpolation but not how to choose from among them.

I have experimented with sinc interpolation using a Kaiser window with an artificially generated signal that I sampled and then reconstructed and I see decent results, but there are visible differences in the time domain.

Is there some way to determine what interpolation method (and parameters in the case of a windowed method) would give the most accurate results?


texts:
How does upsampling factor relate to pulse duration?
If I want to do pulse shaping and I have rcosdesign(beta,span=8,sps=4) should I upsample by 8, 4 or 33(8*4+1) and why?
I've seen you'd normally upsample by 4 and I can't see why.
Like, that way you're not using the whole pulse to shape a symbol, shouldn't it be 33?

I'd appreciate very much someone explained this to me. Thanks!


texts: reference parseval theorem limited signal

texts:
some days ago I asked here parseval for a continuos but limited signal  if the Parseval can be applied for limited signal.

Can you recommend me a book or a paper that I can use as reference for this?

Can someone show me the demonstration considering a limited domain

Thank you


texts: Connection between SNR and the dynamic range of the human ear

texts:
For signal-to-noise ratio (SNR), SNR=6B dB  is called the dynamic range of
the quantizer.

The dynamic range of the 16-bit quantizer is 6B = 6·16 = 96 dB. Note that the dynamic range of
the human ear is about 100 dB. Therefore, the quantization noise from 16-bit quantizers
is about at the threshold of hearing. This is the reason why “CD quality” digital audio
requires at least 16-bit quantization.

How can we obtain(calculate) the fact that  the dynamic range of
the human ear is about 100 dB?


texts: How does Music algorithm differ from simple DFT/FFT for frequency estimation?

texts:
I would like to know why would someone choose to use Music algorithm from frequency estimation when one can simply use DFT/FFT which are much simpler.
What is the intuitive way for understanding Music algorithm?


texts: Transfer function of linear phase filter & its frequency domain representation

texts:
Text of my exercise request:

  Determine the transfer function $H(z)$ of a causal linear phase FIR filter with zeros at $z= \frac{1}{3}$ and $z=-2$. The value of the impulse response at $n=0$ equals $2$.

So I calculated $H ( z )$, taking into account the zeros and their inverses (due to the linear phase property): $$H(z)= k(z^{-1}-3) (z^{-1}-\frac {1}{3})(z^{-1}+ \frac{1}2)(z^{-1}+2)$$
intermediate steps of the multiplication, take me
$$  H(z) = k (z^{-4} - \frac{5}{6}z^{-3} - \frac{19}{3}z^{-2} -\frac{5}{6}z^{-1}+1) $$
and finally $$ h(0) = k=2 $$

but what is the corresponding DFT? I think it's a 5-point DFT, but I do not know calculate it, I just say that
$$H(K)=H(z) _{|z= e^{\frac{j2 \pi k }{5}}}$$
but it would be necessary to do the calculations?


texts: Determining the final value of the output of a discrete system

texts:
I'm going through an exam question where I've been told that the samples $f(kT)$ of the following function
\begin{equation}{F\left(z\right)=\frac{1}{1-0.819z^{-1}}} \end{equation}
are applied to a discrete system with the pulse transfer function

$$\text{G}\left(z\right)=\frac{C(z)}{F(z)}=\frac{T}{2}{\left(\frac{1+z^{-1}}{1-z^{-1}}\right)}\quad\text{where}\quad T = 0.1\textrm{ s}$$

I'm then asked to determine the final value of the output of the system. I know that the final value theorem states

\begin{equation}{\lim_{k\to\infty}f\left(kt\right)=\lim_{z\to1}\left(1-z^{-1}\right)\cdot F\left(\text{z}\right)} \end{equation}

but how do I obtain a value of $F(z)$? I'm not sure how the two equations above are manipulated to obtain the  $F(z)$ I should be using the final value theorem with.


texts: Directions on how to estimate the additive intensity bias

texts:
I have been reading this paper on how to estimate the additive intensity bias from an image, and I want to test it and write an algorithm for it. However, I can't seem to understand how to write the algorithm based on its methods (Section 2.2) because of either I have no actual knowledge of the subject or I might have been approaching the methods in a different way as it is supposed to.
In the paper, the bias field $B$ is estimated through an isotropic total variation model,
$$E(B) = \min||\nabla Z - \nabla B||_2$$
where $Z$ is the degraded image and $\nabla$ is the vector-form gradient field, while the $||\cdot||_2$ is the $L_2$ norm (I have a rough idea of what total variation is and the $L_2$ norm).
Since I have the degraded image, I can calculate for $\nabla Z$. But $\nabla B$ can be estimated by dividing it into two components, the $\nabla B_{x,i}$ and $\nabla B_{y,i}$, which is defined as,
$$\nabla B_{x, i} = \begin{bmatrix}\partial W_1/\partial x \newline
\cdots \newline
\partial W_N/\partial x\end{bmatrix} {\mathbf a} = C_x \mathbf{a}$$
and it is the same for $y$. From here, I do not what $i$ and $N$ supposed to represent (is $N$ just the size of the image?), although $i$ was in a previous definition of $B$, which is,
$$B(x_i, y_i) = \sum_{t = 0}^K \sum_{s = 0}^{K - t} a_{t,s} x_i^t y_i^s = W{\mathbf a}$$.
I have no idea what $x_i$ and $y_i$ supposed to represent, but from the form of the equation I assume that they are just coordinates. But if so, then are $x_i$ and $y_i$ just the pixel coordinates?
Further down the discussion, it tries to solve $\mathbf{a}$ with $\mathbf{C}$ and a filtered $Z$, which is $\hat{Z}$.
I am not actually sure how to follow the discussion on the methods and how to apply it. Could you provide some hints or direction on how to approach it?
Thank you in advance.


texts: How to recover signal repeated throughout other signal?

texts:
I have an audio signal that contains, at various time offsets, various other short audio signals, often repeated, in addition to other audio content. Here is an example of how that could look like:

   0  1  2  3  4  5  6  7  8  9
A: x        x              x
B: x                       x
C:       x  x

This terrible representation shows that A and B appear at 0 seconds, C appears at 2 seconds, A and C appear at 3 seconds and so on. These signals will additionally be scaled at every occurrence (their amplitude could be different at each occurrence) and possibly have an amplitude envelope applied to them.

Is there an algorithm to recover that takes all the position of the occurrences and recovers (to the best of its ability) A, B, and C?

To be more explicit in the task I have to solve, I have an old electronic music track I produced, but I lost the project file. Like most electronic music, it's a mix of synthesized (pseudoperiodic) sounds, electronic drums hits (called, confusingly, samples), vocals, effects and maybe some acoustic instrument. All those signals get summed together and processed in a "mastering chain": the thing relevant to this problem is that dynamic processing is applied to increase the average loudness, and saturation (in the case of this track, just soft clipping) is added to squeeze another bit of volume.

I need to change one of the drum hits. I don't need to recover it perfectly, because even if a bit of the old drum hit and a bit of noise is still there, the new drum hit that I'm going to replace it with will cover it.


texts: Continuously tunable low-pass filter that "interpolate" wavelet filter for multi-resolution analysis

texts: I am using wavelets to analyse some complicated 1D signal, where I am able to come up with multiple filtered signals with different level of details. However, the cutoff of wavelet filters follow a octave distribution, doubling in every additional level. I would like to have a continuously tunable similar filter such that by tuning a parameter, the filtered signal smoothly transit from the coarsest to the finest signal interpolating those from the wavelet filters. Is this possible and efficient to implement?


texts: Why do we need 4 points for homography but 7/8 points for fundamental matrix calculation?

texts:
Sorry if this is a trivial question but I could not find a suitable answer elsewhere.

I recently learned about homography and fundamental matrices in a CV class. I understand how these matrices are calculated and how the the formulae are derived. I also understand that both homography and fundamental matrices have 8 degrees of freedom.

But I'm unable to understand why we need 4 point correspondences for finding the homography while 8 points for calculating the fundamental matrix.

Shouldn't the number of correspondences needed be same intuitively?


texts: How is a human whistle a pure sine wave?

texts:
According to Wikipedia human whistling is a pure sine wave.

If that is true and if a human is whistling and produces a rhythm like any song, is he still producing a pure sine wave?

For example, if I am producing a tone of any music through my whistle would it still be a pure single harmonic sinusoidal wave?


texts:
I am using the following formula to calculate the Hann values for a set of points:
$$
w(n)=0.5\left(1-\cos\left(2\pi \frac nN\right)\right)
$$

To implement this in java, I am using the following code:

private static void applyHannWindow(final double[] points) {
    for (int i = 0; i < points.length; i++) {
        points[i] = 0.5 * (1.0 - Math.cos(2.0 * Math.PI * points[i] / points.length));
    }
}

To take the inverse, solve for $n$, I can re-use the $w(n)$ . Hence, the equation I come up with is this:
$$
n = \frac{1}{2\pi}\arccos\big(-2w(n) + 1\big)
$$

To implement this in Java, I am using the following code:

private static void reverseHannWindow(final double[] points) {
    for (int i = 0; i < points.length; i++) {
        points[i] = points.length * (Math.acos(-2.0 * points[i] + 1.0) / (2.0 * Math.PI));
    }
}

I wrote a simple test to make sure that after I apply the Hann window, and take it's inverse, that I get the same thing. However, I seem not to.

Given the original array:

final double[] data = new double[5];
data[0] = 200;
data[1] = 210;
data[2] = 215;
data[3] = 207;
data[4] = 203;

I get the following output:

### applying Hann window
0.0
0.0
0.0
0.9045084971874686
0.9045084971874787
### Reversing Hann window
0.0
0.0
0.0
1.9999999999999862
2.0000000000000138

Not sure what I am doing wrong here in applying the inverse to the Hann window?


texts: Smoothing power spectrum by convolution with boxcar function

texts:
I am trying to smoothing a signal's power spectrum by convolving the spectrum with a boxcar function in frequency domain. However, the result is obviously not what I expected: original two frequency spikes become three and the frequencies are different.

Could anyone possibly point out my problem? Is the problem in the idea of convolving with a boxcar or in the MATLAB code?
Thanks...
t = 0:.001:.25;
x = sin(2*pi*50*t) + sin(2*pi*120*t);

f = 1000/251*(-floor(length(t)/2):length(t)/2);

% power spec
Fy = fftshift(fft(x,length(t)));
Pyy = Fy.*conj(Fy)/length(t);
plot(f(length(t)/2:length(t)*3/4),Pyy(length(t)/2:length(t)*3/4))
title('Power spectral density')
xlabel('Frequency (Hz)')
figure

% rectangle function
rectLen = 5;
rw = ones(rectLen, 1);
plot(rw)

% convolution in frequency domain to smooth
Fy_conv_rw = conv(Fy, rw, 'same');
Pyy_conv_rw = Fy_conv_rw.*conj(Fy_conv_rw)/length(t) / sum(abs(rw));
plot(f(length(t)/2:length(t)*3/4),Pyy_conv_rw(length(t)/2:length(t)*3/4))
title('Power spectral density smoothed')
xlabel('Frequency (Hz)')


texts: Recursive, non-recursive systems; FIR, IIR systems

texts:
I am confused with the classifications of an LTI system as recursive or non-recursive systems and FIR or IIR systems.
I understood what the FIR and an IIR systems are, but is it correct to say that FIR system is always non-recursive?

We could express an finite accumulator up to past N inputs (FIR system) in both non-recursive and recursive forms.
Also is it correct to say that a non-recursive system is always an IIR system or vice versa?


texts:
What kind of compression artifacts would typically be most noticeable to a non-audiophile listener in a low-bit rate mp3 (MPEG-2 Layer III) compressed audio file?

What kind of audio signal might one synthesize that would make these artifacts maximally audible between "low" and "high" bit rate mp3 compressed files (using commonly available encoders)?


texts: PSD in MATLAB, problem with the coefficient $\frac{1}{2\pi}$

texts:
Using the FFT to mimic the Fourier Transform I have this question.
The definition that I use for the PSD $S(f)$ is:
$$S(f)=\frac{1}{2\pi}\int_{-\infty}^{\infty}\exp\left(-i\tau2\pi f\right)r(\tau)d\tau$$
where $r(t)$ is the correlation function.
The FFT in MATLAB use this formula
$$X(k) =      \sum_{n=1}^N  x(n)\exp\left(-j2\pi\frac{(k-1)(n-1)}{N}\right), \qquad 1 \leq k \leq N.$$
So in order to replace the PSD I did:
S=abs(fft(r))*delta_t

where delta_t is the time step.
In other words, translating the code in formula I did:
$$S(k)=\sum_{n=1}^{N}\exp\left(-i2\pi \frac{(k-1)(n-1)}{N}\right)r(n)\Delta T$$
After using this formula I applied this, checking the result
$$\int_{-\infty}^{\infty}S(f)df=r.m.s. \big\{x(t)\big\}$$
where $x(t)$ is the original signal. This formula is perfectly verified.
Now the problem is that I noticed that in the MATLAB's fft there is no coefficient $\frac{1}{2\pi}$.
Can you give me an explanation of why this happens? I know that there are a lot of different coefficient that I can use for the Fourier transform pair, but I don't know if this is related to my problem.
Thanks


texts:
I'm currently devising a solution for demodulating a DPSK signal in C#. So far I've got a working FFT with phase detection, BUT:

I now have an issue of aligning the window of the FFT to synchronise with each symbol transmitted on the audio stream - now I've done some manual testing and for a test transmission I rendered, and I have symbols with a window width of 19 samples.

I do understand that DPSK is designed to avoid a reference signal for demodulating the input signal but FFT window alignment is still needed.

Now the problem is that because this will be potentially used on amateur radio where transmission times are entirely random, the alignment of each symbol will have to be determined. The transmission I rendered has a clock timing header of 1024 symbols, but how can I be sure to get the alignment right?

For example, the header is like:

1 0 1 0 1 0 1 0 etc etc

and the phase of the sine wave rendered from this bit stream would be:

0, 90 0, 90, 0, 90 etc etc

How can I make sure that the receiver will determine the transmitted phase and not anything like

15, 105 ,15, 105, etc etc

as this would also introduce spurious phase calculations from the FFT detecting the higher-frequency harmonics due to the jump in phase.


texts: Why is there a difference in the spectrum of an audio file between Sonic Visualizer and my Python script?

texts:
I am working on a script which is creating a spectrum analysis from an audio file using SciPy and NumPy. Before I started, I analyzed the file using Sonic Visualizer, which got me the following result:

Now I tried to reproduce this result using my Python Script, but get a different result:

Everything looks right, except the scale of the dB values. At 10Hz, Sonic Visualizer is at -40db and my Script is at -80 dB. So I assume, there is a problem in my script.

A minimal version of the script looks like this:

import subprocess
import tempfile
from pathlib import Path

import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile
from scipy.signal import savgol_filter

SOX_CMD = 'sox'

def db_fft(data, frequency):
    data_length = len(data)
    win = np.hamming(data_length)
    data = data * win
    sp = np.fft.rfft(data)
    freq = np.arange((data_length / 2) + 1) / (float(data_length) / frequency)
    s_mag = np.abs(sp) * 2 / np.sum(win)
    s_dbfs = 20 * np.log10(s_mag)
    return freq, s_dbfs

def load_normalized_audio_data(path: Path):
    temp_dir = tempfile.TemporaryDirectory()
    try:
        converted_file = Path(temp_dir.name) / 'input_file.wav'
        args = [SOX_CMD, str(path), '-e', 'float', '-b', '32', '-c', '1', str(converted_file),
                'trim', '0', '10']
        subprocess.run(args, check=True, capture_output=True, encoding='utf-8')
        # Read the converted file.
        frequency, data = wavfile.read(str(converted_file))
    finally:
        # Cleanup the converted file.
        temp_dir.cleanup()
    return frequency, data

def prepare_audio_data(path: Path):
    frequency, data = load_normalized_audio_data(path)
    labels, s_dbfs = db_fft(data, frequency)
    flat_data = savgol_filter(s_dbfs, 601, 3)
    return labels, s_dbfs, flat_data

audio_file = Path('test.wav')
x_labels, data, flat_data = prepare_audio_data(audio_file)
plt.style.use('seaborn-whitegrid')
plt.figure(dpi=150, figsize=(16, 9))
x_labels = x_labels[0:len(data)]
plt.semilogx(x_labels, data, alpha=0.4, color='tab:blue', label='Spectrum')
plt.semilogx(x_labels, flat_data, color='tab:blue', label='Spectrum (with filter)')
plt.grid(True)
plt.title(audio_file.name)
plt.ylim([-160, 0])
plt.xlim([10, 10000])
plt.xlabel('Frequency [Hz]')
plt.ylabel('Amplitude [dB]')
plt.grid(True, which="both")
target_name = audio_file.parent / (audio_file.stem + '.png')
plt.savefig(str(target_name))
print('Success!')

The script converts any audio file into a 32bit float format, trimming the first 10 seconds of the file using the SoX command. You can ignore this part. Just assume the input file is in 32bit float format.

I assume, the problem is somewhere in the db_fft function.

Where is the problem with my script, why I get a different result?


texts: Wiener Filter in Frequency Domain: What it does to a specific Frequency?

texts:
As I understand Wiener filter in time domain tries to estimate a signal as close as possible to its (original) non-degraded signal using the degraded signal by white noise.

$$H(\omega)=\frac{\Phi_{ss}(\omega)}{\Phi_{ss}(\omega)+\Phi_{nn}(\omega)}$$

How does this function work in the frequency domain? Say for an example at 30 Hz there is noise and how the transfer function looks like?


texts: Minimum sample frequency of IMU accelerometer and gyroscope

texts:
I was wondering how I would justify a sampling rate of 125 Hz for accelerometer and gyroscope data from wearable sensors. This is a rate used in a lot of biomechanics literature, but I can't seem to find a justification.

I have been looking up the Nyquist rate, but I'm not sure how to find the bandwidth of the IMU signal.

Any help in this justification would be great


texts:
I have the following plot which represents the RMS energy of a signal over time.

The energy goes up and down with varying maximum amplitude. I want to keep the portions of the signal where the energy is quasi-steady (i.e. the top of each "hill", like the brown line). I cannot use thresholding because the local maxima are varying. How can I do it?

I am using Matlab.


texts: Can I use fpcalc to prove two audio files produce the same sound?

texts:
I'm using fingerprinting techniques to detect duplicate audio files on my music library.

The first and easy step is to compare the file-size and if they match I use a md5 sum to compare them.

The problem is sometimes the meta-tags of an audio file have been modified. So I compare the length (in seconds) of the file and if they match I use fpcalc to compare them.

When I finally have two audio files with different md5 sums but the same result of fpcalc I use picard (musicbrainz) to normalize the meta-tags (removing any tag that isn't a "standard" tag). Sometimes after saving the audio files they become identical but sometimes they are just different.

Can I use fpcalc to tell that two files have the same audio with the same quality?
If not, are there any other tools to compare audio files?

I made a small script to make all this easier https://github.com/falkartis/duplicates

If you think I'm doing it wrong can you please tell me.

In my collection I have lots of different file-types like wav, flac, ogg, mp3, wma...


texts: Discretizing a Controller with the Backward Difference Method

texts:
In the book "Modern Control Engineering" by Paraskevopoulos it's proved how to discretize a generic controller in the form:

$G(s)=\frac{Y(s)}{U(s)}=\frac{a}{s+a}$

where $a$ is a constant. Done this, the author says that it is possible to extend this procedure to a general case (without showing how), concluding that in order to discretize a controller $G(s)$ i have to simply substitute $s=\frac{1-z^{-1}}{T}$ where $T$ is the sampling period.

Since the author doesn't show how is possible to extend the procedure to a general controller. Can you explain to me ?


texts: Question regarding 16 QAM digital modulation

texts:
Below is an example of a digital modulation system using 16-QAM. I have copied this example from MATLAB communications toolbox,

   M = 16;                     % Size of signal constellation
   k = log2(M);                % Number of bits per symbol
   n = 30000;                  % Number of bits to process
   numSamplesPerSymbol = 1;    % Oversampling factor
   dataIn = randi([0 1],n,1);
   dataInMatrix = reshape(dataIn, length(dataIn)/4, 4); % Reshape data into binary 4-tuples
   dataSymbolsIn = bi2de(dataInMatrix);
   dataMod = qammod(dataSymbolsIn, M);

I am wondering if

1) there is a need to reshape the bits into tuples of 4 bits

2) there is a need to do the mapping from binary to decimal and then do the QAM modulation, couldn't I just have done

dataMod = qammod(dataIn, M);

Thanks.


texts: space frequency representation of images in matlab

texts:
How can I plot a space-frequency representation of an image in MATLAB?
I know that there is a function called spectrogram() but it is useful just in the case of one-dimentional signals and not for images. Can someone help me please?


texts: Where can I find more information about how to create filters on frequency domain?

texts:
I'm newbie and I'm very interested in filtering images on frequency domain.

I haven't found a lot filters on frequency domain and I wondering how can I create new ones.

How can I create new ones? Such as, and this is only an example, a filter to remove regions on an image with a certain colour.

Related question: Remove brighter regions in an image on frequency domain


texts: ARMA Filter Output Stationary and set up?

texts:
I have questions regarding ARMA Filters.
Is the output of a ARMA Filter stationary or just wide sense stationary?
I do know that you can obtain an ARMA filter by connecting an MA filter with an AR filter (MA,AR). Does that work the other way around? Can i obtain an ARMA filter by switching the order and connecting an AR filter with an MA filter? (AR,MA)


texts: Python FFT (average) Hanning spectrum size 4096 and 50% overlap

texts:
I want compute a FFT (average) with these parameters:

Spectrum size: 4096
Windows function: Hanning
Overlap: 50%

This is my python code:

data = np.genfromtxt(file_path)
Freq = data[:,0]
Pdyn = data[:,1]
ft = np.fft.rfft(PdynA*np.hanning(len(Pdyn)))
mgft = np.abs(ft)

fig = plt.figure()
xVals = np.abs(np.fft.fftfreq(len(PdynA),d=1/12000))
plt.plot(xVals[:len(mgft)], mgft)
plt.show()

So I have my Hanning windows. But now, I don't know how I can set the Overlap to 50% and the spectrum size to 4096 ?


texts: How much deviation is acceptable in FFT calculations (using computer algorithms)?

texts:
It seems apparent that different FFT algorithms (e.g. Numpy.fft vs FFTS) produce slightly different results. I'm seeing deviations around 0.005 to 0.01 between programs.

The reason for these, I guess, lies in computer arithmetic, but are there simple ways for finding out where the differences are caused? Or to tell, which algorithm is more precise?


texts: Deconvolving known impulse response from a sampled noisy signal

texts:
I am interested in measuring a signal with significant energy content up to 1-2 kHz. However, I am only able to sample the signal after it has passed through a first-order lowpass filter of known bandwidth (which significantly distorts the signal; in this case the bandwidth is 500 Hz). I sample the lowpass-filtered version at 5 kHz, and my measurements are noisy.

What are some options I can use to try to recover the original signal after taking noisy measurements of a lowpass-filtered version of it?

If it helps, I know the shape of the signal I am looking for; I am just trying to measure how it is scaled in amplitude and in duration.


texts: Would anyone be able to help out with the following discrete convolution question?

texts: I have been trying to attempt this question for quite a while and I am not sure how to approach it. Would anyone be able to help out with the working?


texts: How to measure distance between two 3d objects using cameras

texts:
I need some help regarding measuring distances between two balls and their position relative to surface(coordinates).
Dimensions of balls and surface are known.
Do i need just one camera to do this(measuring with ray diagrams and trigonometry)or more?

I hope this is the right thread,I tried on physics and photography before and it wasn't correct thread


texts: Re-mixing high and low pass filtered audio has interference in the shared transition band?

texts:
Disclaimer: this feels like something that should be obvious from an intro class, but for some reason I can't find anything around this.

I'm working on an algorithm that takes a signal, let's call it S_in. I'm running both a high pass and low pass filter (identical parameters otherwise) on it so that I can work on different frequency bands of the signal with slightly different parameters in my algorithm. So, lpf(S_in) and hpf(S_in). When I mix them back together (which I'm doing in the time domain via just simple addition, S_out = lpf(S_in) + hpf(S_in)), I get significant "interference" in the transition band in the resulting signal, usually in the form of something that resembles a band stop/notch filter at my original cutoff frequency. This happens even if I don't run those signals through my algorithm (i.e., S_in != S_out; preferably they would be approximately equal to each other, instead of significantly different).

As a "workaround" I noticed if I offset the addition by as few as 8 or 16 samples on one of the signals (that is, a time delay on one of the streams; also 44100 samples/sec audio fwiw), then the frequency response of the mixed signal looks much more flat relative to my original signal (which is what I want -- the band stop is gone, though there's still clearly some interference pattern in the shared transition band).

What am I doing wrong here? Is this a simple signal processing thing I've forgotten about and can't figure out how to search for it? Is it an artifact of discretization/rounding errors of my implementation? (Though since I can reproduce that same behavior in common audio editing software, I don't think it's just my implementation). I'm using a low order biquad filter for the filters (is it that? obviously a higher order filter would shrink the transition band, but is that the "right" fix, or just a workaround?). Is there a "right" way to mix them back together, or a "right" way to do my overall algorithm where I need to process frequency bands separately and then mix them back together?


texts: Downsampling, shifting, high pass and low pass filter commutativity

texts:
strong textI have been reading "The Stationary Wavelet Transform and some Statistical Applications" by Nason and Silverman, and there is a claim in the their paper of which I cannot convince myself.

Defininitions:

$\mathcal{H}$: A low-pass filter.

The action of the low pass filter on a doubly infinite sequence $\{..., x_{-1}, x_0, x_1, x2, ... \}$ is defined $(\mathcal{H}x)_k = \sum_n h_{n-k} x_n$
The filter satisfied internal orthogonality, i.e. $\sum_n h_{n} h_{n + 2j} = 0$

$\mathcal{G}$: A high-pass filter, defined by the filter $g_n = (-1)^n h_{1-n}$

Clearly $\mathcal{G}$ satisfied the same internal orthogonality, and is mutually orthogonal to $\mathcal{H}$, i.e. $\sum_n h_{n} g_{n + 2j} = 0$ $\forall j$

$\mathcal{S}$: A shift operator defined by $(\mathcal{S} x)_j = x_{j+1}$
$\mathcal{D}_0$:  A binary decimation operator that chooses every even member of a sequence.

$(\mathcal{D}_0 x)_j = x_{2j}$
$\mathcal{R}_0$ the inverse operation.

$\mathcal{D}_1$: A binary decimation operator that chooses every odd member of a sequence, similar to $\mathcal{D}_0$ above.
It is not even necessary for the same choice of "odd" or "even" to be used
throughout.

Suppose $\epsilon_{J-1}, \epsilon_{J-2}, ..., \epsilon_{0}$ are a sequence of 0's and 1's.
One can use the binary operator $\mathcal{D}_{\epsilon_j}$ at level $j$, and the original signal can be recovered by applying the corresponding sequence $\mathcal{R}_{\epsilon_j}$

On page 4, the paper claims,

  "If $x$ is a finite sequence, define the shift periodically at the boundary. It then immediate from the definitions that $\mathcal{D}_1$ = $\mathcal{D}_0 \mathcal{S}$ and hence that $\mathcal{R}_1$ = $\mathcal{S}^{-1} \mathcal{R}_0$.

NOW comes the portion I can't seem to grasp...

  It is also easy to see that $\mathcal{S} \mathcal{D}_0 = \mathcal{D}_0 \mathcal{S}^2$.
  and that the operator $\mathcal{S}$ commutes with $\mathcal{H}$ and $\mathcal{G}$.

How is this obvious? I have tried recreating these properties in R, but I cannot convince myself that $\mathcal{S} \mathcal{D}_0 = \mathcal{D}_0 \mathcal{S}^2$, or that S and the filters commute.  Can anyone help?


texts: I’ve passed a sine sweep wave file into an equalizer plugin I have, now I want to model it in matlab so that I can ‘copy’ the equalizer setting sound. I’ve both in.wav and out.wav audio files and Matlab but I don’t know how to extract a transfer function and then build a model to exactly recreate it using iir filters. Can someone help me please?


texts: How to calculate $p_c$ (binomial probability)

texts: In the given image I don't understand how to calculate $p_c$, can anyone please explain?


texts: WOLA vs Simple Hamming Window on signal before FFT

texts:
Im working on a project in which I should FFT a signal coming into my FPGA from ADC.
I want my FFT to show the peak values as clear as possible without the side lobes.

The solution should be straight forward: Window the time domain signal before FFT and I will get better results in the frequency domain, for example using Hamming Window.

But I encountered another approach to this, apply the WOLA (Weight, OverLap, Add) algorithm on the signal before the FFT.

So I used Matlab to check the results.

Lets assume I am capturing this noisy signal through the FPGA:

so first I will check what is the FFT without any window:

I want to decrease the side lobes of this fft, so the straightforward approach is to create a hamming window, and multiply it with the signal, like this:

% Generate Hamming Window using Equation:
n = [1:1024];
w = 0.54 - 0.46*cos(2*pi*n/1024);
% Apply Hamming Window on Input Signal:
hamming_sim = din_window.*w;

and now lets FFT this new windowed signal:

fft_hamm_sim = abs(fft(hamming_sim));
fft_hamm_sim(1) = 0;
fft_hamm_sim(2) = 0;
fft_hamm_sim(1024) = 0;

OK so I am getting a good result as expected.

I encounterd another approach which requires taking the time domain hamming_window*input_signal, and apply WOLA on it and this is how I did it (I will be glad if someone will alert me if its not the right way):

I took the windowed signal and added the first array element with the middle array element and then the second array element added with the middle+1 array element, like this:

    wola_sim = zeros;
    i = 1;
    for k = 1:512
        wola_sim(i) = hamming_sim(k) + hamming_sim(k+512);
        i = i+1;
    end

and now on this signal i applied FFT:

fft_wola_sim = abs(fft(wola_sim));
fft_wola_sim(1) = 0;

It is still decreasing the side lobes but it is easy to see that the result worse.

My questions:

Am I applying the WOLA algorithm right? Apply hamming window and than add the first half of the array with the second half.
Suppose I apply the WOLA right, what is it used for? Is it really suppose to help me supress the side lobes before the FFT? Why I getting worse result than only hamming window?
For my needs, is it okay to just use the Hamming window?


texts: Using Discrete Wavelet Transform in the time-frequency domain

texts:
I am creating an application that works like the Shazam service. In short, my goal is to create an audio pattern matching service. However, I would like to use DWT and not the short time Fourier transform.

I am faced with some problems interpreting the results of the DWT. In particular I have the following questions:

How to plot the results of dwt like a spectrogram?
How to determine what frequency prevails in a given time?


texts: How to find fundamental frequency of Fourier Series

texts:
The original problem is from the Problem Set 7 of MIT OpenCourseware: Find the Fourier series coefficients for
$$
x(t)=sin(10\pi t+\frac{\pi}{6})
$$
What I did is to rewrite it in exponential form $\frac{1}{2j}e^{j\frac{\pi}{6}}e^{j10\pi t}-\frac{1}{2j}e^{-j\frac{\pi}{6}}e^{-j10\pi t}$, and take $\omega_0=10\pi$ as the fundamental frequency. The non-zero coefficients I got are $a_1=\frac{1}{2j}e^{j\frac{\pi}{6}}$ and $a_{-1}=-\frac{1}{2j}e^{-j\frac{\pi}{6}}$.

However, the solution takes $\omega_0=2\pi$, which gives $a_5=\frac{1}{2j}e^{j\frac{\pi}{6}}$ and $a_{-5}=-\frac{1}{2j}e^{-j\frac{\pi}{6}}$.

I can't find a proper explanation for this problem. What should I take as fundamental frequency? Can the fundamental frequency be arbitary number for continuous time Fourier series?

Here is the link of the problem set: Problem set 7

The link of the solution: Solution


texts: Is there any way to differentiate between impulses?

texts:
I have a set of signals consisting of impulses at different instant of time i.e. its not a continuous signal. What I want is a mathematically intuitive way to distinguish between any two such signals?

I understand that the time of occurrence of impulses can be used to differentiate between the impulses. But what I need is like a single number that gives a measure of how different two impulse signals are for instance it could be some property of the signal that would be different for any two signals.

Just an additional info the signals are defined on finite duration. I don't know if that info is needed or redundant.

I don't come from a signal processing background so this question could be wrong. Also if I have tagged it wrongly please modify it.

An example of 2 signals would be:

[0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 1]
[0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1]


texts:
In Signals and Systems by A. V. Oppenheim, A. S. Willsky, S. Hamid Nawab, 2nd Edition, and Signals and Systems, Simon Haykins, Barry Van Veen, 2nd Edition there is a problem related to energy of real-valued even and odd signal.

Energy of an arbitrary real-valued signal $x(t)$ is equal to the sum of the energy of the even component $x_{e}(t)$ and energy of the odd component $x_{o}(t)$ i.e.
\begin{equation}
 \int_{-\infty}^{\infty}x^2(t)dt = \int_{-\infty}^{\infty}x_{e}^2(t)dt +
 \int_{-\infty}^{\infty}x_{o}^2(t)dt\notag
\end{equation}
Which can be proved very easily by expressing $x(t) = x_{e}(t) + x_{o}(t)$ and evaluating its energy as
\begin{align}
 \int_{-\infty}^{\infty}x^2(t)dt &=
 \int_{-\infty}^{\infty}\big(x_{e}(t) + x_{o}(t)\big)^2dt\notag\\
 &= \int_{-\infty}^{\infty}x_{e}^{2}(t)dt + \int_{-\infty}^{\infty}x_{o}^{2}(t)dt
 +2\int_{-\infty}^{\infty}x_{e}(t)x_{o}(t)dt\notag.
\end{align}
The term $x_{e}(t)x_{o}(t)$ in the last integration corresponds to an odd signal (multiplication of even and odd signal results into odd signal) and its integration (joint energy) is equal to zero (area under an odd signal over symmetrical limits is zero). Hence
\begin{align}
 \int_{-\infty}^{\infty}x^2(t)dt =
 \int_{-\infty}^{\infty}x_{e}^{2}(t)dt +
    \int_{-\infty}^{\infty}x_{o}^{2}(t)dt\notag
\end{align}

I was wondering, what if I consider $x(t)$ to be a complex signal, will above property still be valid. I tried as
\begin{equation}
 \int_{-\infty}^{\infty}|x(t)|^2dt = \int_{-\infty}^{\infty}|x_{e}(t)|^2dt + \int_{-\infty}^{\infty}|x_{o}(t)|^2dt\notag
\end{equation}
Expressing $x(t) = x_{e}(t) + x_{o}(t)$ and evaluating its energy as
\begin{align}
 \int_{-\infty}^{\infty}|x(t)|^2dt &= \int_{-\infty}^{\infty}\big|x_{e}(t) + x_{o}(t)\big|^2dt\notag\\
 &= \int_{-\infty}^{\infty}|x_{e}(t)|^{2}dt +
 \int_{-\infty}^{\infty}|x_{o}(t)|^{2}dt
 +\int_{-\infty}^{\infty}[x_{e}(t)x_{o}^{*}(t) + x_{o}(t)x_{e}^{*}(t)]dt\notag
\end{align}

On expanding the term
\begin{align}
 x_{e}(t)x_{o}^{*}(t) &= \big(x_{er}(t) + jx_{ei}(t)\big)\big(x_{or}(t) - jx_{oi}(t)\big)\\
&= x_{er}(t)x_{or}(t) + x_{ei}(t)x_{oi}(t) - jx_{er}(t)x_{oi}(t)  + jx_{ei}(t)x_{or}(t)\\
x_{o}(t)x_{e}^{*}(t) &= \big(x_{or}(t) + jx_{oi}(t)\big)\big(x_{er}(t) - jx_{ei}(t)\big)\\
&= x_{er}(t)x_{or}(t) + x_{ei}(t)x_{oi}(t) - jx_{ei}(t)x_{or}(t)  + jx_{er}(t)x_{oi}(t)
\end{align}
Further on adding this terms results into
\begin{align}
 \int_{-\infty}^{\infty}|x(t)|^2dt &= \int_{-\infty}^{\infty}|x_{e}(t)|^{2}dt + \int_{-\infty}^{\infty}|x_{o}(t)|^{2}dt
 +2\int_{-\infty}^{\infty}\big(x_{er}(t)x_{or}(t) + x_{oi}(t)x_{ei}(t)\big)dt\notag
\end{align}
The terms $x_{er}(t)x_{or}(t)$ and $x_{oi}(t)x_{ei}(t)$ in the last integration corresponds to an odd signal and its integration (joint energy) is equal to zero. Hence
\begin{equation}
 \int_{-\infty}^{\infty}|x(t)|^2dt = \int_{-\infty}^{\infty}|x_{e}(t)|^2dt + \int_{-\infty}^{\infty}|x_{o}(t)|^2dt\notag
\end{equation}
I would appreciate if anyone here can validate the proof. Is it correct to say that the same property too holds for complex signal.


texts: How many psychoacoustical critical bands are there?

texts:
I understand that the human ear works as a band-pass filter and I have doubt regarding the number of such bandpass filters in the filter bank.

I came across these two possible explanations of how it happens:

There are no fixed bands and the critical bandwidth of a sound depends on which audio frequency the ear is exposed to. In such a case, the audio frequency could be treated as the center frequency of a bandpass filter and another frequency occurring in the same band gets masked out.
There are 24 fixed bandpass filters with their corresponding fixed bandwidths independent of the audio frequency the ear is exposed to. In such a case too, frequencies occurring in the same band sound like a single frequency and the difference goes undetected.

Which one of them is correct? Do the critical bands exist only between the 24 fixed values or are they continuous values?


texts: Coherent detection in radar and radio signals

texts:
Coherent demodulation\detection is usually done via matched filtering in RF signal processing. In radar signals, coherent integration can be done if the phases of the returns are known. In terms of coherent detection in radar signals, does it make any sense if we still use matched filtering, similarly to RF signals? Or, coherent detection means coherent integration in radar signals?

I am new to radar signal processing and trying to clarify some concepts here.

Thanks.


texts:
I am trying to use Roberts edge detection to process an image. Do I just apply both of the masks to the image and perform convolution as normal? Could someone give me the breakdown of how to use this edge detection method, as I am trying to program it to process a greyscale image. I convoluted the image using both kernels separately  but the image dent' look right.

Thanks.


texts: Implementation of modulation/demodulation models

texts: I am trying to implement mod demod for data rate of few kbps . I would like to know is it better/ easier to implement in DSP/FPGA. I am aware of both C and VHDL programming. I think the code flow and build and test time would be faster in DSP? please suggest? Any particular resource for implementation (like a sample code) to get started?


texts: How can I get maximum complex value from an array of complex values(524289) in python?

texts: I have an array of complex values. Actually this array contains fast Fourier transformation fft values. now I want to fetch maximum complex value from the array. Thanks


texts:
I am not exactly working with blood vessels, but my problem is similar enough that I think someone who does work with blood vessels can answer this question for me.

I have several GPS points of a car driver going through a city. I would like to reconstruct the city map from these points.

The problem is that, unlike traditional vein extraction, there are intersections.

This is an example of the data I have: (reproduced as an image, but I have the actual coordinates.)

This is ONE example of what I would like it to become. (I have only segmented some of the roads.) I would be happy however if the algorithm classified each intersection as the start of a new road.

I can and I have used image processing to reproduce a contiguous map (using dilation and skeletonization). The process is not perfect, but if the algorithm works only with lines, I can produce the map in that form.

Note: (1) the map is much bigger than this, and it is unfeasible to do it by hand. (2) And no, I cannot use a real map.

Related posts:

Vein extraction from this image


texts:
I am trying to emulate a satellite link where the delay time between the satellite and ground station changes over time due to the satellite's motion. I plan do this by converting to the frequency domain via FFT, multiplying it by $e^{-2\pi \omega_{delay} }$, and converting back to the time domain via IFFT.

However, when I implement this in GNURadio, it fails to work as I expect.

I generate a signal, pass it through the delay, and then match filter the original signal with the delayed signal. I then change the delay with a GUI slider. When I use the frequency-domain-phase-shifting method that I implemented, the correlation peak does not move when I change the delay. However, if I substitute in gr-baz's variable delay block, the peak does move when I change the delay.

Why does my implementation of the shifting method not work? Is it because my delay block only works with a finite window of the signal?


texts: Why does sampling chirp at peak frequency yield correct frequency response?

texts:
Followup; setting Fs = bandWidth in accepted answer's code yields the "correct" frequency response of an LFM chirp: constant magnitude, parabolic phase. Setting it to anything else, including >> bandWidth, yields distortions, and magnitude converges to a square in the limit Fs / bandWidth -> inf.
Why's this the case? Shouldn't greater Fs be better - less aliasing, greater resolution, etc?


texts: Why is the carrier suppressed by AM-DSB-SC modulation?

texts:
Lets say I have a message that is a sine wave at 1KHz. As I understand it, I can perform amplitude modulation by multiplying this signal with a carrier, lets say 10KHz, and this process is essentially DSB-SC modulation. Looking at the resulting signal in a spectrum analyzer I see a spectral line at 9KHz and 11Khz. My question is, why is there no spectral line at 10KHz? If you look at the waveform the 10KHz carrier wave is still clearly visible, it simply periodically inverts its phase 180 degrees. Is the fact that no spectral line appears in a frequency analyzer simply because it is being hidden, due to a limitation of how the spectrum analyzer works, effectively canceling out the 10KHz signal over time? If so, then is the carrier in DSB-SC truly suppressed? What does it actually mean for the carrier to be suppressed?

Edit. For clarification, I already know that the math says there should only be frequency content above and bellow the carrier frequency. Perhaps my confusion will become more clear if instead of modulating the carrier with a sine wave we modulate it with a square wave. Bellow is a picture of such a signal in Audacity. According to the spectrum analyzer this signal contains nothing at the original carrier frequency. This is despite the fact that the signal is literally made up of sections of the otherwise unmodified carrier, simply shifted 180 degrees periodically. It's not intuitive that a waveform that can be constructed from sections of a single sine wave of a particular frequency would not contain that frequency at all.


texts: Time-frequency synchronization algorithm for OFDM continuous stream

texts:
I am studying on the implementation of a continuous stream OFDM baseband modem. Googling and also searching here on stackexchange for synchronization techniques I found the descriptions of several existing algorithms, depending on the specific system features, but no detailed implementation of a time-frequency synchronization algorithm for continuous stream systems (like DVB-T/T2, etc).

Can anyone suggest any link/reference? Any other information will be welcome of course.

Also, many technical papers report synch algorithms for packet oriented systems like 802.11 or WiMax. A continuous stream system should need a less complex synch technique, with the possibility to average the received signal metrics over the time, is my assumption correct?


texts:
I was building my cognitive engine for a Cognitive Radio and, first things first, I have to make my CR aware of the environment by sensing the spectrum.

I read about Matched Filter Detection, Energy Detection and Cyclostationary Feature Detection: while I found plenty of libraries for machine learning, I did not found any implementation of the three sensing techniques mentioned above.

So, is there a spectrum sensing library (C++ would be nice)?


texts: Face Classification. Is it OK to only use geometric features?

texts: I am trying to teach myself the basics of facial recognition. I see that some resources use just distances between some points on the face (e.g., distance between 2 eyes, eyes to nose, etc). Some others use more sophisticated methods that (in my opinion) take into consideration every pixel on the face (e.g., PCA). What is the difference between these approaches. Is it enough for me to just use the distances between points on the face?


texts:
I've been using this implementation of a peak finding algorithm and it works pretty well. I'm wondering if this particular algorithm has a name?

Python code:

def indexes(y, thres=0.3, min_dist=1):
    if isinstance(y, np.ndarray) and np.issubdtype(y.dtype, np.unsignedinteger):
        raise ValueError("y must be signed")

    thres = thres * (np.max(y) - np.min(y)) + np.min(y)
    min_dist = int(min_dist)

    # compute first order difference
    dy = np.diff(y)

    # propagate left and right values successively to fill all plateau pixels (0-value)
    zeros,=np.where(dy == 0)

    # check if the singal is totally flat
    if len(zeros) == len(y) - 1:
        return np.array([])

    while len(zeros):
        # add pixels 2 by 2 to propagate left and right value onto the zero-value pixel
        zerosr = np.hstack([dy[1:], 0.])
        zerosl = np.hstack([0., dy[:-1]])

        # replace 0 with right value if non zero
        dy[zeros]=zerosr[zeros]
        zeros,=np.where(dy == 0)

        # replace 0 with left value if non zero
        dy[zeros]=zerosl[zeros]
        zeros,=np.where(dy == 0)

    # find the peaks by using the first order difference
    peaks = np.where((np.hstack([dy, 0.]) < 0.)
                     & (np.hstack([0., dy]) > 0.)
                     & (y > thres))[0]

    # handle multiple peaks, respecting the minimum distance
    if peaks.size > 1 and min_dist > 1:
        highest = peaks[np.argsort(y[peaks])][::-1]
        rem = np.ones(y.size, dtype=bool)
        rem[peaks] = False

        for peak in highest:
            if not rem[peak]:
                sl = slice(max(0, peak - min_dist), peak + min_dist + 1)
                rem[sl] = True
                rem[peak] = False

        peaks = np.arange(y.size)[~rem]

    return peaks

The full python package can be found here


texts: Can a (vanilla) Kalman Filter's Observation Matrix $H_k$ depend on the state vector $x_k$?

texts:
A vanilla Kalman Filter allows for a time varying observation matrix $H_k$. Is it allowable for $H_k$ to be a function of the system state $x_k$ in a vanilla Kalman filter?

First, am I correct that this is not allowed in the vanilla Kalman filter? If it is allowed, then I don't understand how measurements would then act to correct the parameters of $x$ that predict them via $H_k$. I'd appreciate a more explicit description of this than my own hunch though!

Second, am I correct that the Extended Kalman Filter & the Unscented Kalman Filter do explicitly allow for this situation? If I am, do these filters allow observations to correct the terms of $x$ that are predicting them?


texts: Is the Dirac delta (impulse) signal a power signal or an energy signal?

texts: I'm a beginner so sorry if this question is very fundamental.  Dirac impulse has finite area i.e = 1. But I've heard that $|\delta(t)|^2$ is undefined. So area under $|\delta(t)|^2$ is also undefined and signal doesn't exist in all time $t$ so it cant be a power signal. So my guess is Neither Power nor Energy signal. Am I right?


texts:
Consider a multiresolution analysis (MRA) $\{V_j\}$  in $L^2(\mathbb R)$ generated by the scaling function $\phi(x)$ and such that for each $j\in\mathbb Z$, $V_j\subset V_{j-1}$. For a given function $f$ I will use the notation $f_{j,k}(x) = 2^{-j/2}f(2^{-j}x-k)$.

Let $\psi(x)$ be the wavelet corresponding to $\phi(x)$, then $\{\psi_{j,k}\}_{k\in\mathbb Z}$ spans the orthogonal complement $W_j$ to $V_j$ in $V_{j-1}$, namely, $W_j = \overline{span}\{\psi_{j,k}\}_{k\in\mathbb Z}$ is such that $V_{j-1} = V_j\oplus W_j$ and $V_j\perp W_j$. Thus for a fixed $J<0$ one can define the projection of a function $f\in L^2(\mathbb R)$ into $V_j$ through the expansion
$$
P_J f(x) = \sum_{k\in\mathbb Z} \langle f,\phi_{0,k}\rangle\phi_{0,k}(x) + \sum_{j=0}^{J+1}\sum_{k\in\mathbb Z}\langle f,\psi_{j,k}\rangle \psi_{j,k}(x)\qquad (1)
$$
where the equality is in the $L^2$-sense. That makes sense to me due to the orthogonality of $V_0$ and $W_0\oplus W_1\oplus ... \oplus W_{J+1}$.

Consider now a biorthogonal MRA. In this case one consider two dual MRAs $\{V_j\}$ and $\{\tilde V_j\}$ generated by the scaling functions $\phi(x)$ and $\tilde \phi(x)$. In a similar way as in the orthonormal case, one defines the dual wavelets $\psi(x)$ and $\tilde \psi(x)$ which span repsectively the (non orthogonal) complements $W_j$ of $V_j$ in $V_{j-1}$ and $\tilde W_j$ of $\tilde V_j$ in $\tilde V_{j-1}$. Namely one has $V_{j-1}=V_j+W_j$ and $\tilde V_{j-1} = \tilde V_j+\tilde W_j$ with $W_j = \overline{span}\{\psi_{j,k}(x)\}_{k\in\mathbb Z}$ and $\tilde W_j = \overline{span}\{\tilde \psi_{j,k}(x)\}_{k\in\mathbb Z}$.

In this case, for fixed $J$, one can write
$$
P_J f(x) = \sum_{k}\langle f, \tilde \phi_{J,k}\rangle\phi_{J,k}(x)
$$
and an analogous expansion exists for $\tilde P_j$. My question is: does an expression of the kind of (1) hold also in the biorthogonal case? i.e. can I write
$$
P_J f(x) = \sum_{k\in\mathbb Z} \langle f,\tilde\phi_{0,k}\rangle\phi_{0,k}(x) + \sum_{j=0}^{J+1}\sum_{k\in\mathbb Z}\langle f,\tilde\psi_{j,k}\rangle \psi_{j,k}(x)\;?
$$
It is not clear to me that this is possible since it is not true that $V_0$ is orthogonal to $W_{0}+...+W_{J+1}$. However the following argument appears to hold:

Let $Q_j := P_{j-1} - P_{j}$ (the detail operator) and define the dilation operator as $D_j f(x) := 2^{-j/2}f(2^{-j}x)$. We have $$P_{j+m}f(x) = D_{j} P_m (D_{-j} f(x))$$  and hence
\begin{align*}
Q_jf(x) &= P_{j-1}f(x) - P_{j}f(x) = D_j (P_{-1} - P_0) \big(D_{-j} f(x)\big)\\&= D_j Q_0\big(D_{-j}f(x)\big)
\end{align*}
Moreover it can be shown that $Q_0 f(x) \in W_0$ and from the above relation one obtain, for each $j\in\mathbb Z$
$$
Q_j f(x) = D_j\sum_k \langle D_{-j}f,\tilde \psi_{0,k}\rangle\psi_{0,k}(x) = \sum_{k} \langle f,\tilde \psi_{j,k}\rangle \psi_{j,k}(x)
$$
Thus by definition of $Q_j$
\begin{align*}
P_{j}f(x) &= P_{j+1}f(x) + Q_{j+1} f(x) = P_{j+1}f(x) + \big(P_{j+2}f(x)-P_{j+2} f(x)\big)+Q_{j+1} f(x)\\ &= P_{j+2}f(x) + Q_{j+2} f(x) + Q_{j+1}f(x) \\&\quad\vdots\\&=P_0 f(x) + \sum_{i=0}^{j+1} Q_i f(x)
\end{align*}
and thus (1) holds.

Is this correct?


texts: Separating waves of very close wavelengths

texts:
I'm new to wave problems, so excuse my simplified words.
I have a signal consists of high range of frequencies . I applied a Band-pass filter to this signal and I have been able to separate it to bands of specific frequencies.

The problem that I want to solve is as follows:
Each band have a lot of individual waves of VERY, VERY close wavelengths. For instance 4.08 Hz and 4.09 Hz. even we may have 4.001 Hz and 4.002 Hz as well. The signal data is limited and I can't push the filter to any better resolution.

The question now, How I can separate the individual waves in each band? And if possible please refer me to any books which deal with such problem.

Thanks in advance,


texts: Intuitive interpretation of transform coding

texts:
I am currently studying source coding of waveform in a course of Information Theory and Coding. More precisely, I am trying to understand, both mathematically and intuitively, transform coding and its advantages of direct scalar quantization. I believe I am quite OK with the mathematical side. However, I am still lacking a bit of intuition.

My current understanding is based on the following sources:

Theoretical Foundations of Transform Coding, Vivek K Goyal, IEEE Signal Processing Magazine ;
Slides of a lecture on Transform Coding from the Berlin Institut für Telekommunikationssysteme and slides of a lecture on Quantization from the same university ;
Slides of a lecture on Transform Coding from Stanford.

In the case of a memoryless source and with scalar quantization under the high-resolution quantization assumption, the distortion-rate function is given by
$$ D(R) = \epsilon^2 \cdot \sigma^2 \cdot 2^{-2R} $$
or, equivalently, the rate-distortion function is given by
$$ R(D) = \frac{1}{2}\log_2\left(\epsilon^2\frac{\sigma^2}{D}\right)$$
where $D$ is the distortion (measured as a MSE), $R$ is the rate in bits/sample of the source, $\sigma^2$ is the variance of the source and $\epsilon$ is a factor that depends on the probability density function of the source and the properties of the quantizer (fixed-length vs. variable length). I am primarily interested with variable-length quantizers. For this particular case, optimal quantizers have uniform step sizes.
Also, with the high-resolution quantization assumption, $D \approx \frac{\Delta^2}{12}$ with $\Delta$ the quantization step.

Intuitively, I understand that if the source is no longer memoryless, applying vector quantization on vector of $N$ samples from the source will exploit statistical dependencies of the source (this is called memory advantage of VQ in the aforementioned slides from Berlin IC). I also understand that vector quantization is problematic from a complexity point of view. Then here comes transform coding.
Currently, the interpretation that most satisfies me is the one provided here, slide 14, repeated here for convenience.

The orthogonal transform concentrates the energy in the first transform coefficient. It can also be seen that the number of quantization cells with appreciable probabilities is reduced. Because the average rate is equal to the entropy of the quantized samples, this indicates a rate reduction.

However, this intuition seems to be contradictory with the fact that $\epsilon^2$ in the rate-distortion equation is for example, equal to $1.25$ for a source with Laplacian distribution and $1.0$ for a source with uniform distribution (again in the case of an optimal variable-length quantizer, that is with uniform quantization step $\Delta$). Indeed, for a Laplacian distribution, the entropy of the quantized samples should be reduced compared to the uniform distribution, and so the rate should also be reduced, which is not indicated by the rate-distortion equation. My hypothesis at this point is that $\epsilon^2 > 1$ (and so $R(D)$ is higher than in the uniform distribution case) to take into account the increase in distortion that should intuitively appear when using an uniform quantizer with a Laplacian distribution instead of a uniform distribution.

At the end of the day, I am a bit stuck by a lack of a clear intuitive understanding of transform coding and would be glad if someone could provide me with such an understanding and/or correct anything I said that is not correct/not precise.


texts: What does "A Target with Zero Doppler" Mean?

texts: I have seen several references to target at zero Doppler and some simulations that command users to place a target at zero Doppler. I know that when a target is flying tangential to the signal the Doppler is zero (is this even true?) but I have no clues as to what the target being at zero doppler means.


texts: If 2 PLLs as the one shown are driven from the same reference/crystal and the ratio between divider N and R is an integer (note that divider R is outside the loop), does one need a sync pulse for divider R or not and why? what if the division ratio N/R is not an integer?


texts:
Can anybody recommend a good source for material of Gaussian and Complex Gaussian wavelet?
Please share the link if possible.


texts:
I have a doubt related to calculating the Discrete Time Fourier Transform (DTFT) by hand. Specifically in how calculate the frequency axis of the spectrum. My signal has N values and was sampled at FS Hz, the spectrum would have N entries too (where N/2 values are a mirror of the other half). The maximum representable frequency is FS/2 (by the Nyquist theorem), that means that I have to multiply each entry by FS/N, so for the last entry (N/2) I have this:

(FS/N) * (N/2) = FS/2

But when I sample at a higher FS Hz the spectrum is shifted. Think for instance in this function:

x = cos(2*pi*f0*t)

Where "f0 = 1/T", T is the period of the cosine and "t" means each entry of the time axis. Then the spectrum is two pulses in "-f0" and "f0". But doing this in python:

f = range(-N/2,N/2)
f = [float(FS)/(float(N)) * i for i in f]

And sampling at a higher FS, then the pulses are shifted. But the correct behavior is that the pulses remain in the same location ("-f0" and "f0"), because the cosine function period didn't change. Am I doing something wrong?

Thanks in advance ;)

PD: I know that increasing the sampling rate would increase the density of the spectrum and the time signal too, so N is going bigger automatically, because I would have more samples per second.


texts: price of dsp kit TMS320c6678(used for signal processing)

texts:
This kit is used for implementing DSP concets in hardware
What is the meaning of highlighted price in attached fig?
Does it means 120 dollar per unit chip price?Figure


texts: Analogous filter to Kalman that maximizes mode (as opposed to minimizing variance)

texts:
I may have a potential application where maximizing the mode (as opposed to typically minimizing the variance) would be useful for state estimates. The situation may arise from skewed distributions where the mode is of more interest than the mean. I was wondering if anyone has seen a filter like this before? Thank you.

Josh


texts: FFTs of a complex signal - separating the real and imaginary parts

texts:
I have a complex time varying signal at a single frequency x = a + jb where a represents the contribution from the cosine basis function and b represents the contribution from the sinusoid basis function.

I am trying to understand how the output differs if I was to take a complex FFT of x and inspect the real and imaginary components compared to taking two FFTs of the real and imaginary parts separately. I naively expected these to be equal when a=b. What am I missing?

% signal parameters
fs    = 1e3;
f0    = 50;
t     = (0:999)/fs;
wt    = 0.5; %weighting between cosine and sin basis functions
NFFT  = 1024;
freq  = linspace(-fs/2,fs/2, NFFT);
freq2 = linspace(0,fs/2, NFFT/2);
wnd   = hanning(length(t)).';

% Complex signal
x = wt*cos(2*pi*f0.*t) + (1-wt)*1j*sin(2*pi*f0.*t);

% 1 - Take FFT of complex signal and split into re/im components
X   = fft(x.*wnd, NFFT);
Xre = abs(X(1:NFFT/2));
Xim = abs(fliplr(X(NFFT/2+1:end)));

% 2 - Split the signal into Re/Im and compute FFTs
Yre = abs(fft(real(x).*wnd, NFFT));
Yim = abs(fft(imag(x).*wnd, NFFT));

close all;
figure;
ax(1)=subplot(221);
plot(freq2, Xre, 'b');
legend('Cmplx Re');
ax(2)=subplot(222);
plot(freq2, Yre(1:NFFT/2), 'r');
legend('Split Re');
ax(3)=subplot(223);
plot(freq2, Xim, 'b');
legend('Cmplx Im');
ax(4)=subplot(224);
plot(freq2, Yim(1:NFFT/2), 'r');
legend('Split Im');
linkaxes(ax,'xy');

figure;
plot(freq, fftshift(abs(X)));


texts: Corresponding frequency domain filter of spatial domain filter in image processing?

texts:
My question is:
Suppose that we have low pass spatial domain filter that averages 4-connected neighbors of that pixel and it doesn't consider its pixel in averaging. Find its corresponding filter in frequency domain and show that it is a low pass filter.

I know that I must take forward Fourier transform from spatial domain filter and its output is frequency domain filter, but I don't have any idea what is spatial filter is? I think that it is $w(x,y)$ such that $-1 \le x \le 1 $ and $-1 \le y \le 1$ and $w(-1,0) = w(0,-1) = w(0,1) = w(1,0) = 1$ and $w(-1,-1) = w(0,0) = w(1,-1) = w(-1,1) = w(1,1) = 0$ but I don't know how to take Fourier transform from this?

How do I take the Fourier transform of my 3×3 filter kernel?


texts:
How could I know the best size of the board for my camera?
My camera is Canon D-100 It's 18 megapix
I have created a board consist of 14*10 squares
the length of each square is 7*7cm
I need to know what the step of choosing the number of squares ?
and How could I know the best dimension for each square ?
Thank you very much


texts:
I have $n$ surfaces: $z_i(x,y)$ with a measured attribute (variable) on each surface: $a_i(x,y)$. Most of the surfaces will have a random distribution of the attribute across the surface, but some surfaces (the interesting ones) will show a meandering river pattern:

I need your help in coming up with a measure that will tell us which of the $n$ surfaces are most likely to have such a pattern.

There are many possible maps with the same histogram as shown below; so the measure needs to "reward" spatial continuity.
To illustrate this I have created a random image with nearly the same histogram as the river image:

So image statistics ala entropy may only be part of the solution.

Here is an example of an image without a meandering river pattern:

My images are synthetic (made in Matlab). In real life the image without the pattern may have somewhat more spatial continuity in the form of small blobs of similar value.

Here are the images in grayscale:


texts: Concepts / Algorithms for recognising words in the Time-Domain

texts:
I'm currently working on a project that involves in Speech and recognising Phonemes (in kind of real-time).

The current algorithm works by always listening for input from the Mic, and input that is above a specific threshold then this is recorded to a .wav file and sent to the server for processing. E.g.

listening...
listening...
listening.. (max > threshold)
recording..
recording..
etc..

What I want to do is therefore have it recording when a specific name has been said. Someone basically speaks to it.. I.e. (let's assume it's called iris) so the algorithm would therefore work like the following:

listening...
listening..
listening.. (max > threshold)
  // determine if the input is "iris"
  // if true:
     begin recording the sentence
  // else:
listening..

I want to do this in the time-domain, then, process the sentences in the frequency domain. I've read an article, and, a paper that describes this process using Total number of Zero-crossings (using a specific threshold) my questions is whether or not this would be a good measure? I only need to identify one word, that is "Iris" and then everything else can be done using algorithms such as: MFCC, HMM's etc..

Any ideas? :)


texts: How do we compute distrubtions of the value of a random process conditional on initial conditions?

texts:
Suppose I have a stationary process $\phi(t)$ with a known autocorrelation function

$$ A(\tau) \equiv \langle \phi(0) \phi(\tau) \rangle$$

and suppose I also know that $\phi(t)$ is Gaussian distributed.

If I have a particular realization of the process in which $\phi(0)=\phi_0$, what is the conditional distribution of $\phi(t)$ for later times in that realization?


texts: How can I change the formula to detect the barcode in every angle? - MATLAB

texts:
How can I change the formula to detect the barcode in every angle?

 rgb = imread('barcode4.jpg');
% Resize Image
rgb = imresize(rgb,0.33);
figure(),imshow(rgb);
% Convert from RGB to Gray
Igray = double(rgb2gray(rgb));
% Calculate the Gradients
[dIx, dIy] = gradient(Igray);
B = abs(dIx) - abs(dIy);
% Low-Pass Filtering
H = fspecial('gaussian', 20, 10);
C = imfilter(B, H);
C = imclearborder(C);
figure(),imagesc(C);colorbar


texts:
Here is an example of convolution given:

I have two questions here:

Why is the vector  padded with two 0s on each side? As, the length of kernel ℎ is 3. If  is padded with one 0 on each side, the middle element of convolution output would be within the range of the length of , why not one 0 on each side?
Explain the following output to me:

 >> x = [1, 2, 1, 3];
 >> h = [2, 0, 1];
 >> y = conv(x, h, 'valid')
  y =
      3     8
 >>

What is valid doing here in the context of the previously shown mathematics on vectors  and ℎ?


texts: Effect of sampling rate on BER simulation

texts:
I am trying to build a bit error rate simulation for a digital baseband signal
(specifically using Manchester coding). The simulator generates a digital waveform from random symbols at a sample rate of at least $f_s = 2/T_l$, where $T_l$ is the chip duration (the duration of the "on" time).

The transmitted signal is mixed with AWGN, based on the desired S/N ratio. The detector correlates each symbol period from the received signal with an ideal 0 waveform or 1 waveform, and chooses the best. Either "ideal" is 1V during the on time, and 0V during the off time. These ideal waveforms are sampled at the same rate as the input.

What I am seeing is that the BER improves when the sampling rate is increased, for a given SNR (see plot). This was unexpected, since I believed that the error rate would be independent of the sampling rate.

Am I missing something in this BER simulation? Shouldn't the error rate be independent of the sampling rate?


texts:
I am working on segmenting hands from monocular images and I have already come up with a pretty descent segmentation. The only issues I am having are when people have rings on their finger. Then the hand is no longer a connected component and I get the hand and the finger component. The following image shows my segmented mask, where the ring finger is detached because of a ring.

Is there any natural method to connect components like these together? Otherwise I could try to segment the rings, but not all people have rings, so I would prefer to try to tackle this in this way.

Also, if there is another SE better suited for this question, please let me know.


texts:
I have set of HRIR( Head related impulse response) downloaded. I want to convolve it with an audio signal to generate 3D signal in Matlab.

I am new to this field. Is there any tutorials or can any one help me how to start


texts: Use sparse optical tracking to track a Bounding Box object

texts:
I need some help on solving this issue. Any tips are appreciated.

The goal of the project is to try to track a Bounding Box object, chosen arbitrarily in an image, throughout many frames of a recorded video.

I extract from the chosen bounding box cv2.goodFeaturesToTrack and use a sparse optical tracker cv2.OpticalFlowPyrLK in OpenCV to track these features. However I need to also update the bounding box corners for each frame.

Since the bounding box corners are initially chosen to be random and do not necessarily belong with the features in the same rigid object , I am looking for using the information on the movement of these special features to infer the new bounding box coordinates.

I tried to add the bounding box corners to the tracker but it is not robust and loses it in a few frames.

I am using OpenCV in python.

Thank you.


texts: Centering zero frequency for Discrete Fourier Transform

texts:
I am working on a image processing application which uses a discrete fourier transform to implement blurring/sharpening. The application is more or less working, but something about the mechanics is still confusing to me.

In particular, it is how the process of centering the zero frequencies is being done.

The example I have seen preprocesses the input image (of greyscale intensities) by multiplying it with a matrix of size equal to the input image, whose values are $(-1)^{x+y}$, where $x$ is the row, $y$ is the column, so a pattern alternating $1$ and $-1$

According to the notes, this is equivalent of swapping the quadrants of matrix by flipping across the $x$ and $y$ axis.

I understand why this is done, and I would like to stress I understand I have my code/Fourier stuff working, I just don't understand why multiplying the input matrix by 1/-1 ends up centering the zero frequency component around 0.

Thanks


texts: Deriving the Euler-Lagrange Equations for the Chan-Vese Model

texts:
I am reading the Chan-Vese paper "An Active Contour Model without Edges" and IPOL tutorial "Chan-Vese Segmentation" by Pascal Getreuer.  The energy for this model is given by:
$$
E(\varphi) = {\mu \int_{\Omega} \delta(\varphi(x)) | \nabla \varphi(x)|dx} + \nu\int_{\Omega} H(\varphi(x)) dx \;+$$
$$\lambda_1\int_{\Omega}|f - c_1| H(\varphi(x))+\lambda_2\int_{\Omega}|f - c_2|(1 - H(\varphi(x))dx
$$
Above, $\mu, \nu, \lambda_1, \lambda_2$ are real parameters, $c_1, c_2$ are constants determined for segmentation, $-1 \leq \varphi(x) \leq 1$ is the level-set function in which $\varphi(x) = 0$ specifies the interface,  $f$ is the original image, $H$ is the heavyside function in 1 dimension centered at $0$ and $\delta = H'$.  The Euler-Lagrange equations can be derived by inspecting the following derivative:
$$
\left.\frac{d}{d\epsilon} E(\varphi(x) + \epsilon \eta(x))\right|_{t = 0}
$$
for some test function $\eta(x)$.  Writing the Euler-Lagrange Equations as a gradient descent both papers claim:
$$
\begin{cases}
\frac{d\varphi}{dt} = \delta(\varphi(x))\left[\mathrm{div}\left( \frac{\nabla \varphi}{\mu |\nabla \varphi|}\right) - \nu - \lambda_1(f- c_1)^2 + \lambda_2(f-c_2)^2\right]\\
\frac{\delta(\phi(x))}{|\nabla \varphi|} \nabla \varphi \cdot \mathbf{n} = 0 & x \in \partial \Omega.
\end{cases}
$$
My problem is coming from the differentiation of
$$
{\int_{\Omega} \delta(\varphi(x)) | \nabla \varphi(x)|dx}.
$$
in the variation of the energy.  It should look like:
$$
\int_{\Omega} \underbrace{\left(\frac{d}{d\epsilon} \delta( \varphi (x) + \epsilon \eta(x) )\right)|\nabla \varphi(x)|}_{(*)} + \underbrace{\delta(\varphi(x)) \left(\frac{d}{d\epsilon}|\nabla\varphi(x) + \epsilon \nabla\eta(x)|\right)}_{(**)}.
$$
Now, $(**)$ gives us the curvature/divergence term in the Euler-Lagrange equations as well as the boundary condition after applying Green's first identity.  However, I don't understand how one might argue in this case why $(*)$ goes to 0 or why, for practical considerations, we can just ignore it.


texts: how to generate a smooth sine wave with time varying frequency in matlab

texts:
I'm currently designing a knock sensor for my FSAE team's car and I'd like to be able to test various software strategies with a fairly realistic signal (at least more realistic than a couple sine waves added together with some white noise).

From some reading, the frequencies I'll be getting will all be related to a fundamental frequency directly related to engine speed. As engine speed varies continuously, I'd like to be able to take a vector of times and transform it into a vector of frequencies that smoothly and randomly transition within the range 20-170 Hz, ideally with a uniform distribution. I can then create a couple sine waves based on these frequencies and a couple multiples, add them, add some white noise, add a knock at random points, then feed that into my knock detection code.

It's generating a smooth, uniformly distributed frequency vector that is my current issue, but I'm also open to other solutions to the problem.


texts: Manipulating with frequencies through fftw

texts:
I'm using portaudio for I/O audio streaming, and I wanted to apply some equalization on audio input from microphone. I found that most people refer to fft for task like that, so I use FFTW library in my project. My first idea was to select frequency bins in some range, from fft resulting complex array, and  increase their amplitudes by scaling them with some factors. But this resulting only in noise,  there is no sign of any equalization. So my question is, is it possible to increase volume at specified frequencies, through fft, and if so, how to do that. My experience so far makes me think that any change of those values in fft complex array just destroys the sound. Is there a proper way to manipulate with that complex data from fft resulting array?
Any tips for equalization other than fft are also welcome.


texts: Comparing an audio signal with a previous 'taught/profiled' signal

texts:
I'm working on a audio sample recognition project, where first you profile a sound and then run the sound detection function.

Currently during the 'profile' stage I'm grabbing copies of the magnitude frequency bin from the sound you want to detect (for a changeable pre-set amount of FFTs). During the detection phase I'm trying to use these to compare the similarity of the incoming identical length FFT, to see if they 'match'.

What would be some good methods to compare the two FFTs given that I have a 'learn' phase which can be used. I've tried comparing the maximum frequency bin, which works well to an extent. Voice recognition is easily fooled, with a tone generator (Which makes sense)'.

I'm sampling at 16000Hz with each FFT at 2048 samples long, equating to 128ms of data. Which I believe gives me a frequency range of ~8000hz.


texts:
I have a requirement to design minimax filter with linear programing (linprog in MATLAB).
To build the filter I must choose vector $\omega$ (frequency sample), how many values I need to take to get the optimal result? How to spread them across the interval $[0,\pi]$?


texts:
I am looking for a proof that a finite length sequence can only have an impulsive autocorrelation sequence if the sequence is a single impulse itself, ie.:

  assume $s[n]$ is nonzero for $n=0,1,2,3$ only and compute
  $$r_s[k]=\sum_{n=0}^{3-|k|}s[n]s[n+|k|]$$
  for $k=0,1,2,3$.

What are all the solutions for
$s[n]$ that make $r_s[k]=1$ for $k=0$ and $r_s[k]=0$ otherwise?


texts:
I'm trying to get my head around how band-edge frequency locked loops work. In particular, a diagram from this paper:

Specifically, what does the Tanh() function and the conjugate product of the two filters accomplish?

Explanations and references would be much appreciated.


texts: blur PSF modeling for small stright camera movement

texts:
I am interested in reovering images affected by blur of known orientation and known span.
Camera movement during capture is very small, blur span is of about 0-4px.

What is the most accurate way to model the blur PSF? For example, how would you model the blur PSF in these cases?

blur span: 0.6 pixels, blur orientation: 0°
blur span: 2 pixels, blur orientation: 0°
blur span: 3 pixels, blur orientation: 25°

I am actually interested in recovering as accurately as possible the details of the images down to single pixel resolution, so blur PSFs such as [.5 .5] and [.25 .5 .25] are significally different for my pourpose.


texts: Kalman Filter in Vision - Constant Velocity Model - Units

texts:
Let's assume we have series of frames with a known object. I want to track the object using Kalman filter using constant velocity / acceleration models. My questions are:

(i) Which model to use? CV or CA?
(ii) If I use CV, how to calculate velocity of object? and what is the unit of velocity? pixels/sec or m/s?
(iii) If I use CA, how do we evaluate velocity and acceleration of the object?
(iv) If object moves closer to camera, it drastically shifts in both x and y pixels. How do we accommodate this change? CV and CA models fail.

Please help..


texts:
I was curious to know which algorithm(stepwise) is used by the mironsets function of the MIRToolbox library to find the onsets in the audio signal. I am talking about the default functionality when we use mironsets.

Example:
o = mironsets('audio.wav')

Here o is the output onset strength envelope and looks like this

There are some questions like - Where is the negative part of the signal gone? Why not all local maximas are considered as onsets?


texts:
I am really trying to digest this paper, but the more I read it again, the more I realize that I never fully understood it.
Basically, I am trying to get an example where I can check the similarities between (28) and (29) to see I am doing things properly.
Here are some important parts that I am try to follow:

Eq 28 and Eq 29

I am using DCT-II as $T_a$ and $T_b$ and iDCT-I as $T_c$. Thus according to the paper, I must use the extensions HSHS on both $x$ and $y$, them the output will be a circular convolution of their extended versions

Then, we should be able to match this output by applying a multiplication operations on DCT representation of their unextended versions.

However, when I get to reproduce this, I don't see this resemblance.

There is no window $\mathcal{R}(n)$ I could extract from the first output bellow, that would match the second one.
It could be that the output values using the transforms would needed to be scaled, somehow, but even doing so, it would not change their shape in the plot, which I am using to compare both outputs.
According to the paper, I should get an extra sample on the approach using the transforms, since it outputs on the interval [-1, N-1], I am also not sure where that comes from.

In short: How to properly interpret and demonstrate this correspondence between (28) and (29) this combination of $T_a = T_b = \text{DCT-II}$ and $T_c = \text{DCT-I}$?


texts:
I'm trying to visualise downsampling in the frequency domain in matlab

I take a simple sinusoid, perform an fft and plot a two sided spectrum. Then I downsample the time domain signal (downsamplefactor D=2) and perform the same fft and two sided spectrum plot.

What i would expect to see: (This uses M, i use D as downsample factor)

(from:
Frequency Representation of Downsampled Signal)

So i'm expecting my frequencies to get stretched by a factor D and the amplitude should get scaled by 1/D. The stretching works as expected, however my amplitude doesnt scale. What am I missing/not seeing? Matlab code:

% normal signal -> fft -> plot
Fs = 100; %sampling frequency
T = 1/Fs; %sampling time
L = 500;  %signal length
f = 5;    %sine frequency

dF = Fs/L;      %frequency bin step
t = (0:L-1)*T;  %time vector
y = 2*sin(f*2*pi*t);    %sine

Y = fft(y);     %fft
P = abs(Y/L);   %extract magnitude plot

P2 = fftshift(P); %rearranges P to 2sided spectrum:negfreq,0component,posfreq

F2 = dF*(-L/2:1:L/2-1); %for when L is even
%F2 = dF*((-L+1)/2:1:(L+1)/2-1); %for when L is odd
F2rad = F2*pi/(Fs/2); % *pi /Nyquist to convert to [-pi pi]

figure, hold on
%plot(F2,P2) %frequency plot
plot(F2rad,P2) %radian plot

% downsampled signal -> fft -> plot

D = 2;
yd = y(1:D:L); %can also use downsample command
yd = downsample(y,D); %equal to above

Ld = length(yd); %downsampled length

Yd = fft(yd);

Pd = abs(Yd/Ld); %0component,posfreq,nyquist,negfreq
Pd2 = fftshift(Pd); %rearranges P to nyquist,negfreq,0component,posfreq

dFd = (Fs/D)/Ld; %frequency bin step

Fd2 = dFd*(-Ld/2:1:Ld/2-1); %for when L is even
%Fd2 = dF*((-L+1)/2:1:(L+1)/2-1); %for when L is odd
Fd2rad = Fd2*pi/(Fs/(2*D)); % *pi /Nyquist to convert to [-pi pi]

%plot(Fd2,Pd2) %frequency plot
plot(Fd2rad,Pd2) %radian plot


texts: Would it be feasible to implement the Sliding DFT on a digital signal processor?

texts:
The Sliding DFT generates the spectrum for every input sample. Using the FFT, the spectrum is generated only after a certain number of samples (N) are obtained. It appears to me as though the cycles to perform the Sliding DFT would be much larger than the cycles required to do an FFT, to generate an N point DFT. Would it be recommended to use the Sliding DFT to generate an N point spectrum? The motivation for me to consider using the Sliding DFT to generate an N point spectrum is time resolution.

Could anyone give me an idea of the challenges in implementing the Sliding DFT on a DSP?


texts: What are the best suitable type of image moments (Hu, Zernike etc.) that can be applied on an Image after DCT/DWT?

texts:
I want to perform a block by block comparison by using overlapping blocks and their respective image moments.
Can anybody suggest for type of image moment suited for blocks of DCT/DWT of that image. Hu moments are working fine for uint8 image but do not perform for DCT/DWT of same image.in DWT i wish to work on LL band.


texts: Difference between PSD estimate and variance of DFT

texts:
In Bartlett's PSD estimate one averages over L segments of the squared DFT coefficients. From wikipedia I found this formula

$$ \textrm{PSD}(k) = \frac{1}{L}\sum_{l=1}^{L} \frac{1}{M} \lvert X^{[l]}(k)\rvert^2 \tag{1}$$
where $X^{[l]}$ denotes the DFT of the $l^{\rm th}$ segment.

With my (not so standard) DFT Definition

$$
X(k) = \frac{1}{\sqrt{N}} \sum_{n=1}^{N}x[n]e^{-j\omega_kn},  \textrm{with } \omega_k = \frac{2\pi k}{N} \tag{2}
$$

Bartlett's method results in

$$\textrm{PSD}(k) = \frac{1}{L}\sum_{l=1}^{L} \frac{1}{M} \lvert\sqrt{M}\cdot X^{[l]}(k)\rvert^2 = \frac{1}{L}\sum_{l=1}^{L} \lvert X^{[l]}(k)\rvert^2 \tag{3}$$

A similar formula is given in my textbook for the (unbiased) sample variance of the DFT coefficients of a periodic signal:

$$ \hat{\sigma}_x^2(k) = \frac{1}{L-1}\sum_{l=1}^{L} \lvert X^{[l]}(k) - \hat{X}(k)\rvert^2 \tag4$$

with sample mean $\hat{X}(k) = \frac{1}{L} \sum_{l=1}^{L} X^{[l]}(k)$

Assuming that $\hat{X}=0$, equations $(3)$ and $(4)$  seem to be biased & unbiased estimates of the variance $\sigma_X^2(k)$.

Questions:

Always assuming  $\hat{X}=0$, is it generally correct  to interpret the PSD as an biased estimate of the DFT variance? If not, can someone  explain  the difference, please?
Would Bartlett's method become an unbiased estimator for the DFT variance if $(3)$  was scaled by $\frac{1}{L-1}$ instead of $\frac{1}{L}$?