texts: Band Limited Table Look Up Oscillator C++

texts:
I would like to create a Band Limited Table Lookup Oscillator that functions much like the sin() function in C++ works where i would inout a phase value and receive a sample value. for example Sample s = saw(x); or Sample s = square(x);.

To fill the table I would first generate an oversampled table by a factor of "X" that contains the wave in a non band limited state. Then I would run the table through a filter of some sort FIR or IIR most likely. Then i would decimate the table by a factor of "X" and hopefully then have a table that i could read from that would produce a band limited signal. I would also have to interpolate across the table to ensure that all phase angles will be accommodated for.

I would like to know if this theory would work? Meaning would this produce a signal that is Band limited.

I will mock up the basic code below.

double saw(double phase){
    return interpolate(phase);//i know this is incomplete
}

double fillTable(){
    double table[size*oversampling];

    //fill table here. skipping for length of example

    for(int i =0;i<tableSize;++i){
        table[i]=filter(table[i]);
    }
    double table2[size];
    int x=0;
    for(int i =0;i<tableSize;++i){
        table2[i]=table[x];
        x+=oversampling;
    }
}

//usage
sample x = saw(phase);

I know the code is incomplete and syntactically incorrect but i just wanted to give an example of what i would like to be able to do.

So again. Will this be Band limited?


texts: Echo cancellation supporting long delays and without frequency domain processing

texts:
AEC algorithms mostly rely on LMS adaptive filtering, i.e. you update FIR filter coefficients then perform the filtering. Theoretically, the FIR must be as long as the maximum echo length you want to cancel. For instance to cancel delays up to 500ms on a 48kHz signal, you'll need a 24000 point FIR.
When your memory and processing power limitations make it so you can neither afford to perform 24000 MACs per processed sample, nor to use FFT-based fast convolution algorithms, is there a way around for cancelling such potentially high length echoes in a more affordable way, given delay is unknown and potentially variable?

I was wondering maybe about some other algorithm running in parallel that could assess the approximate delay, then use an adaptive length delay line + a shorter adaptive FIR filter (up to a few hundreds taps is OK)

Does this make sense? Any other neat approach to suggest?


texts:
I am taking the Hilbert transform of a signal in Matlab and I don't understand part of the result.

Below are the complete signal $z(t)$ and phase $\phi(t)$, obtained with

phi=unwrap(angle(hilbert(z)))

I noticed a jump around point 400, so I zoomed this region. This is shown below.

Although the signal in this region is very well behaved, the phase has an almost discontinuity. Why?

It is not due to the unwrap command, as we can see below

The data can be found here


texts: Unsupervised learning algorithms to detect anomaly in waves

texts:
I have a sample of graphs (more than 10000...).
that look like in the image below:

I am searching for an unsupervised learning algorithms that can help me to detect anomalous observations.

Here what I suggest for beginning: for every observation I have a collection of points $(x,y)$. With this collection, I find Fourier series with regression (I compute coefficients with the base $\{1,\sin(x),\cos(x),\sin(2x),\cos(2x)\dots\}$).
Now I have a set of coefficients instead of waves.

Somebody have an idea how to detect anomaly?


texts:
I am developing an audio application for macOS that I would like to use to analyse the notes in a given section of music.
I am happy to work from an analysis of the frequencies in a given section then translate these frequencies to musical pitch if needed.
Is there an existing Audio Unit that will help me accomplish this?
If this is too broad a question, please suggest a way of identifying a suitable Audio Unit. A search on the web turns up very many spectrum analyser Audio Units, so advice on identifying one and what attributes I should be looking for would be appreciated.
If this is the wrong place to be asking about Audio Units at all, also please advise.


texts: Can picking an inappropriate roll-off frequency for a digital filter just alias the roll-off value?

texts:
I believe a related question is asked here, but my question deals more with what filter is realized if one fails to consider design parameters relative to sampling rate.

In designing an IIR filter we really want our roll-off frequency to be significantly less than the Nyquist frequency; it makes sense to do so. But what results if the designer fails to do so? Instability in the filter? A sort of aliasing of the rolloff frequency (not the signal)? Or are both possible?

For example I design a first order low pass filter that samples and computes output at 1000 Hz (Nyquist = 500 Hz), but I pick my filter pole at 1200 Hz!

Simulation shows that the resulting filter is stable , but of course the cutoff is much lower than expected.

It appears, at least for this example that it is not an aliasing of signal, but rather an aliasing of the design. Is there a better term than aliasing to use in this case?

Is there something more general to be said about improper design choice. In the case of a second order filter can the improper choice of bandwidth/sampling lead to instability in an IIR? Or rather the same result as the first order example?


texts: Practical implementation of IIR/biquad filters following non-textbook transfer function of real-wold analog filter

texts:
I am trying to program a DSP filter to study prototypes of loudspeaker filters, which will be implemented as passive analog circuits in the final speaker system. This process involves simulation of the electro-acoustics of the entire loudspeaker system, taking into account the real-world impedance curves of the loudspeaker drivers, their acoustic frequency response, and the acoustics of the loudspeaker enclosure. The resulting transfer curves of the (simulated) analog filters therefore do not follow any "textbook filter functions".

I tried fitting IIR/biquad filter coefficients to the target function defined by the analog filter. To this end I used the invfreqz function in GNU Octave. This method can achieve a very good fit of the IIR/biquad filter function to the target function of the analog filter. However, the IIR/biquad filters are usually not stable, so they are useless in my situation.

I think the Matlab implementation of the invfreqz function is a bit better at estimating stable filters, but I guess that might not be the definitive answer to the problem (I don't have access to Matlab, so I can't check). I would also like to implement the solution using free software, possibly by taking a somewhat different approach than "brute-fore application of invfreqz".

I am not very experienced with DSP filter methods, so I am a bit clueless as how to tackle this problem. What could be a practical approach to estimate IIR/biquad filter coefficients that give a transfer function that is "sufficiently similar" to an arbitrary target function defined by an analog filter?


texts: In speech recognition applications, how are different voice amplitudes handled? (i.e loud vs. quiet tones)

texts:
I am doing some research related to real-time voice/hotword recognition engines. In most current implementations, input is divided into frames (overlapping or not), and audio features are extracted per frame (most common being MFCCs) and fed into a Hidden Markov Model or a Neural Network of sorts.

Most papers I read address issues such as noise removal/reduction (using methods like Cepstral Mean Normalization), however I couldn't find any mention of how different voice amplitudes are handled. For example, I can train an engine to recognize my voice when I speak normally, however if I change my volume (speak louder), then the extracted features would look different (same shape but larger magnitude). Since this is a real-time system, I am not sure how real-time normalization is even possible, or whether it should be applied on the voice samples, or the extracted features. Or perhaps it is solved by training the system on variations in the speaker's volume?

Your help is greatly appreciated.


texts:
I am from an ML background and I am working on MP3 audio reconstruction and I have managed some amount of spectrogram reconstruction but I have noticed that the higher frequency end of the generated Power Spectral Density plot(Wave2) isn't matching with the original audio's plot (Wave1).

There is a similar distribution in the magnitude spectrum which is obvious since the two are linked. I wanted to know if there is any way I could regenerate the higher frequency power (or magnitude) because I cannot map the input PSD data to output PSD data as there is no way to convert the PSD data back to an audio clip even if I am successful in mapping them. The real and imaginary part re-constructions for the spectrogram reconstruction are visually pretty accurate but I am still unsure about how to approach this issue. Any guidance would be great!


texts: fft and inverse fft error size and applying impulse response matlab

texts:
I have a signal called noise. I am using the following command to calculate the mean squared error after fft and inverse fft process:

 sum((noise-real(ifft(fft(noise,2048),num_of_samples))).^2)/num_of_samples

Where num_of_samples=2819519 is the number of samples in the original signal.
I am getting an error of $\sim10^{-8}$. Is that reasonable and due to approximation or does that indicate something is not converted correctly?

My final goal is to multiply the signal in the frequency domain with a $1052\times 4$ given impulse response. This represents a room with 4 microphones.


texts:
I'm trying to compute using matlab the mutual information for an $ \infty $-PAM input (the limit of a very dense PAM constellation) for a range of snr and I got stuck.

I'm working with a real-valued scalar Gaussian channel with input power constrained to unity and standard Gaussian noise $ N \sim (0, 1) $. The output of the channel is given by,
$$ y = \sqrt{ \gamma } x + n $$

I know that under the power input constraint the input is uniformly distributed on $ \left[ -\sqrt{ 3 }, \sqrt{ 3 } \right] $.

I found that in HIGH-SNR regime, there exists a gap between the Shannon capacity and the capacity achieved with $ \infty $-PAM around 0.254 bits. I know this is called the shaping loss and represents the loss of using an uniform input rather than a Gaussian input.

I know how to compute that. But, I got stuck trying to compute the capacity for a range of snr or $ \gamma $. I tried using the formula,
$$ I(x;y) = h(y) - h(n) $$
with $ f_{y}(y) = \int f_{x}(x)f_{y|x}(y|x) dx $ and I got
$$ f_{y} (y) = \frac{ 1 }{ 2 \sqrt{ 3 \gamma } } \frac{ 1 }{ 2 } \int_{ \frac{ y - \sqrt{3} }{ \sqrt{2} } }^{ \frac{ y + \sqrt{3} }{ \sqrt{2} } } \frac{ 2 }{ \sqrt{ \pi } } e^{ -t^{2} } dt \\
= \frac{ 1 }{ 2 \sqrt{ 3 \gamma } } \frac{ 1 }{ 2 } \left[ \text{erf} \left( \frac{ y + \sqrt{ 3 \gamma } }{ \sqrt{ 2 } } \right) - \text{erf} \left( \frac{ y - \sqrt{ 3 \gamma } }{ \sqrt{ 2 } } \right) \right] $$

I tried to compute $ h(y) = \int_{-\infty}^{\infty} f_{y} (y) \log_{2} f_{y} (y) $ and the integral does not converge. I tried with int$(\cdot)$ and integral$(\cdot)$ methods in matlab.

I also tried approximating the $ \text{erf}(\cdot) $ function with Taylor series expansion
$$ erf(x) = \frac{ 2 }{ \sqrt{ \pi } } \sum_{ n = 0 }^{ \infty } \frac{ (-1)^{n} x^{ 2n + 1 } }{ n!(2n + 1) } $$
but it didn't work.

How can I obtain a more manageable integral? Is my approach correct?

I appreciate any help!! Thanks.


texts: Fragmented recovered image using a Phase Retrieval Algorithm named Error-Reduction

texts:
After reading the paper Phase retrieval algorithms: a comparison by J.R.Fienup. I implemented the Error-Reduction Algorithm in MATLAB. The initial phase input was randomly generated, so the final recovered image in each execution is different. The only information given is the Fourier Modulus of the original image.
Sometimes I can get a pretty well result, but most of the time the result is a fragmented version of the original image as the figures below shown:

As you can see, the image of $\pi$ is "almost" recovered except that the head and the body of $\pi$ had been cut and swapped.
My questions are:
1. Is this a common problem using phase retrieval algorithm? What causes this?
2. Is there any method to avoid this?
3. Is there any other great methods in phase retrieval?


texts: Fast fourier transform for an audio file

texts:
I need to do FFT on an audio file(to be exact it is a real number array of audio samples). But the output of FFT should be complex numbers. I have a hard time understanding how to convert this.
For example: input is int input[N], and what to do next to get the output.re[] and output.imp[]? Should I treat input as a complex array only all the imaginary components equal to 0?
Thanks!


texts:
I have been acquiring data through ADC and into memory, the input signal are square waves that step down in frequency as time goes by. Due to memory, I have a fixed maximum number of samples per FFT. But I would like to compare their magnitudes, and phase along side each other. The max length of FFT is good enough for frequency resolution, I am just wondering if I have a bunch of data that's been processed through FFT, can I sort of just add them to combine their total magnitude and phase? or will the addition cause bias and distortion?

Also, I was wondering since I noticed that at low frequencies, the flicker noise seems to increase the noise floor, is it possible to have a magnitude correction filter or equalizer to push the rest of the signals up such that I can have a common noise floor when I go through all my input signals?

Thank you.


texts: How can I specify the distance between values in such row

texts:
I have a question, about verifying the value which are near to each other in such row, Is there any algorithm which can determine that ?

Suppose I have a vector $z_i =$ {$z_1 , z_2, z_3, . . . ., z_n$}, I want first to determine the maximum and minimum values of this vector, then check if the distance between each other value is smaller compare then maximum and to minimum values. In other words, it means  dividing the vector into two categories and then check if the value is nearer to first category or second.

Is there any algorithm can do that?

thank you


texts: Is the sum of discrete sinusoids an eigenfunction of an LTI system?

texts: Does $$x[n]=e^{j\omega n}+e^{2j\omega n}$$ represent an eigenfunction of an LTI system?


texts: IIR filtering vs IFFT filtering by zero binning and making bandpass IIR filters with high sample rates?

texts:
I am having some issues making thin IIR filters that work at the sample rate of my data and was wondering if there is a way to improve my method? I am also curious about the deficiencies in using the method of filtering of applying and FFT, bin-zeroing and the IFFTing back to get the filtered data.

For example I use scipy.signal.iirdesign with scipy.signal.filtfilt to filter a 300KHz signal with a 5MHz sample frequency with bandwidth of 4KHz and a transition width of 1KHz. If I do this I find I get NaNs in the filtered signal, if I reduce the sample frequency by indexing every $N^{th}$ element of the data (e.g. by Signal[::N]) I get a correctly filtered signal if I use N=4 (i.e. sample frequency of 5/4MHz). However this is not ideal as I am having to reduce the sample rate of my data and can therefore get no higher temporal resolution. I can increase this frequency by widening the bandpass but this is undesirable as other frequencies are often present nearby.

I have also found I can create very thin filters by FFTing, zeroing bins and then IFFTing and this works great for a perfect sine wave signal with some noise. However I am interested in extracting a sine wave with random instantaneous phase jumps, and this appears (in simulated tests I have done where i know the true sine wave a-priori) to result in ripples in the amplitude of the signal with the ripples extending furthur the larger the phase shift between the first half of the signal and the next but this is sometimes a preferable method if I can not construct a filter with scipy that will work with the original sample frequency of the data and requires down-sampling.

The following plots demonstrate what I observe.

The blue is the true signal, the red is the filtered signal.

The first plots are a perfect sine wave with no phase shifts or amplitude variation:

IIR:

IFFT:

The IFFT works much better, but this is not that surprising to me since this is a perfect sine wave and is not particularly realistic to observe.

The next plots are of sine wave with a phase shifts of pi/4 in the center with no amplitude variation:

IIR:

IFFT:

The IIR filter used for this has a bandwidth of 1KHz and a transition width of 0.5KHz, it also has a sample frequency that is 4 times less than the original data. The IFFT filter had a bandwidth of 500KHz and appears to fit what the data is doing much closer, it also benefits from having the same sample frequency as the original data.

It would appear from this that using the IFFT filtering method is vastly superior but I know that it should introduce a sinc function to the time signal and the reason FIR and IIR filters are used to approximate a perfect rectangular window in frequency space is that doing so is a bad idea due to the introduction of this sinc function. What is wrong with IFFT filtering in this way with zero binning and how might I improve my method of bandpass filtering such that I can retain a high sample rate and a reasonable thin frequency window?


texts: How to show that y[n] = x[n] * h[n] turns into the Y(z) = X(z).H(z)?

texts:
I'm trying to show that $y[n]=x[n]*h[n]$  turns into $Y(z) = X(z)H(z)$ in Z-domain by first applying convolution then by taking the inverse Z-transform of the $Y(z)$, stating that it's the same sequence after all. However, in power series expansion an extra term appears which kills the equation. You can find the question below; I added it as an image.

I'd be grateful if you could help.
Thank you


texts: How can I move a signal in frequency so that it ends at the frequency zero?

texts: I am trying to move a signal to 0 in the frequency domain but I am not sure how to do it.


texts: Why would the audio from .mp4 files be audible on some devices but not others?

texts:
I don't know if this question is best suited for Signal Processing, Sound Design, or Video Production. If someone knows for sure that can do so, please migrate this question to the best forum for it (I'm guessing "Signal Processing" for now).

I have posted some mp4 files on the Internet, both on YouTube and on a dedicated facebook page. Most people have no problem with seeing the video and hearing the audio emanating from these files.

Two people, though, have complained (or mentioned, anyway) that they cannot hear the audio. One of them was using a Windows desktop, and the other an iPhone.

What are the reasons why some may not hear audio, while others can - when they can hear audio otherwise on their device?

The files in question (half a dozen of them) are here.

For a direct link to one particular one, you can try this.

Or, from YouTube, here's one.

Is it anything on my end that I can "fix," either in-place or locally and then re-upload? It'd be hard to test when I had accomplished my goal of making them audible to all, as they work for me already...


texts: How are phases dealt with when using FFT with blocks

texts:
An FFT of a signal returns a complex number, with a phase angle related to the starting location of each frequency within the signal. If I have break my signal into blocks, and FFT them individually, the phase angle is changing in time. Is there a smart way to 'average' these phase angles - I know a direct average over time will give you a 0, if you have enough points.

I can offset the phase by the amount of my window shift, but I'm wondering if there is anything more robust, that can handle noisy signals. Also, if the FFT bin width is not sufficiently accurate, the offset will be slightly off and hence won't correct properly.

Here is a block of code that shows what I've done so far:

fs = 1000; % sampling frequency
fp = 5; % peak frequency
t = [1/fs : 1/fs : 100]'; % time signal
x = sin(t * fp * 2 * pi + rand(length(t),1)); % data signal

% FFT block sizes:
N = 2^11;
Ns = 2^4;

% Split data into blocks:
for ii = 1:ceil((length(x)-N+1)/Ns) % loop for each window
    xx(:,ii) = x(((ii-1)*Ns+1):((ii-1)*Ns+N));
    tt(:,ii) = t(((ii-1)*Ns+1):((ii-1)*Ns+N));
end

% Plot first five blocks
for jj = 1:5
    subplot(5,1,jj);    plot(tt(:,jj),xx(:,jj)); title(sprintf('Block %g',jj));
end

% FFT each block
window_fn = hanning(N) * ones(1,size(xx,2)); % window function
yy=window_fn.*(xx-ones(N,1)*(mean(xx))); %remove mean and window each block
% Plot first five blocks
for jj = 1:5
    subplot(5,1,jj); hold on; plot(tt(:,jj),yy(:,jj)); ylim([-1 1]); xlim([0 t(N+Ns*4)]);
end

nfft = N * 4; % zero pad
fftx = fft(yy,nfft);

% Find peak frequency from mean of power of each window
mx = abs(fftx).^2 / N/fs;
NumUniquePts = ceil((nfft+1)/2);
f = (0:NumUniquePts-1)*fs/nfft;
fftx = fftx(1:NumUniquePts,:);
[~,peakf] = max(mean(mx,2));

% Get phase information from each block;
phi = fftx(peakf,:);
figure; plot(angle(phi),'s-'); xlim([0 50]); %unwrap is helpful too

% rotate the complex number by the phase offset (from Ns)
shift = (0:(length(phi)-1)) * (Ns/fs)  * f(peakf);
newphi = phi .* exp(1i * shift*-2*pi);
hold on;
plot(angle(newphi),'.-');
xlabel('First 50 blocks'); ylabel('$\phi$');


texts: How to remove lines from captcha image which are acting as noise using java?

texts:
The images are attached here. I first converted the sample image to grayscale and then binarized it.

Finally i applied median filter to remove the dots from the image. However i am unable to remove the lines which are acting as noise in the image. Kindly help me out.

Original Image:

Processed Image:


texts: SIS Particle Filter Python Implementation

texts:
Lets say I have some time series data which I generated like this:

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import uniform

# Length of time series
N=400

# Gaussian random numbers as an excitation signal
ex = np.random.randn(N)

# Second order AR Process with coefficients slowly changing in time
a0 = np.array([1.2, -0.4])
A = np.zeros((N,2))
omega, alpha = N/2, 0.1

for n in range(N):
    A[n,0] = a0[0] + alpha * np.cos(2*np.pi*n/N)
    A[n,1] = a0[1] + alpha * np.sin(np.pi*n/N)

S = ex.copy()
for n in range(2,N):
    x = np.array([S[n-1], S[n-2]])
    S[n] = np.dot(x, A[n,:]) + ex[n]

fig,ax = plt.subplots(nrows=2, ncols=2, figsize=(9,4))
plt.tight_layout()
ax[1,0].plot(range(N), A[:,0])
ax[1,0].grid(True)
ax[1,0].set_title("Coefficient a0", color='m')
ax[1,1].plot(range(N), A[:,1], color='m')
ax[1,1].grid(True)
ax[1,1].set_title("Coefficient a1", color='m')
ax[0,0].plot(range(N), ex)
ax[0,0].grid(True)
ax[0,0].set_title("Random Excitation Signal")
ax[0,1].plot(range(N), S, color='m')
ax[0,1].grid(True)
ax[0,1].set_title("Time Varying Autoregressive Process")

How do I implement a Sequential Importance Sampling Particle Filter on this data? I understand all the theory and the maths behind it and even saw some examples of implementation on different problems but none of them work with similar data. For example, https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/12-Particle-Filters.ipynb deals with robot movements and landmarks and I just want to apply the algorithm to a simple time series data...Can anyone help me with the implementation? I'm especially confused as to how to do the sampling part...


texts: Estimating number of sinusoid from spectral estimation

texts:
Suppose I am given a data X0 that have 50 realizations of a sum of an unknown number of sinusoids in additive white Gaussian noise.

I plotted the Spectral estimate as attached. How do I estimate the number of sinusoids in X0, their frequencies, and their relative amplitudes?
is it just the peak?

Edit:

n1 = 1; n2 = length(x)
Px = abs(fft(x(n1:n2),1024)).^2/(n2-n1+1);
Px(1)=Px(2);


texts: Calculating gain coefficients for comb filters in Moorer's algorithm

texts:
Could someone explain how Moorer calculated the gain coefficients for the comb filters in his reverb? In his book, Udo Zölzer's layed out this equation:

$$g = 10 ^ {-3 \left(\mathrm{Reverb \ Time} \cdot \frac{\mathrm{Sampling \ Rate}}{\mathrm{Delay \ length \ in \ samples}}\right)}$$

In his paper for the first comb filter he gives $50 \ \mathrm{ms}$ for the delay and the gain coefficient sampled at $25 \ \mathrm{kHz}$ to be $0.24$ given that reverb time is about $2$ seconds.

So if I plugged in those values I don't get near $0.24$,
$10 ^ {-3 \frac{2 \cdot 25000} {50 \cdot 25}}$.


texts: Can you average out focal length from different camera calibration sessions?

texts: If I perform a number of camera calibration routines at a fixed resolution, with various sizes of calibration patterns (like checkerboards), at various distances and get various values for focal lengths,  could I just average them out? Would this just give a more "robust" focal length? Is it a good idea?


texts:
Let's consider generating samples of a random process like white Gaussian noise (AWGN). Let's assume I am generating $N$ samples of AWGN with variance $\sigma ^2$ in MATLAB by using randn() funtion i.e.:

\begin{equation} \tag{1}\label{Eq:n}
    n_1 = \sigma * \text{randn}(N,1) \\
    n_2 = \sigma * \text{randn}(N,1)
\end{equation}

Note that, here I am not sampling a noise signal to get these samples. I am simply generating some random numbers to consume them later.

Now I want to add these noise samples to my clean signal samples. Let's assume I have two cases of clean signal samples, namely $y$ which has a sampling frequency of $f_s$ and $z$ which has a sampling frequency of $2f_s$. So we have

\begin{equation} \tag{2}\label{Eq:y_n}
    y_n = y + n_1
\end{equation}

\begin{equation} \tag{3}\label{Eq:z_n}
    z_n = z + n_2
\end{equation}

This means that in $y_n$ I am using noise samples with the rate $f_s$ and in $z_n$ and I am using noise samples with the rate $2f_s$.

Since here we are dealing with random process, instead of frequency spectrum we have the power spectral density (PSD). Let's name the PSD of $y_n$ and $z_n$, $S_{yy}(\omega)$ and $S_{zz}(\omega)$ respectively. Also let's consider the PSD of noise in Eq. \eqref{Eq:y_n} which is read at the lower rate is $S_{nn1}(\omega)$ and the PSD of noise in Eq. \eqref{Eq:z_n} which is read at the higher rate is $S_{nn2}(\omega)$

Question 1) How are $S_{nn1}(\omega)$ and $S_{nn2}(\omega)$ different? More precisely, if you want to draw them on the frequency axis how do they look? Does $S_{nn1}(\omega)$ span from 0 to $f_s$ and  $S_{nn2}(\omega)$ span from 0 to $2f_s$?
And if you calculate the area underneath them (which shows the power or variance of the noise) which one is greater? Do they have the same power?

Let's consider the auto-correlation and PSD for random processes. We know that PSD is the DTFT of the auto-correlation, more specifically:

\begin{equation} \tag{4}\label{Eq:DTFT}
    R_{nn}(m) = \frac{\Delta t}{2 \pi}\int_{0}^{\frac{2\pi}{\Delta t}} S_{nn}(\omega) e^{j\omega m \Delta t} d \omega,
\end{equation}
where $R_{nn}$ is the auto-correlation and $S_{nn}(\omega)$ is the PSD.

From Eq. \eqref{Eq:DTFT} we have:
\begin{equation} \tag{5}\label{Eq:Rnn}
    R_{nn}(0) = \frac{\Delta t}{2 \pi}\int_{0}^{\frac{2\pi}{\Delta t}} S_{nn}(\omega) d \omega,
\end{equation}
which means the area under PSD (which is the power of the signal) is given by the auto-correlation at zero.

Question 2) Which one gives the power of the signal, just the output of the integral (without the multiplier) in Eq. \eqref{Eq:Rnn}, or the whole Eq. \eqref{Eq:Rnn}?

Question 3) This is the continue of question 1, or maybe similar to it. I basically want to know how Eq. \eqref{Eq:Rnn} changes for noises $n_1$ and $n_2$? Cause obviously in Eq. \eqref{Eq:Rnn}, $\Delta t$ is changing for the noise when the sampling rate is changed. But how $R_{nn1}$ and $R_{nn2}$ or $S_{nn1}$ and $S_{nn2}$ change when sampling rate changes?

I appreciate if someone can mathematically explain these to me.


texts:
I have a sampled pulse shape:
$ h = [1, 0.5]$ and I do not know what is its real underlying continuous-time pulse. I want to compute the samples of $h(t-\Delta t)$.

If I write the continuous pulse with $\text{sinc}$ basis functions, I have:
$$ h(t) = \text{sinc}(t) + 0.5\times \text{sinc}(t-1)$$
Therefore, here, I can compute the new samples (samples of the time-shifted continuous pulse shape) with $\text{sinc}$ interpolation i.e. convolving with a $\text{sinc}$:
$$h'_k = g_k(\Delta t)* h_k$$
where $g_k = \text{sinc}(kT+\Delta t)$ and $h_k = h(kT)$ where $T$ is the sampling period.

Now, the question is that If I write $h(t)$ in terms of another basis, e.g. a spline, how can I apply the shift then? convolving with the same but shifted spline?


texts:
I hope this is the right place to ask.
In the movies, it is always possible to extract text from an image no matter how faint or blurred! As a layperson I don't know to what extent this is possible.
Specifically, in the following WW2 photograph of a V1 flying bomb, I have reason to believe that there may be some text in the area indicated.

https://i.stack.imgur.com/WW1SH.png
Question
Is there a simple process for isolating this text (if it exists) so that it becomes more clearly visible?
If so, what is the technique called and, incidentally, do you know of any free software to do this?


texts: how could correlation-based image patches matching works?

texts:
In general, correlation-based image matching can be referred to as
$$c(I_1,I_2) = \sum_{x \in patch} f(I_1(x), I_2(x))$$
, I do think normalized cross-correlation like
$$ncc(I_1, I_2) = \sum_{x \in patch}\frac{(I_1(x) - \mu_1)(I_2(x) - \mu_2)}{\delta_1\delta_2}$$.
is a good indicator to show if 2 patches match or not.

BUT my problem is that, if
$$\begin{eqnarray*}
f(I_1(x), I_2(x)) &=& \sum_{x \in patch}I_1(x) \cdot I_2(x)
\end{eqnarray*}
$$
, then I don't think $c(I_1, I_2)$ will be a good, right?

Furthermore, this type of correlation-based matching techniques won't work well if one of the images rotates, right?


texts: Detect keypoints in images without corners

texts:
I am trying to achieve a pattern matching between an image and a scene in which the image is. I am having problems with some images that does not contain corners, since SURF is not able to find keypoints.

Does anybody know any algorithm or method for retrieving keypoints in images without corners? In other words: how can I find an image inside another when this image does not contain corners?

I am using Matlab. Thank you in advance,


texts: Measure the amount of drift in video and audio frames

texts:
I setup a stereo system using 2 GoPro Hero Session Cameras, since I need a larger baseline than the one of the Dual Hero System.

This unfortunately means the two cameras are not genlocked and as a result I expect there to be some drifting between the frames of the two video/audio signals. I am using the GoPro remote to start and stop the videos at the same time, but this is obviously not going to solve the problem.

The nominal camera frame rate and audio sampling rate are 60Hz and 32KHz respectively.

I extracted the two .mp4 and .wav files using the python libraries imageio and scipy, and as expected the number of frames don't match.

import imageio
import scipy.io.wavfile as wavereader
video_frames_l = imageio.get_reader(video_l_path,  'ffmpeg')
video_frames_r = imageio.get_reader(video_r_path,  'ffmpeg')
srate_l, audio_frames_l = wavereader.read(audio_l_path)
srate_r, audio_frames_r = wavereader.read(audio_r_path)

print "Left num. video frames : %d"%len(video_frames_l) #prints 20922
print "Right num. video frames: %d"%len(video_frames_r) #prints 20914
print "Left num. audio frames : %d"%len(audio_frames_l) #prints 11168768
print "Right num. audio frames: %d"%len(audio_frames_r) #prints 11164672

I'd like to know how can I quantify:

The synchronization between the two video/audio signals without any post-processing?
How much drift was there over the whole recording?

And more importantly:

How can I improve synchronization in post-processing?

During recording I went into a dark silent room and turned lights on and off and clapped my hands a few times to create some signal.

Thanks for any pointers!


texts: Power spectral density of sinusoidal signal in noise

texts:
In a literature I face with this input and power spectral density (PSD)
$$x(t)=s(t)+n(t)=A\cos\left(\omega_c t +\phi\right) + n(t)$$

first I want to know

How can we find PSD of $\cos\left(\omega_c t +\phi\right)$?(I have found the autocorrelation function of $\cos\left(\omega_c t +\phi\right)$ but when I apply the PSD with Fourier transform it doesn't return the same result as the figure)
Why do we divided PSD of $\cos\left(\omega_c t +\phi\right)$ by $R_L$?
What is a bandpass filter's transfer function in time and frequency? And how can we find PSD of a bandpass?

Sorry for the simple question but I think I got confusing.


texts: Derivation of $ R_{N(t)}(\tau) $ from its $f_{N(t)}(\eta)$

texts:
How can we prove the auto-correlation function of white gaussian noise $\{ R_{N(t)}(\tau) \}$ is $\frac{N_0}{2} \delta(\tau)$ from its p.d.f in equation below?
$$
f_{N(t)}(\eta)=\frac{1}{\sqrt{2 \pi \sigma^2}}\exp\left(\frac{-(\eta-\mu)^2}{2 \sigma^2}\right)
$$

My Approach:

We know: $\frac{N_0}{2}=\sigma^2 \quad(\text{ or variance}) \tag{1}$
We also know:
$$
R_{X(t)}(\tau)= E[X(t)X(t+ \tau)]=\int_{y=- \infty}^{\infty} \int_{x= - \infty}^{\infty} x \space y \space f_{X(t) X(t+\tau)}(x,y)  \space dx  \space dy
$$
Where $f_{X(t) X(t+\tau)}(x,y) \text{ is joint p.d.f}$
$$\text{so , } R_{N(t)}(\tau)= E[N(t)N(t+ \tau)]=\int_{y=- \infty}^{\infty} \int_{x= - \infty}^{\infty} x \space y \space f_{N(t)N(t+\tau)}(x,y)  \space dx  \space dy$$
Now we know
$$f_{N(t)}(\eta)=\frac{1}{\sqrt{2 \pi \sigma^2}}\exp\left(\frac{-(\eta-\mu)^2}{2 \sigma^2}\right)$$
then, how can we find $f_{N(t)N(t+\tau)}(x,y)$ ?


texts:
Find the Discrete-time Fourier transform of $ f[k] = 3^k u(-k-1)$
  (then sketch it and find its magnitude & angle).

It doesn't fit any templates on the Fourier table, and I don't see how one could re-arrange this expression to solve it. So, how?

Also for $\mathcal Z$-transform, how does one solve:

  you have $\displaystyle H(z) = \frac{1}{1 - \frac 12 z^{-1}}$
  and input to that is $f[k] = 2^k$

How do you find $y(t)$?

The general formula of $\mathcal Z$-transform is:

$$F(z) = \sum_{k=\infty}^{0} f[k] z^{-k}$$


texts: How to determine cut off frequency for high pass filter using spectral density?

texts:
I have filtered out the low frequency noise from the signal. For further analysis, I want to compare it with FIR filters (for which I require cut off frequency). Hence, I took the power density spectrum of noise using Welch method and found its peak and used the same as cut off frequency. The PSD looks like this .

What would be the cut off frequency? The peak occurs at $0.0031$ Hz or should I take a value between $0-0.5$Hz.

Note: The frequency range of my signal is $0-2$ Hz


texts: ICA - Statistical Independence & Eigenvalues of Covariance Matrix

texts:
I am currently creating different signals using Matlab, mixing them by multiplying them by a mixing matrix A, and then trying to get back the original signals using FastICA.

So far, the recovered signals are really bad when compared to the original ones, which was not what I expected.

I'm trying to see whether I'm doing anything wrong. The signals I'm generating are the following:

s1 = (-x.^2 + 100*x + 500) / 3000; % quadratic
s2 = exp(-x / 10); % -ve exponential
s3 = (sin(x)+ 1) * 0.5; % sine
s4 = 0.5 + 0.1 * randn(size(x, 2), 1); % gaussian
s5 = (sawtooth(x, 0.75)+ 1) * 0.5; % sawtooth

One condition for ICA to be successful is that at most one signal is Gaussian, and I've observed this in my signal generation.

However, another condition is that all signals are statistically independent.

All I know is that this means that, given two signals A & B, knowing one signal does not give any information with regards to the other, i.e.: P(A|B) = P(A) where P is the probability.

Now my question is this: Are my signals statistically independent? Is there any way I can determine this? Perhaps some property that must be observed?

Another thing I've noticed is that when I calculate the eigenvalues of the covariance matrix (calculated for the matrix containing the mixed signals), the eigenspectrum seems to show that there is only one (main) principal component. What does this really mean? Shouldn't there be 5, since I have 5 (supposedly) independent signals?

For example, when using the following mixing matrix:

A =

0.2000    0.4267    0.2133    0.1067    0.0533
0.2909    0.2000    0.2909    0.1455    0.0727
0.1333    0.2667    0.2000    0.2667    0.1333
0.0727    0.1455    0.2909    0.2000    0.2909
0.0533    0.1067    0.2133    0.4267    0.2000

The eigenvalues are: 0.0000 0.0005 0.0022 0.0042 0.0345 (only 4!)

When using the identity matrix as the mixing matrix (i.e. the mixed signals are the same as the original ones), the eigenspectrum is: 0.0103 0.0199 0.0330 0.0811 0.1762. There still is one value much larger than the rest..

Thank you for your help.

I apologise if the answers to my questions are painfully obvious, but I'm really new to statistics, ICA and Matlab. Thanks again.

EDIT

I have 500 samples of each signal, in the range [0.2, 100], in steps of 0.2, i.e. x = 0:0.1:100.

Also, given the ICA Model: X = As + n (I'm not adding any noise at the moment), I am referring to the eigenspectrum of the transpose of X, i.e. eig(cov(X')).

UPDATE

As suggested (refer to comments), I tried FastICA on only 2 signals. The results were quite good (see pic below). The mixing matrix used was A = [0.75 0.25; 0.25 0.75]. However, the eigenspectrum  0.1657 0.7732 still showed only one main principal component.

My question therefore boils down to the following: What function/equation/property can I use to check whether a number of signal vectors are statistically independent?


texts:
There are many techniques in signal processing that use eigen analysis (MUSIC, SVD, eigen decomposition, etc) that result in signal and noise subspaces.The mathematical definitions for signal subspaces are abundant, but what is the intuitive, tangible explanation of what a subspace is representing? More importantly, how does one interpret the values of a subspace? What exactly does this result provide and what is an example of how one would use it? Nearly any topic I can think of in signal processing has very intuitive explanations of complex topics - but I've yet to see a good one for subspaces.
EDIT: The crux of the question is, what is the intuitive explanation of subspace as it applies to signal processing algorithms and applications (i.e., not the linear algebra explanation)?


texts: Abs(poles) < 1 by what margin for a stable filter?

texts: I checked the literature for recent algorithms used to design a digital filter that is a minimax approximation of a desired frequency response. All the articles I found work out examples where all the poles have magnitude less than 0.92, or less that 0.89, etc. I havn't seen a published example with a pole having magnitude 0.95 and certainly not 0.9995. If a filter is implemented with double precision machine arithmetic, how close to the unit circle can a pole get to get a useful filter? Would it be a bad idea to have a pole with magnitude 0.95?


texts: Swift vDSP rFFT not same as Python np.fft.rfft()

texts:
I am trying to implement real FFT in iOS, for that i am using Accelerate Framework. Here is my Code for Swift.
    class FFT {

private var fftSetup: FFTSetup?
private var log2n: Float?
private var length: Int?

func initialize(count: Int){
    length = count
    log2n = log2(Float(length!))
    self.fftSetup = vDSP_create_fftsetup(vDSP_Length(log2n!), FFTRadix(kFFTRadix2))!
}

func computeFFT(input: [Float]) -> ([Float], [Float]) {

    var real = input
    var imag = [Float](repeating: 0.0, count: input.count)
    var splitComplexBuffer = DSPSplitComplex(realp: &real, imagp: &imag)

    let halfLength = (input.count/2) + 1
    real = [Float](repeating: 0.0, count: halfLength)
    imag = [Float](repeating: 0.0, count: halfLength)

    // input is alternated across the real and imaginary arrays of the DSPSplitComplex structure
    splitComplexBuffer = DSPSplitComplex(fromInputArray: input, realParts: &real, imaginaryParts: &imag)

    // even though there are 2 real and 2 imaginary output elements, we still need to ask the fft to process 4 input samples
    vDSP_fft_zrip(fftSetup!, &splitComplexBuffer, 1, vDSP_Length(log2n!), FFTDirection(FFT_FORWARD))

    // zrip results are 2x the standard FFT and need to be scaled
    var scaleFactor = Float(1.0/2.0)
    vDSP_vsmul(splitComplexBuffer.realp, 1, &scaleFactor, splitComplexBuffer.realp, 1, vDSP_Length(halfLength))
    vDSP_vsmul(splitComplexBuffer.imagp, 1, &scaleFactor, splitComplexBuffer.imagp, 1, vDSP_Length(halfLength))

    return (real, imag)

}

func computeIFFT(real: [Float], imag: [Float]) -> [Float]{

    var real = [Float](real)
    var imag = [Float](imag)

    var result : [Float] = [Float](repeating: 0.0, count: length!)
    var resultAsComplex : UnsafeMutablePointer<DSPComplex>? = nil

    result.withUnsafeMutableBytes {
        resultAsComplex = $0.baseAddress?.bindMemory(to: DSPComplex.self, capacity: 512)
    }

    var splitComplexBuffer = DSPSplitComplex(realp: &real, imagp: &imag)

    vDSP_fft_zrip(fftSetup!, &splitComplexBuffer, 1, vDSP_Length(log2n!), FFTDirection(FFT_INVERSE));

    vDSP_ztoc(&splitComplexBuffer, 1, resultAsComplex!, 2, vDSP_Length(length! / 2));
    //
    //// Neither the forward nor inverse FFT does any scaling. Here we compensate for that.
    var scale : Float = 1.0/Float(length!);
    var copyOfResult = result;
    vDSP_vsmul(&result, 1, &scale, &copyOfResult, 1, vDSP_Length(length!));
    result = copyOfResult

    return result
}

func deinitialize(){
    vDSP_destroy_fftsetup(fftSetup)
}

Here is my code of Python for computing of rFFT and irFFT
    # calculate fft of input block
    in_block_fft = np.fft.rfft(np.squeeze(in_buffer)).astype("complex64")

# apply mask and calculate the ifft
    estimated_block = np.fft.irfft(in_block_fft * out_mask)

Question:

Swift: If I compute rFFT for a 512 frame and apply irFFT to the resultant of rFFT, I get the same original array.

Python: Same goes for Python, if I take rFFT and irFFT I get the original array in return.

Problem: The problem occurs if I compare the results of Swift rFFT and Python rFFT. Their results are different in decimal values. Sometimes the real part is same but the imaginary is totally different.

I tried different Framework in Python like Numpy, SciPy and TensorFlow and their results are exactly the same (Slight different in decimal part). But when I calculate rfft on same input for iOS using the Swift code above, results are different.
If anybody who has experience with Accelerate Framework and holds the knowledge of FFT help me out with this one would be very helpful. I have limited knowledge of FFT.


texts:
I am doing realtime audio. Let's say I have a signal $x(n)$ which is passed in blocks of 512 (siobuffer) to the program filter/FFT method. Within this block I want to convolve the signal with the filter $u(n)$ (impulse response) of length 8192K.
So I zero pad the asio block from 513 to 8192K, do FFT of both arrays and multiply the results. After IFFT, I get the convolved signal $y(n)$ of length 8192K which I want to pass to the output asio buffer (lets say of length 512, too).

Now comes my problem: how much overlap-add to use? From my understanding, I must overlapp add the whole 8192K to the last byte, no? This means I divide $y(n)$ of 8192 by 512 into 16 blocks and subsequently overlapp-add all those 512 blocks to the next processed input blocks. When I read about overlap add in general, there are always examples where people have outputs $y(n)$ just a little longer than the input, so they normally overlap add approximately 1.5 of a imputblock.

Is there a mistake in my thoughts? Do I just need to overlapp add parts of $y(n)$, or must I overlap add all my 16 blocks each time?


texts: I'm working on an application which need to use the full set of 17 MPEG-7 low-level descriptors. Is there any library I can use for it? Preferably with a Python wrapper/API...


texts: How to plot magnitude and phase response of 2 cascaded filters in Matlab?

texts:
How would I go about plotting a magnitude and phase response of a system that consists of two cascaded 2nd order Butterworth filters in Matlab? Filters are the same.

% Filter coeffs:
[B, A] = butter( 2, 1000/8000*2, 'high' ); % Cutoff at 1000 Hz, fs 8000 Hz.

% Cascade 2 filters: input -> filter -> filter -> output :
[out1, state1 ] = filter( B, A, in,   state1);
[out2, state2 ] = filter( B, A, out1, state2);


texts: How to obtain height above ground, angle the pixel’s local surface normal makes with the inferred gravity direction from depth map of image?

texts: For extraction of the HHA features from the image depth map we need to calculate the height above ground,  angle the pixel’s local surface normal makes with the inferred gravity direction. How to calculate this fom deoth map of image ?


texts: Continuous time double exponential filtering in state space form?

texts:
I'm trying to determine the continuous time formulation of the double exponential filter so that I can adapt it more flexibly for my particular problem.

Typically, this model is expressed as a pair of discrete, recursive equations as such in @denis' post here)

Double exponential smoothing
a.k.a.
Holt-Winters smoothing
tracks level and trend of a time series in coupled IIRs:
$\qquad$ In:  $Y_t$, t = 0 1 2 ...
$\qquad$ State: $L_t, T_t \quad$ -- level and trend
$\qquad$ Out: estimate $\hat{Y}_{t+1}$
$\qquad$ Parameters: a, b  (a.k.a. $\alpha, \beta$)
$\qquad$ Step equations:
$\qquad$ $\qquad L_t = a Y_t + (1 - a) (L_{t-1} + T_{t-1})  \quad$ -- level
$\qquad$ $\qquad T_t = b (L_t - L_{t-1}) + (1 - b) T_{t-1}  \quad$ -- trend
$\qquad$ $\qquad \hat{Y}_{t+1} = L_t + T_t$

Most references on the subject of double exponential filtering and state space revolve around discrete time kalman filtering approaches. Question: How should I put this model into a noiseless, state-space ODE form?

Using slightly different notation, here is my current approach. The base model, with continuous time input $u$ and continuous time states $l$ and $s$, is

$\dot{l} = r_1(u - l)  + r_1 s$

$\dot{s} = r_2(\dot{l} - s)$

$\ \ = r_2(r_1(u - l)  + r_1 s - s)$

$\ \ = r_2(r_1(u - l)  + (r_1 - 1)s)$

$\ \ = r_2 r_1(u - l)  + r_2(r_1 - 1)s$

with $\dot{l}$ and $\dot{s}$ representing time-derivative state dynamics with system constants $r_1, r_2 \in [0, \infty)$.

Assuming I made no mistakes there, I attempt to put this into state space form by

$$ \dot{\bf{x}} = A{\bf x} + Bu$$
$$ A = \begin{bmatrix}
-r_1 & r_1\\
-r_1r_2 & r_2(r_1 - 1)\\
\end{bmatrix} \ \ \ \ B = \begin{bmatrix}
r_1\\
r_1r_2\\
\end{bmatrix} \ \ \ \ \bf{x} = \begin{bmatrix}
l\\
s\\
\end{bmatrix}
$$

The output of this system is just the state of the level variable.

$y(t^{'}) = l(t^{'}) = C{\bf x}$.

where $C = \begin{bmatrix}1 & 0\end{bmatrix}$

We can make future predictions of $y$ based off of some assumption of the form of $u$, we can project $y({t'})$ using the system response formula for continuous time state space systems

$y({t^{'}}) = C\bigg(e^{A(t^{'} - t)}x(t) + \int_t^{t^{'}}e^{A(t - \tau)}Bu(\tau)d\tau\bigg)$

which can then be discretized as necessary later.

However: I am finding that the system matrix $A$ is not stable.

By my assumptions system matrices for all positive values of $r_1, r_2$ should be stable but this is not the case. Empirically I just tested a couple settings and the real part of the eigenvalues of $A$ must be negative, which is satisfied are for $r_1 = 1, r_2=1$ but not for $r_1 = 3, r_2 = 3$

Where dd I go wrong?.


texts: Add echo as described by difference equation to audio signal (in MATLAB)

texts:
A simple linear system is echo. It can be described by equation
$$
y[n] = x[n]+ k\,x[n−d],
$$ where $n$ represents sample index, $k$ represents an attenuation coefficient, and $d$ represents time lag.

How can I add echo to an input signal in MATLAB with convolution?

I'm new at MATLAB.


texts: What is the amplitude range of a spectrogram?

texts: Is there an upper and lower bound to a spectrogram representation of an audio signal? The range of the amplitude values of the audio signal is from 0 to 1.


texts: How can I insert message bits into the frequency spectrum of an audio signal using Matlab?

texts: I have been trying to use the DSSS spread spectrum technique for audio steganography in MATLAB. I multiplied the PN sequence with the message bits. Now I want to insert this spread message into a cover audio signal. In the time domain, I split the cover audio into blocks and just added the message. But I want to do it in the frequency domain, by taking the FFT of cover audio. How can I do that? Which is the better way?


texts: How to find parameters of Kalman filter using matrix information?

texts:
I'm trying to understand concepts on Kalman Filters. Consider the overdetermined system $Ax=y$;
$$\begin{bmatrix}1 \\ 1 \\ 1 \\1 \end{bmatrix} x = \begin{bmatrix} 3 \\ 5 \\ 4 \\ 8 \end{bmatrix}$$
Let $R$ be the errors in measurements $y$ and $P$
be the errors in the estimate of $\hat{x}$. Assume that the uncertainty in measurements, $\sigma^{2}$. Then, $R=\begin{bmatrix}\sigma^{2} & 0 & 0 & 0\\ 0 & \sigma^{2}& 0 & 0 \\ 0 & 0 &\sigma^{2}& 0 \\ 0 & 0 & 0 & \sigma^{2}\end{bmatrix}$.
Now consider Linear Kalman filter equations
\begin{aligned}
x_{k} &=F_{k-1} x_{k-1}+G_{k-1} u_{k-1}+q_{k-1} \\
y_{k} &=A_{k} x_{k}+r_{k} \\
q_{k} & \sim N\left(0, Q_{k}\right) \\
r_{k} & \sim N\left(0, R_{k}\right) \\
\end{aligned}
Assume a static model, with trivial dynamics $F = I$, so that $F_{k+1} = F_k$
and let’s assume again that the variable $x$ is directly observable, so that $A = I$, and $A_{k+1} = A_k$. Also, assume the uncertainty in both model, $F$, and observation, $A$, are both equal to $\sigma^{2}$.
I'm trying to identify the parameters of Kalman filter equations through this system. Since the model is static with trivial dynamics, I guess $q_{k-1} = 0$. I'm trying to identify $G_{k-1}$ and $u_{k-1}$ for this system. Can you please help me to identify other parameters?
How can we use the matrix $\begin{bmatrix} 3 \\ 5 \\ 4 \\ 8 \end{bmatrix}$ to calculate $x_2^{+}, x_{2}^{-1}$ and other parameters?
There are similar questions in Chapter 2 of "Neural Control Engineering: The Emerging Intersection between Control Theory and Neuroscience". Thank you very much!
My working so far: Correct me if I'm wrong!
Given that the model dynamics are trivial, we can assume that $$q_{k-1} = G_{k-1} =u_{k-1} = 0$$. Also, given that $F=A=I$.
Then, Kalman filter equations become, $$x_k = x_{k-1}$$ $$y_k = x_k+r_k$$
Given the initial conditions are $y_1 = 3$ and $x_{1}^+ = y_1$. How can I find other parameters?
Since the initial condition $x_1^{+} = 3$, I can compute $$x_2^{-} = F_1x_1^{+}+G_1U_1 = I[3]+0 $$. I'm having a trouble finding $P_0^{+}$.


texts: The use of LS estimation with Vector OFDM

texts:
I work in Vector OFDM, but I had an issue in channel estimation in that scheme. For example, I try to use LS channel estimation but I can't get the performance back. However, in conventional OFDM, I can use that estimation straightforward.

First, let me present the difference of VOFDM compared with OFDM, the V-OFDM scheme is presented as below figure:

As you see, the only difference that in V-OFDM divides the data bock into vectors and then process them by vectors.

My question is how to use channel estimation based on pilot insertion in this case ?? any channel estimator such as for example LS. I tried different inserting the pilots in similar way of that in OFDM, but I can't get the performance back !!

Thank you


texts: Converting an FIR Filter Model to a State Space Model for Kalman Filtering

texts:
I want to try and determine the true value of a quantity $\alpha[k]$ from observations of a related quantity $\vartheta[k]$ using a Kalman filter. The observations are of the following FIR filter form:

$$ \alpha[k] = \frac{1}{h} \sum_{n=0}^{N}  c_{n} \vartheta[k - nh]  + w[k]$$

where $w[k] \sim \mathcal{N}(0, \sigma^{2})$ and the $c_{n}$ are known ahead of time, and so is $h$.

I want to put this into a state space model in order to process it with a Kalman filter assuming additive process noise. To start the conversion, I can put it in transfer function form:

$$ \alpha[k] = \frac{1}{h} \sum_{n=0}^{N}  c_{n} z^{-n} \vartheta[k]  $$
$$ \frac{\alpha[k]}{\vartheta[k]} = \sum_{n=0}^{N}  \tilde{c}_{n} z^{-n}$$

where $\tilde{c}_{n} = \frac{c_{n}}{h}$.

This is where I get stuck. I am not sure what to do -- which canonical form should I use? Should I even use one? Where does the noise term go anyway?

This answer gives the link to all the forms, and a general idea:

$N$ point moving average filters in state space

However my model is slightly different. Other answers that may be helpful, but are confusing to me:

State Space representation
Doubt in state space representation

Thanks!


texts: How to implement discretized CWT with FFT?

texts:
I tried to make circular convolution (correlation actually because it is easier to understand for me) look like the Continuous Wavelet Transform (CWT) but got stuck because the conjugation was on the wavelet and the sign was different too (resembled $x[m](y[m-n])^*$ instead of $x[m] y[n-m]$).

I have a signal sampled from my microphone, and I have numpy and scipy. But since I can't get the indices to play nice I don't know how to implement cwt using fft.

Realized that the (unitary-/ortho-)DFT is basically a list of inner products
$$F(x)_k=\langle x(\_), |n|^{-1/2}\exp(\frac{i\cdot 2\cdot \pi \cdot k \cdot \_}{n})\rangle_k=\langle x(\_), f_k(\_)\rangle_k\\
F^{-1}(X)_k=\langle X(\_), f^*_k(\_)\rangle_k$$
since the second argument gets conjugated in the complex inner product of $\ell^2$.

In a similar fashion I guess a discretized CWT (DCWT) would be something like
$$\Phi(x)_{(a,b)}=\langle x(\_), |a|^{-1/2} \phi(\frac{\_-b}{a}))\rangle_{(a,b)}=\langle x(\_), \phi_{(a,b)}(\_)\rangle_{(a,b)}$$
(haven't found a formula for the inverse that is symmetric like the dft yet so the normalization constant might be wrong).

Convolution would be something like
$$(x\ast y)_{k} = \langle x(\_) , y^*(-\_+k)\rangle_{k}$$
(conjugation of conjugation should be identity. Should it be divided by $n$?)

Cross-correlation would be something like (should it be divided by $n$?)
$$(x\star y)_k = \langle x^*(\_), y^*(\_+k)\rangle_k$$
wolfram also says (I think. Should it be divided by $n$?)
$$
(x\star y)_k = (x^*(-\_)\ast y(\_))_k = \langle x^*(-\_) , y^*(-\_+k)\rangle_{k}
$$

I think the convolution theorem says
$$
[F\cdot F](x,y)_k=F(x)_{k}\cdot F(y)_{k}\\
(x\ast y)_k = F^{-1}([F\cdot F](x,y)_{\_})_k
$$
(should it be multiplied by $|n|^{1/2}$ or $|n|^{3/2}$ when using unitary dft? should it be as is or multiplied by $n$ when using the default dft?)

I think I want the b (or maybe some fraction of a and b) of the DCWT to be the k of the convolution/correlation somehow? Perhaps
$$
y_a(t)=|a|^{-1/2}\phi^*(-a^{-1}\cdot t)\\
\Phi(x)_{(a,b)}=(x\ast y_a)_b
$$


texts: Modulation Index of Conventional AM Signal

texts:
An AM signal has the form

$$u(t)=100\left[1+\sin(2000 \pi t)+5\cos(4000\pi t)\right]\cos(2\pi f_ct)$$

Where $f_c$ is 800 kHz.

What is the modulation index?

(We can define modulation index as the ratio between the amplitude of message wave and the amplitude of carrier wave)


texts:
As far as i have studied and understood, convolution is the process by which we can get/determine output of LTI systems
While reading one web link about convolution, i came across certain notation ,that i couldn't understand as shown highlighted in attached photo

1)Are these notations referring to delay/shift in input and impulse response?

2)Also it mentions that **Periodic or circular convolution is also called as fast convolution as shown highlighted in last line of 2nd photo attached.  Is it idea correct?**


texts: fundamental frequency contour of a syllable

texts:
I have an audio signal and I want to calculate the fundamental frequency contour for each syllable. In the related paper is said that only 9-time points are required. (9 values of frequency contour in each syllable).

As I saw in some papers, calculating fundamental frequency contour is equal to pitch contour.

Can someone please explain it to me what is it exactly?

Thanks in advance


texts: Time-frequency representation of sound signal using Matlab

texts:
I am currently doing a project on sound signal processing by using MATLAB. I have a problem regarding creating the command line so that I can get a graph containing frequency by its time. But this graph is the result of an audio input.
example:

x = audioread('samson.wav')

But I still can't get this kind of a result. How can I get this colour graph? Thank you


texts: DFT N-point circular convolution of $\cos(2 \pi n/N)$ and $\sin(2 \pi n/N)$

texts:
I am attempting to solve the below problem:

I was able to calculate the N point DFT for a cosine which is similar to this (note, this is the DFT for $\cos(2\pi n k/N)$. So for this second image assume k in the image = 1 and m in the image =k).

I used a similar method to find the $N$ point DFT of $\sin(2\pi n/N)$ with the below results (same notes on the variables as above):

At this point I have $X_1(k)$ and $x_2(k)$, when I multiply these together I get a very ugly series that I can't solve. I think that I am missing something here, how should I solve this problem?

Thanks


texts: Basic question about trigonometric series and transforms thereof

texts:
I would like to know the relation between the parameters $\{\omega_k,A_k\;|\;k\in\mathbb{Z}\}$ of a series $\sum_kA_ksin(\omega_kx)$ and a related series, for example, $\sum_kA_k^2sin^2(\omega_kx)$.

I would also like to know why a multiplicity of peaks appears in the FT when the components of a series are raised to some power? $N$ mirrored sets of peaks with characteristic spacing on the frequency axis and scaling on the amplitude axis are manifest when taking the FT of $\sum_kA_k^Nsin^N(\omega_kx)$. I am interested to know the relation between the parameters of these $N$-fold multiplicities as well. For instance, the amplitudes and the frequencies appear to scale geometrically (e.g., $10$ Hz, $5$ Hz, $2.5$ Hz, $1.25$ Hz).


texts: How to calculate the required bandwidth from a spectrum diagram? [FM]


texts: Minimum Shift Keying (In-phase, Quadrature Components derivation)

texts:
In the derivation of the minimum shift keying in-phase and quadrature components in Simon-Haykin Communication Systems 4th ed (p.387-390) we start off with the definition of the signal to be

$\ s(t) $= $\sqrt {2E_b/T_b}$ $\cos(2\pi f_c t+\theta(t))$

where $\theta(t) $ = $\theta(0) $ $\ \pm $ $\ \frac {\pi}{2T_b} t $

$\theta(0) $ is the phase of previous bit and $\ 0 <= t <=T_b$

but in the subsequent steps :
for the in-phase component,

$\ s_I $=$\ \pm $ $\sqrt {2E_b/T_b}$ $\cos( \frac {\pi}{2T_b} t )$ and $\ -T_b <= t <=T_b$

for the quadrature-phase component,

$\ s_Q $=$\ \pm $ $\sqrt {2Eb/Tb}$ $\sin( \frac {\pi}{2T_b} t )$ and $\ 0 <= t <= 2T_b$

How did this change of the limits of t change from $\ 0 <= t <=T_b$ to $\ -T_b <= t <=T_b$ or $\ 0 <= t <= 2T_b$ ? How are we allowed to extend the definition like that?

Thanks in advance.


texts: Looking for a file format for lane detection

texts:
I am trying to extract lane boundary lines from two recorded video cameras on the sides of the vehicle. I would ultimately like to calculate lane position from those boundaries.

My thought process is:

Convert the video to a series of images.
Convert images to grayscale.
Identify the portion of the image that has white as opposed to asphalt.
Filter unwanted pixels out of the video leaving mostly the lane.
Calibrate my camera, so I can know how much 1 pixel is distance wise.
Then do the calculations by byte locations in Python to determine the distance.

Does anyone have a recommendation for a image file format? I recall there was a format that has no compression or header. It was basically each pixel had a value from $0$ to $255$ ($0$ is black, $255$ is white I believe), and the byte location in the file represented the pixel. So if you had an image of $640\times 480$ you would have that many bytes.


texts:
I'm looking for a way (preferably already implemented in eg. python) of estimating a phase for a specified freq band.
When I'm performing FFT on the signal, I can determine components frequencies as well as phases of interesting components. If I understand this well, a single complex number in the FFT result table is, in fact, a representation of some (small and determined by the sampling rate and length of signal) freq band. But what if I want specific a frequency band on my own? Eg. I want to estimate a phase (single number) for a frequency band of 9-11 Hz. I guess even it's possible, some information will be lost. But can I do that?
Thank you in advance.


texts:
Why are random signals considered as power signals (i.e. signals with infinite energy and finite average power)?

Does this make any sense? What does it mean for random signals to have infinite energy even though we know that real-life signals (usually with inherent randomness in them) have finite energy!


texts: Why are magnitudes normalised during synthesis (IDFT), not analysis (DFT)?

texts:
In most examples and FFT code that I've seen, the output (frequency magnitudes) of the forward DFT operation is scaled by N -- i.e. instead of giving you the magnitude of each frequency bin, it gives you N times the magnitude.

Operationally, this is simply because the DFT is calculated by taking the inner product of the signal with each basis sine (i.e. un-normalised correlation). However, that doesn't answer the philosophical question of why don't we just divide by N before returning the output?

Instead, most algorithms divide by N when re-synthesising.

This seems counter-intuitive to me, and (unless I'm missing something) it makes all explanations of the DFT very confusing.

In every scenario I can dream up, the actual magnitude (not the magnitude * N) is the value I need from a DFT operation, and the normalised magnitude is the value I want to input into an IDFT operation.

Why isn't the DFT defined as DFT/N, and the IDFT defined as a simple sum of normalised-magnitude sinusoids?


texts: Equivalence of Convolution Through Polynomial and Matrix Products

texts:
I am trying to understand the equivalence of convolution through polynomial (coefficient) multiplication, Fast Fourier Transforms, and matrix multiplication. I am using octave with the octave-signal package, and part of this question may possibly related to their implementation (which I believe would be the same for MATLAB).

So I create my original signal with length $N$, and my boxcar window length is $n$.

N = 48;
n = 6;

I use $\sin$ as the input function for this example.

dt = 2*pi/N;
t = [-N/2:N/2-1]'*dt;
f = sin(t);

Convolution by polynomial multiplication ($g = h \star f$):

h = ones(n,1);
g_conv = conv(h,f);
g_conv_same = conv(f,h,'same');

Convolution by FFT and FFT with zero-padding of the input (also $g = h \star f$):

g_ft = real(ifft(fft(h,N).*fft(f)));

f_padded = [f; zeros(n-1,1)]; % append zeros
g_ft_padded = real(ifft(fft(h,N+n-1).*fft(f_padded)));

Convolution by matrix multiplication ($\mathbf{g} = \mathbf{A} \mathbf{f}$):

A = convmtx(h,N);
g_mtx = A*f;

$\mathbf{A}$ looks like this:

Find indices to trim arrays:

idx_A = find(sum(A,2) == n);
idx_t = 1:length(idx_A);

Plot results (the signals convolved by different methods):

plot(t(idx_t),g_mtx(idx_A),'k','linewidth',3);
line(t-5*dt,g_ft,'color','g','linewidth',2);       %-> offset by 5*dt
line(t-7*dt,g_ft_padded(1:length(t)),'color','r','linestyle','--'); %-> offset by 7*dt
line(t(idx_t),g_conv(idx_A),'color','b','marker','o');
line(t-2*dt,g_conv_same,'color','b','marker','+'); %-> offset by 2*dt
legend({'matrix','FFT','FFT (padded)','conv','conv (same shape)'},...
       'location','southeast')
xlabel('x value')
ylabel('y value')

which looks like this:

I have several questions at this point:

Why are the results for the FFT methods offset by several units of dt?
If I pad the FFT results such that the input vector is no longer periodic (red dotted line), why do I miss part of the convolved function (on the right side) in the result?
How do I treat the ends for the FFT convolution so that the results are aligned with the polynomial and matrix multiplication results?

Thanks in advance. P.S. if there is a good textbook reference for these details I would appreciate your guidance.

(I have edited for clarification.)


texts: Magnitude Spectrum, different magnitudes same amplitude

texts:
When the following code is written,the resulting magnitude spectrum shows magnitude values represented by two peaks is different even though they have the same amplitude. why is that?

a fast reply  would be much appreciated

    Fs=250; %sampling frquency of 250Hz
i=0:1/250:4; %1000 data points
x1=sin(2*pi*7*i); %create sinusoidal wave with frequency=7Hz
x2=sin(2*pi*40*i);%create sinusoidal wave with frequency=40Hz
subplot(2,1,1);
plot(x1),xlabel('Sampling Points'),ylabel('Amplitude')
subplot(2,1,2);
plot(x2),xlabel('Sampling Points'),ylabel('Amplitude')

y=x1+x2; %combine two signals to one
figure, psd(y) %spectrum analysis

N=length(y); %legnth of y is attributed to N

%calculate real part of Discrete Fourier Transform
for m=1:N,
sumn=0;
    for n=1:N,
    sumn=sumn + y(n)*(cos (2*pi*(m-1)*(n-1)/N));
    end
dftreal(m)=sumn;
end

%calculate imaginary part of Discrete Fourier Transform
for m=1:N,
sumn=0;
    for n=1:N,
    sumn=sumn + y(n)*(sin (2*pi*(m-1)*(n-1)/N));
    end
dftimag(m)=-sumn;
end

%obtaining magnitude spectrum using the obtained complex DFT values and
%plotting the spectrum
for m=1:N,
dftmag(m)=sqrt(dftreal(m)*dftreal(m)+dftimag(m)*dftimag(m));
end

%obtaining magnitude spectrum using the obtained complex DFT values and
figure, plot(dftmag),title('Magnitude Spectrum 1'),xlabel('Sampling Points'),ylabel('Magnitude')

%obtaining new Magnitude Spectrum based on fft
z=fft(y);
dftmag1=abs(z);

figure, plot(dftmag1),title('Magnitude Spectrum 2'),xlabel('Sampling Points'),ylabel('Magnitude')

%obtaining PSD of dftmag1
figure, psd(dftmag1)


texts: How to triangulate 2 sources on a 2d plane formed by 4 sensors?

texts:
I have 4 sensors capturing signal data. Signal distribution speed is constant and known. I have sensors positions in 3d space.
Also, I have an amplitude/frequency decomposition for data received by each sensor over time (imagine a 3d terrain).
 Sensors capture signal from 2 moving sources.

Here on the image: blue dots are the sensors; red solid Capsules are emmiting objects; transparent red capsules are here to show signal wave propagation pattern; yellow cubes show projections from objects onto a plane formed by sensors; green "points" are desired positions on a plane.

Details:

In real life emitters have pill-shaped form emitting in all directions, yet we can assume that they are points emitting spherical waves.

In my particular case, we discuss audio waves via air to microphones (but I hoped for a general solution).
We do not know the exact signal being transmitted from any of the emitters, yet we do know that there are only two signal sources with not equal positions in space and noise is filtered and extremely low.
We can perform any kinds of transformations on top of received signals and we have exact time-data correlation per each sensor.
Sensors form a square with side of length $l$

So how to triangulate sources positions on a 2d plane formed by 4 sensors - what is the algorithm?


texts: Advantages and disadvantages in term of radar performance of LFM chirp

texts: Which are the advantages and disadvantages of a LFM chirp regarding its radar performance?


texts:
I would like to write a program to compare two '.wav' files, one of which is the original played file with human speech and the other is a recorded '.wav' file. The program I wish to write in python should be able to do the following:

Read the '.wav' files, compare them and say if speech exists or not. If yes, what is the match % and gain or loss if any.
Detect if there's any noise that's present in the recorded '.wav' file.
Calculate the delay between the original played file and the recorded file (playing and recording done using threads, so t=0 is the same for either files).

As far as requirement 3 is concerned, I was fairly successful in calculating the delay using correlation function that's offered by numpy as:

corr_files = numpy.correlate(orig_pitch, rec_pitch, 'full')
delay = int(len(corr_files) / 2) - numpy.argmax(corr_files)

For requirements 1 and 2, I happened to play around with an RMS based approach, but it didn't go well. What is the best way to achieve all the above requirements? Which algorithm suits the above requirements?


texts: Adaptive Digital Filter Block Diagram Question

texts:
I'm currently attempting to study up on adaptive digital filters. My book presents the diagram I've included below and I'm having trouble understanding conceptually what it's indicating. The problem deals with noise cancelation. The idea is that someone is driving and makes a phone call. The x(k) is their voice input. There's a reference mic at v(k) which picks up road noise. I know that the ultimate goal is to filter road noise from our transmitted voice signal.

The desired output is obviously:

$$
d(k)=x(k)+v(k)
$$

The error in this case is:

$$
e(k)=x(k)+v(k)-y(k)
$$

Taking a quote from my book, it states

  If the speech x(k) and the additive road noise v(k) are uncorrelated with one another, then the
  minimum possible value for $e^2(k)$ occurs when y(k) = v(k), which corresponds to the road
  noise being removed completely from the transmitted speech signal e(k).

I don't understand how e(k) is our output of the system though. It seems to me that if we minimize our error, then it approaches zero. This means that $d(k)-y(k) = e(k)=0$ Consequently if our output is the error and we've minimized it, it seems like we're outputting 0 not a transmitted signal e(k) with the road noise removed!? I guess I'm asking why our desired output d(k) isn't our output....why is the error the output?

Can somebody help me understand this conceptually? Thank you for your help! Please let me know if I need to clarify anything.


texts:
I have a signal and from 'standard information' I know the predominant frequency is at $1\textrm{ Hz}$ and then there should be three harmonics at lower amplitudes. My signal however has a lower amplitude at $1\textrm{ Hz}$, higher at the first harmonic and then several harmonics, more than what should be present.

I am trying to design a comb filter to rectify this but I am not sure where to start. Any advice from anyone who has some experience with this filter would be great.


texts:
TL:DR - How can you find the 3D coordinates of a emitter than transmits an impulse signal?

STORY:

I'm working on something to improve my bird-watching.  I've got a camera that can take pictures of the birds when I'm not around, but currently it has to be zoomed out all the way to guarantee they're in frame.  This doesn't make for good pictures, so here's what I've done:

Mounted camera on a motor so it can rotate, zoomed in enough that the pictures will be better quality, and attempted multilateration to make the camera turn.

ATTEMPTED SOLUTION:

My multilateration is simple.  4 microphones listen for sound.  When an impulse (such as a chirp) is created from an emitter (bird), the microphones can detect the impulse, and my microcontroller can calculate the time differences between all 4 mics receiving the impulse.

My microcontroller then uses a home brew program that converts these time differences and the known locations of the microphones relative to each other into matrix form.

Once the program has the matrices, it can solve for the distance from each microphone to the bird's origin, which then can be used to figure out the coordinates of the bird relative to the microphones.

PROBLEM:

The problem with this, is that it needs to be really precise.  I'm talking ~10 nanoseconds of difference in reception time between mics in theoretical math space will cause the program to miscalculate where the bird is.

I've muddled with the code to see if implementing more mics will lessen the need for precision, but I can't find a way to achieve a tolerance greater than ~±25ns.

With my setup, I can only calculate a reception time difference on the level of 10-5 seconds, so it's not possible for me to guarantee the level of precision that this type of math needs.

Can anyone think of a way for me to improve my setup so that it works?  Are there other ways to accomplish multilateration?  How else could I find where the bird is when it's chirping?

Thanks guys, you're always awesome!!!

EDIT:

I have written out the mathematical process I have used for this problem.  Pictures of that, an excel sheet for generating initial conditions, and Matlab code for handling the maths can be found here.


texts: DTFT fourier transform (modified property)

texts:
I know there are 3 properties of DTFT that help with my problem

$$ a^{n}u[n]=\frac{1}{1-ae^{-jΩ}} $$
$$ (n+1)a^{n}u[n]=\left(\frac{1}{1-ae^{-jΩ}}\right)^{2} $$
$$ \frac{(n+r-1)!}{n!(r-1)!}a^{n}u[n]=\left(\frac{1}{1-ae^{-jΩ}}\right)^{r} $$

But I cannot find some use between them to calculate the DTFT of the following signal
$$ x[n]=(n+5)\left(\frac{7}{45}\right)^{n}u[n] $$ where $u[n]$ is the unit step function. Can anyone help?


texts: I have to do an exercise. Given this signal: $H(f)=\frac{\frac{T}{2}}{1+(\pi f\frac{T}{2})^2}$  calculate the frequency at $-6 db$. How can I resolve this exercise? I tried this: $\frac{\frac{T}{2}}{1+(\pi f\frac{T}{2})^2}=10^{-0.6}$ but I don't know if it is correct


texts: Is there any good book regarding 3D reconstruction from 2D images? I prefer to work in MATLAB

texts: I am working on a project regarding 3D reconstruction of 2D images. I have understanding of finding and Mathcing the keypoints and its algorithms; but i am not able to replicate the theory in MATLAB code. Is there any Book or paper which is basic for this problem?


texts: Modified Bryson-Frazier (MBF) smoother explain

texts:
I'm reading about MBF smoother on Wikipedia.

I'm confused of the quantity $\hat{\lambda}_k$ and $\tilde{\lambda}_k$. What does they really mean intuitively ? Why the update formula has the form

$\hspace{3.0cm} \hat{\textbf{x}}_{k|n} = \hat{\textbf{x}}_{k|k} - \textbf{P}_{k|k} \hat{\lambda}_k$

or (as stated in the article)

$\hspace{3.0cm} \hat{\textbf{x}}_{k|n} = \hat{\textbf{x}}_{k|k-1} - \textbf{P}_{k|k-1} \tilde{\lambda}_k$

Can anyone explain it intuitively for me ?


texts:
Can one determine if an MFCC vector represents a combination of two sounds whose MFCCs were previously given?

Any guidance is appreciated!


texts:
I want to develop a feature vector from an audio input.

Up to now, I have identified fundamental frequency, max phonation time, timbre to be among the key features to be identified.

Can someone please confirm whether it will be possible to extract these features from the audio?


texts: Can we band-limit a PCM signal? Is it even relevant to relate a totally Analog term(Band limit) with digital one(PCM)


texts: How to convert multi-band Energy Time Curve (ETC) to Impulse Response (IR)?

texts:
I am running my own sound simulator. Now I have obtained the Energy Time Curve (ETC, expressed by energy) by physical simulation, and they are stored in 8 discrete frequency bands (because decay of sound in the air is dependent on sound frequency). Now I am having problem getting the impulse response (IR, expressed by amplitude) of the measured system. I will need the IR to convolve with some audio files.

So I have $ETC(f,t)$, where $f\in\{f_1,f_2,...,f_8\},t=1,2,...N$. And the length $N$ is sufficient to capture the energy decay under a sample rate of 48kHz. How should I derive $IR(t)$ from the above $ETC$?

Thanks in advance.


texts:
I have got a signal in frequency domain. This is a frequency response function from software, so I can do nothing about it and have to leave it in frequency domain. I want to transfer the data to 1/3 octave spectra and I need some help on this.

In my opinion, I just need a couple of band pass filters which in the frequency domain is simply by using the starting and ending limit of each band to cut the data. In other words, I ignore all other data points out of a band region.

To get the band spectra, originally I just calculate the square of each fft point inside a band and sum them before calculating the square root. However, the result is different with direct filtering in the time domain, which I tried using a random signal. It makes sense to me because the 1/3 octave spectra should be independent of the total fft points. Obviously by simply calculating the sum of squares of fft components, the value of power in a band increases with the increase of the points included.

Then I tried to explore the basic theory underlining the fft based filters. This is where I got very confused. I do not know which part of FT frequency response function belongs to? It is not DFT in my opinion and not DFS either because the whole process of transferring motion equation is based on continuous FT except the frequency response function is calculated at a series of discontinuous points. My understanding is that each component of 1/3 octave spectra is a square root of the total power in that band. Therefore possibly I can get something from Parseval's theorem. However based on continuous FT transform, I could not figure out how to derive the power in a frequency range.

I would like to know the way to implement the filter and underlying theory if possible. Please give me some suggestions or alternatively some references that I can refer to.

Thanks a lot.


texts: Plotting phase delay from first principles giving different result from phasedelay() function. Why?

texts:
I have a length 10 Finite Impulse response as shown below, and I am trying to find the phase delay of this FIR.

$$h[n]=\begin{cases}0.1,& 0\le n \lt 10\\
0,&\textrm{otherwise}\end{cases}$$

I tried plotting from first principles as well as using the phasedelay() function, however I am getting different results. The results are varying greatly. Any suggestions on what I am forgetting to do in my approach from first principles?


texts: Biquad coefficients using Magnitude (or Phase) Invariance Mapping Method

texts:
I'm trying MIM (Magnitude Invariance Method) and PIM (Phase Invariance Method) for to improve biquad LPF response at low sampling rates. I'm looking some help and examples of usage if available.

EDIT_1:
I tried MIM method for 2nd order

LPF
fs=44100
fc=15000
Q=0.707

and

Peak filter
fs=44100
fc=10000
Q=0.707
db=6

Here are the resulting plots:

Responses looks promising.

Example code (LPF):

% Analog model for LP filter:
  fs = 44100;
  fc = 10000;
  Q  = 0.707;

  w0 = 2 * pi * fc;
  b2 = w0^2;
  a2 = [1 w0/Q w0^2];
  Ds = tf(a2, b2);

% Calculate coefficients using MIM
[Dz] = c2dn(Ds, fs, 'mim', 2, 4096*256);

bodemag(Ds, 'r', Dz, 'b');


texts: Does the audio signal in the time domain change much after a RMS from one person to another?

texts:
I would like to train a deep neural network to perform lip syncing given an audio input like in this article.

I want to train my neural network only on Obama speeches like done in the article and want to apply it to other people voices.
Does the structure of the audio signal in the time domain (after a RMS normalization) change much from one person to another if they say the same thing ?


texts:
Q:  It is said that "to maintain the same quality in the two cases, we require that the power spectral densities remain the same". Why is this a measure of the same quality? Why is not
the integral of  each power spectral density over the corresponding Nyquist interval not used, instead?


texts: I am trying to transfer text data via sound wave between two android phones. I am a newbie and would like to know how to proceed with it. I am stuck at the very first step on how to modulate text data as FSK or PCM raw data ? As I shall be implementing it on Android any Java pointers will be of great help


texts:
I have successfully built Simulation example: FSK. Everything works fine and I'm getting same results as in example.

For the next step I would like to save demodulated binary data in file but I'm getting way too many samples per bit (maybe because of repeat block used in beginning of simulation?). How do I decimate such a large amount of samples? When using rational resampler (between Frequency Xlating FIR Filter and Quadrature demod) with decimation 1056 I get

sched: <block rational_resampler_base<IN_T,OUT_T,TAP_T> (1)> is requesting more input data
than we can provide.
ninput_items_required = 36778
max_possible_items_available = 8191
If this is a filter, consider reducing the number of taps.


texts: Denoise Techniques When Clean Signal and Pure Noise Are Available

texts:
I have the clean version of the signal.
I can obtain the environmental noise.
I want to apply an effective denoising technique on a noisy signal (i.e., clean plus environmental noise).

Some observations:

The noise to signal ratio is extremely low.
The noise is spread across all frequencies in the frequency domain.

Are there any techniques for possibly taking advantage the noise and the clean signal towards denoising the noisy signal?


texts: Band-limited signal recovery with finite bit depth

texts:
The sampling theorem tells us that a signal with no frequencies above $f$ can be completely described by sampling it a rate of $2f$. However, the theorem makes no reference to quantization, and so I would think that the result only holds for samples measured with infinite precision.

However, in DSP we never have infinite precision, we instead have a fixed (or at least bounded) bit-depth. So what is the relationship between the bit-depth of each sample and the precision with which we could reconstruct the original signal? Does grossly over-sampling allow us to heavily quantize each sample?

For the purposes of the question, we could even imagine taking countably infinite samples from a signal that is infinite in the time domain, but each sample is itself limited to a resolution of $n$ bits.


texts:
For a signal with $f_c$ (Centre Frequency) $=1200MHz \,\,$ and $BW= 100MHz$ ,which of the following Sampling Frequency ($f_s$) will cause spectrum inversion:
  A)$\, 287.5MHz \quad$  B)$\,575MHz \quad$ C)$\, 1150MHz \quad$ D)$\, 1600MHz \quad$

My Thoughts:
As Centre Frequency ($f_c$) is mentioned in the question
$\therefore $ The given is Bandpass Signal (or Modulated Signal)

As Bandwidth ($BW$) of the given signal is $100MHz$
$\implies (\text{Modulated signal})_{BW}=100MHz$
$\implies (\text{Baseband signal / Message signal})_{BW}=50MHz$

In general,considering Triangular spectrum for Baseband Signal ($X(f)$)
then, Spectrum of Baseband Signal:

Now,In the question spectrum inversion is given
and we know spectrum inversion occurs only in FM (Frequency Modulation)
i.e odd multiples of lower sidebands of FM are inverted
For eg.:
If Baseband signal ($x(t)$)= $\cos(2 \pi f_mt)$
then, its spectrum is as follows:

Now, if this message signal undergoes frequency modulation,then modulated signal spectrum will be given as:

Here,we can see $(f_c-f_m) $ component is inverted
similarly,$(f_c-3f_m) $ component is inverted
and so on...

Now how can i proceed to find $f_s$,please help...


texts: Solving Scale and Permutation indeterminacies in Blind Source Separation

texts:
Many papers using blind source separation algorithms solve the inherent scale and permutation indeterminacies of the estimated mixing matrix using an "optimal method", however this method is never explained. How does this work?

Thanks in advance


texts: Distort voice to hide talker identity as much as possible

texts:
I need to develop an app which makes speech recognition. Because I need to be able to constantly improve the recognition capability, I would like to train the engine with real recordings and match the recognized text with the expected text.

To generate the expected text, I would need to listen to the recording, understand what the talker says and manually write the "expected text". To preserve the talker's identity for privacy reasons, I would make available for listening a distorted version of the original audio file, while using the original one for real recognition to improve the system.

From the signal processing point of view, what would be a good flow for this task?


texts: Why does the specgram of this simple sine wave look strange?

texts:
I'm trying to test some intuition using the matplotlib specgram routine. I first generate a simple sine wave

import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import numpy as np

t = linspace(0,100,1000)
omega = 2*np.pi*1
y = np.sin(omega*t)
plt.plot(t,y)
plt.show()

This generates the expected image of a sine wave

I can also look at the mod squared of the FFT of this signal:

the_fft = np.fft(y)
spacing = t[1] - t[0]
ps = the_fft * np.conj(the_fft)
freqs = np.fft.fftfreq(len(t),spacing)
idx = np.argsort(freqs)
plt.plot(freqs[idx],ps[idx])
plt.show()

which gives me the square of the Fourier transform, which has a peak at 1 as expected (since my frequency is 1).

I then try to compute the specgram, as

_ = plt.specgram(the_fft,NFFT=100,noverlap=0,Fs=1./spacing,window=mlab.window_none)
plt.show()

which then gives me this .

From this it's not easy to tell that the only frequency present in the signal is 1. What needs to be done in the specgram call to see this? Of course this is probably the expected output of this, so I'm really also asking a basic DSP question at the same time.


texts: Remove microphone rustle / clothing rustle from raw audio data

texts:
Thank in advance for the help.

I have several GB's of raw audio data that I have collected as part of a research study.  This audio is divided up into individual samples approximately 30 seconds in length.  Many samples, I would say approximately 20%, contain mild to significant noise in the form of microphone rustle (caused by an object moving across or touching the microphone)

What I would like to do is remove this noise.  I do not care about recovering any audio covered by the noise; I just want to remove it via "cutting it out" (however, if i was able to recover the audio that would be ideal).  I would like to remove as much of the noise as possible in a manner that doesn't lead to the audio skipping.  In other words if I have noise at time 3 and time 20, it is sufficient to remove audio from time 3 to time 20 (obviously the time between noise occurances cannot be too large otherwise I'll end up removing all of my audio).  It is thus okay to remove some good audio in order to maintain the playability of the sample.  If I end up removing a certain percentage of audio due to noise, say more than 50%, I will just throw the sample out.  I have many samples, I just need to make sure that the samples I analyze are clean.  Obviously I cannot manually go through GB's worth of audio (well I could, but I don't have months).

What might be the best approach to take to identify such noise?  I'm aware that I could use a representative noise sample and try to find matches in my samples, but I see two issues.  First, I don't think there is a global representative sample of this noise.  I want to make sure that I remove every instance of this noise, but I can't be too aggressive otherwise I'll end up with no audio.  Second, I doubt this is the best approach.  One can imagine the quality of audio of news reports given during a live broadcast in a storm; there is no microphone rustle from wind.  There likely then is a standardized way to remove this kind of noise.

Edit:
Computation is not an issue.  I have access to a cluster and can code in just about any language.

Edit2: Spectrogram of a whole audio file with the microphone rustle.  I would not say that this is representative though of one of my samples (in the terms of the noise it is very roughly representative)

Just the microphone rustle

And a clipping of of the same audio sample with no microphone rustle


texts: MAP Estimation Problem for Frequency Band Occupancy Calculation

texts:
Consider designing a wireless communication system. Your communication link is not iso- lated in the environment, there are other similar devices trying to communicate in the same general frequency band. For this reason, you wish to infer which frequency bands are occupied in order to minimize inter-channel interference.
Fortunately, each of these devices only occupy a relatively narrow frequency band. Unfortunately, links can hop between frequency bands, start, or stop seemingly randomly.
You may consider the sampled received signal to be of the form
$ y[n]= \sum_{i=1}^{n} x_i[n] +w[n]$
where the number of signals N is unknown and each $x_i$ ∈ BL(−Bi,Bi) is an unknown,
but approximately bandlimited function of a potentially finite non-zero length. Assume
i.i.d.
w[n] ∼ N (b, σ ) be a random process comprised of (possibly non-zero) Gaussian noise with variance $\sigma^2$
Please design an algorithm given a stream of data attempts to determine the set of frequency bands only using prior data
The question is what should be a proper algorithm that given a stream of data, attempts to determine the set of occupied frequency bands using prior data.
I only have a .wav file to test my algorithm


texts: Pattern recognition using 2D fft in matlab

texts:
I have a dataset with two columns (width and length, both in milimeter). When I make a scatter plot (please refer to the first figure), I see location of defects in a plane. I want to find if the location of the defect has some kind of pattern or it is just a noise. For that I was suggested to use 2D fft to recognize pattern. I don't have any background in 2D fft but I read some articles and used matlab function fft2. I get a plot (please refer to the second figure) which I dont I understand so much at this moment. Can any one has hint to get me going? A nice article could also be of help. I read the following article as well.

http://www.qsimaging.com/ccd_noise_interpret_ffts.html

Thanks in advance!


texts:
I have some code here that I don't quite understand.
It calculates the energy for a given frame the following way:

En=log(1+energy(32767*frame))

The energy function is defined as

energy = sum(s.*s)/max(size(s))

Where 's' is te given frame.

What I don't understand is why the frame needs to be multiplied by 32767, which is the max value for unsigned int 16. I couldn't find the theory behind this. Does anyone of you know why this multiplication is taking place? Does it have to do anything with the log calculation?max value for unsigned int 16. I couldn't find the theory behind this. Does anyone of you know why this multiplication is taking place? Does it have to do anything with the log calculation?


texts: What is the Difference between Texture and Image?

texts:
I am beginner in the image processing

I want to know what is difference between Texture and Image? or whether they are same? can anyone explain it.

Also,if i want to do texture segmentation,can i use same algorithms as applicable to the image segmentation?


texts: Image distortion and alignment on 3D mesh / pointcloud

texts:
Currently I have a fairly accurate (50 µm) and large dataset from a 3D scanner and a set of high resolution pictures. Sadly the 3D scanner (a Nikon/Metris arm-based CMM that was hanging around the lab) doesn't record colour data, but this would be exactly what I need to extract the actual features I'm interested in. I started out by correcting the lens distortion for the camera, and also accounted for the non-linear distortion. What prevents me from doing this manually in software like Meshlab or Geomagic is that I have an extremely large set of objects to scan, which makes it highly unrealistic to do it by hand.

I took the liberty to add a series of reference points which are visible to both the 3D scanner and conventional camera. I am able to detect these features on both the point cloud and images automatically. Sadly I must admit I underestimated a big part of this task: I now wish to automatically align the image versus the point cloud based on these reference points and project the image onto the point cloud or mesh. The reference points from the point cloud are in a XYZ format, while those from the image are 2D coordinates in the plane. They are already matched, so that presumably - according to a fellow Ph.D. student - difficult part is already done. And while I can think of a few ways to align, distort, and project the images this would most likely be a large investment of time from my part. I was wondering if any pre-existing libraries for this exist or at least if there are papers which present a method to do so. Based on the fact that software like Geomagic is able to do it I'd like to avoid reinventing the wheel. However I must humbly admit I can't seem to find them as I am probably using the wrong terminology.


texts: Remove Shadows from Contour of an Object (Grapes)

texts:
I want to extract only the grapes from the images. Unfortunately, sometimes I don't get the grapes exactly.

I have a code that doesn't work well in all cases. Sometimes, it does not differentiate between the shadows and the grapes.

The example input image:

The result I'm getting:

And this is my code:

RGB = imread('DSC02807.JPG');
GRAY = rgb2gray(RGB);

threshold = graythresh(GRAY);
originalImage = im2bw(GRAY, threshold);

originalImage = bwareaopen(originalImage,250);

SE = strel('disk',10);
IM2 = imclose(originalImage,SE);

originalImage = IM2;

imshow(originalImage);


texts:
Hi someone please explain me the translation property of $\textrm{DFT}$. I am not able to understand it neither from Gonzalez nor from internet. I have done extensive study on this but not able to get it. Really Frustrated!!

I don't understand how shifting is done? What is the difference between $f(x-x_0, y-y_0)$ and $f(x+x_0, y+y_0)$ and what are their corresponding $\textrm{DFT}$'s?


texts: Best window before FFT ? (for a signal consisting of 2 tones used for phase measurement)

texts:
I am doing phase measurments by transmitting and receiving tones (100 kHz and 16 kHz simultaneously). I am transmitting the tones  and receiving them, applying Blackman Harris window and doing FFT for phase measurements.
I feel the Blackman Harris window is not optimal for a signal that has only 2 tones but don't know which windowing function is better for phase measurement for such a signal.
Any Ideas?


texts:
I am studying dc-dc converter now. I got a problem with Laplace transform of the averaging operator as in the image below.

Can anyone help me derive the Laplace transform result $G_{av}(s)$ as in the image?


texts: How to get finer grained spectral decomposition for audio signals?

texts:
I am not a "proper" DSP guy at all, so apologies in advance if I am making any basic errors in this question. I would really appreciate it if you could point out any errors I make.

I have an audio signal sampled at (say) 44100 Hz. I want to get a spectrogram from this signal and display it. For this question, I will be using the formula as displayed in https://ccrma.stanford.edu/~jos/mdft/DFT_Definition.html .

My approach is as follows:

Take (say) 1024 of the frames at a time (which I will denote by $x$), and run an FFT routine over them, probably after applying a Hann window.
This will give me the frequency domain representation of the input window. I will denote the output of the FFT routine by $X$.

$X$ will effectively contain 512 values, with the value at index $n$ being the Fourier coefficient of the frequency $n * 22050 / 512$ Hz. Thus, say, the 300th sample of $X$ will correspond to the frequency 12919.92 Hz. (Is this understanding correct?)

Now my actual problem: I am not really interested in frequencies above 5000 Hz since my input will be human voice. Instead of $X$ covering a frequency range of 22050 Hz, I would like to "zoom in" so that it covers a range of only 5000 Hz. I.e., I want a finer grained spectral decomposition till a lower frequency of 5000 Hz. My question: how do I do this?

An approach I can think of: currently my sampling rate is 44100 Hz. If I can "reduce" the sampling rate to 11025 Hz, then the normal FFT approach will work and the output of the FFT routine will cover only frequencies till approximately 5000 Hz. I can accomplish this by either,

Averaging every 4 frames of my original input.
Taking only every 4th frame of my original input.
Taking the max of every 4 frames of my original input.

Will any of the above 3 approaches work? Is there any other way of getting a finer grained spectrum?

Edit: it struck me later that I could achieve the result by using a larger "bin" . I.e., 8192 frames instead of 1024 frames as input to my FFT routine. Is this the best approach available?