texts: time-domain channel estimation based on two vectors optimization

texts:
Let's the input data vector $X = [X_1, X_2, X_3, X_4, X_5,X_6,X_7,X_8];$ where $[X_7,X_8]$ are well known, and the vector $y = h*X$ where $*$ is the convolution operation and $h = [h_1,h_2]$ is the channel vector.
I have a priory information that  $[X_7,X_8]$ = $T[X_1,X_2]$ where $T$ is a $2$x$2$ square matrix.
The issue I am trying to solve is can we get the channel vector $h$ based on optimizing $([y_7,y_8]$ - $T[y_1,y_2])$ ?  Is there any optimization algorithm we can use to estimate the vector $h$?


texts: Conditions for which the Hilbert transform returns a correct phase

texts:
I'm quite new to signal analysis, and I'm currently trying to understand under which conditions a Hilbert transform can be used to compute the correct instantaneous phase and enveloppe of a given signal.
Say I start from the example in Python given here (from the scipy website):
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hilbert, chirp
duration = 1.0
fs = 400.0
samples = int(fs*duration)
t = np.arange(samples) / fs
signal = chirp(t, 20.0, t[-1], 100.0)
signal *= (1.0 + 0.5 * np.sin(2.0*np.pi*3.0*t) )

analytic_signal = hilbert(signal)
amplitude_envelope = np.abs(analytic_signal)
instantaneous_phase = np.unwrap(np.angle(analytic_signal))
instantaneous_frequency = (np.diff(instantaneous_phase) /
                            (2.0*np.pi) * fs)
fig = plt.figure()
ax0 = fig.add_subplot(211)
ax0.plot(t, signal, label='signal')
ax0.plot(t, amplitude_envelope, label='envelope')
ax0.set_xlabel("time in seconds")
ax0.legend()
ax1 = fig.add_subplot(212)
ax1.plot(t[1:], instantaneous_frequency)
ax1.set_xlabel("time in seconds")
ax1.set_ylim(0.0, 120.0)

I get a nice result showing me the enveloppe and desired frequency:

However, if for instance I decide to add a little bit of noise:
signal+=random.rand(len(signal))*0.2

Then the inferred enveloppe and frequencies get not that good (some of the noise goes into the enveloppe, some into the frequencies):

This was quite expectable, and I know I just have to find a way to smooth my signal to solve that. My real problem is, say you add a trend to your signal:
signal+=np.linspace(-1,1,400)

Then the results get completely messed up: *can't add any more links since I'm new to the forum*
And the results are also messed up even for just a vertical shift... So, basically, my question is: what are the conditions needed for the Hilbert transform to return the correct phase and amplitude ?
For now, this is what I suppose:

the signal must not be noisy
the signal must be centered around zero
the signal must not have any trend
amplitude and frequency can vary

Am I right? Thank you.


texts: Determining Causality and Time-Invariance of a system

texts:
Consider the following system:
$$y(t-1)=\int_{-\infty}^\infty x()u(-t) d $$
where $u(t)$ is the unit step function, which is zero for $t<0$ and equals $1$ for $t>0$.
$(1)$ Is the system causal? Why or why not?

I think if $u(t)=0$ for all $t<0$. This means that $u(τ−t)=0$ for all $τ<t$ or, equivalently, for all $t>τ$ and the integrand is zero in range $({-\infty}, t)$.Therefore, we can show that:
$$\int_{-\infty}^\infty x()u(-t) d = \int_{t}^\infty x()u(-t) d =  \int_{t}^\infty x() d$$ So, the system is not causal! Am I right?!

$(2)$ Is the system time-invariant? Why or why not?

Let $ s=t-1$
$$y(s)=\int_{-\infty}^\infty x()u(-s+1) d $$
For invariance, we need to show output resulted from $x(s−s_o)$ = $y(s−s_o)$.
$$y_1(s)=\int_{-\infty}^\infty x(-s_0)u(-s+1) d $$
Now when I change of variable to $z=τ−s_o$, $τ=z+s_0$ , $dz=dτ$ it leads to:
$$y_1(s)=\int_{-\infty}^\infty x(z)u(z+s_0-s+1) dz $$
For $y(s-s_o)$ integral becomes:
$$y_2(s-s_0)=\int_{-\infty}^\infty x()u(-s+1-s_0) d $$
So it seems to time-variant system.
Update:I would appreciate if anyone can answer my question because it's not a homework anymore and yet I didn't find the answer.


texts: MIT 6.003 HW#8 Problem 4 - Fourier Coefficients of Triangle Wave

texts:
In the mentioned homework, part of the solution involves finding the Fourier coefficients of the triangle wave.

The solution mentions that we can express this function as follows:

What does that multiplication signal means?
I approached the problem from a completely different angle of viewing the triangle wave as the integral of a piecewise constant function defined as follows:
$
f(x)=
\begin{cases}
 \frac{1}{2}&\text{if}\, -\frac{1}{4}\leq x\leq0\\
 -\frac{1}{2}&\text{if}\, 0\leq x\leq\frac{1}{4}
\end{cases}
$
Taking the integral similarly and then multiplying by $\frac{1}{2\pi ik}$ gives me a completely different answer of $-\frac{1}{4\pi^2k^2}[\cos(\frac{\pi}{2}k)-1]$.
What is wrong with my approach?


texts: Playrate change based on sinc interpolation generating phase shift?

texts:
I want to simulate the play-rate change function of a modern digital sampler. For the purpose I have constructed a sinc-resampling based algorithm of my own which changes the play-rate of a digital audio signal.

There is some issue with the algorithm, as the output of the algorithm is far from nulling with the output of my sampler software, when same play-rate is applied. In particular, the high-frequencies do not null. The audio produced by the sampler and my algorithm sounds identical and the magnitude of the FFT is extremely close, so the issue seems to be with the phase. Why does the algorithm not produce similar output to my sampler, in specific is there some error that introduces phase-shift?

The algorithm is simple $y_i$ being the i+1th sample, $n$ the total amount of samples and $a$ the play-rate:

$$f(x)=\sum_{i=0}^{n-1}y_i \text{ sinc}(x-i)$$

$$g(a,x)=f(ax)$$

And the ouput can be had as $\{g(a,0),g(a,1)...g(a,n-1)\}$.

Python code:

import numpy
def ratechange(data,rate):
    Y=numpy.zeros(len(data))
    for i in range(len(data)):
        for j in range(len(data)):
            Y[i]+=data[j]*numpy.sinc((-j+i*rate))
    return Y


texts: How to sketch this multirate system spectrum?

texts:
In the following system:

The signal x(n) is upsampled by 2 and then filtered. The signal and the filter have the following spectrum:

After upsampling the spectrum of X would look the same except the x axis would be divided by 2. So the limit of the spectrum would be at pi/4. Since the filter has amplitude 2 would the amplitude of X be increased from 1 to 2 or will the amplitude of X remain unchanged?

Finally, for the multiplication of the cosine it would be equivalent to multiply with 2 deltas located at -pi/2 and pi/2. Would the multiplication with this deltas cause a kind of mirroring effect on the spectrum?

Thank you

edit:

I do not see how to obtain Y1 and Y2
complete system

and provided answer:


texts: How we can use the Hadamard transform in feature extraction from an image?

texts: Which coefficients of the Hadamard transform contain the highest energy compaction? Is there any regular pattern in them as for the  DCT?


texts:
I'm trying to complete one task:
Download some FM modulated signals from page http://www.w1hkj.com/modes/index.htm. Calculate their spectrograms, i.e. short-time Fourier transform. Observe different
FM patterns. Do some literature investigations. Try to recover bits that are coded by different frequency values (states).
At first I displayed a spectrogram:
clc;
clear;
close all;

[y,fs] = audioread('Olivia16-500.wav');
spectrogram(y, 512,256,512, fs, 'yaxis');

And the other part is: Try to recover bits that are coded by different frequency values (states). I guess I should demodulate signal, so I did the following:
Nx = length(y);
n= 0:Nx-1;
dt = 1/fs;
t = dt*n;

fc=200;
figure(1)
z=demod(y,fc,fs,'fm');
plot(t,y, 'c', t,z, 'b');
xlabel('Time'); ylabel('Amplitude');
legend('Modulated signal', 'Recovered signal');

And the output:

Did I understand the task correctly or did I miss something? Thank you for any advices.


texts: Questions on the generation of R.O.C. curves

texts:
In my foray into detections, I am trying to understand how best to generate receiver operating characteristic (ROC) curves, and some questions have come up.

In my studies, I have found out that ROC curve generation is simply the plot of true-positive rate (TPR) versus false-positive rate (FPR). Naturally one wants TPR to be 1 and FPR to be 0. I also understand that each point on the ROC curve, (a point with one TPR and FPR coordinate) corresponds to one set of detector 'settings' (threshold(s)). With one setting fixed, we will compare all positive 'detects' to all actual number of true positives, and true negatives, and thus yield TPR and FPR. My questions are as follows:

It seems to me that we must have a labelled data set(s) in order to do this to begin with. That is, we have to manually or otherwise, go through all the data we have, and label them as 'yes' or 'no'. (I realize this might seem obvious but I want to confirm). Is this true?
Somewhat related to the above - if in order to generate a true ROC curve that properly captures the detector performance we have to have 'no' data, then it seems to me that we have to have 'no' data that captures almost every possibility that exists in the universe. Clearly this is not feasible, but then how can one claim with any good faith that a detector truly has a certain false alarm rate? This is what confuses me the most.
Is it unheard of for detectors to have ROC curves that almost never false alarm, but that have normal looking variance on the y-axis? Put another way: Is it unheard of for detectors to have very little variance on the false-positive axis (x-axis) but a lot more variance on the true-positive axis (y-axis), for a fixed SNR?

I think that just about summarizes my questions, thanks.

EDIT Number 1:

I do not think I understand the feedback.

Theoretical aspect:

How can I statistically 'model' every single possibility in order for me to theoretically characterize it to begin with? For example, lets say that I have a detector that detects the presence of a signal of 10 Hz. The input can be anything under the sun. Maybe its 10Hz in noise. Maybe its 11Hz and no noise. Maybe its 10.5Hz on top of a linear chirp, or a bird song. Maybe its brown noise overlayed with human voice, overlayed with a 60Hz power supply. How does one model that, or any of the myriad combinations therein?

I do not know if I can get the theoretical performance of my detector, because quite simply I do not see how thats possible for realistic scenarios where anything can be your input! This goes back to Point#2, whereby, how can one possibly know of every possible input into the detector? I could be wrong on this so please show me how.

Practical aspect:

Therefore in this sense, I suppose my question is: I already have a detector in place. It takes an input vector, and spits out a decision, 'yes' or 'no'. I understand that I have to label my data sets in order to come up with true positive and false positive rates. In this case it seems to me that the only possibility is to come up with a data set that represents just about anything possible under the sun, and test that against your detector.

What am I not getting here?


texts:
Suppose I have two cameras, c1 and c2 that are securely installed and do not move.  What I want is a matrix T, that takes a pixel of an image from camera c1 and calculates the according pixel in an image from camera c2.

I now wonder:

Do I need to calibrate both c1 and c2 to get their intrinsic and extrinsic parameters and additionally find a relationship between the coordinate system of camera c1 and c2

or

Can I calculate a registration between an image of c1 and an image of c2 using interest points (e.g., by MATLABs cpselect and fitgeotrans functions) and use this registration matrix also for future images?

I believe that a generally suitable transformation matrix T between the two cameras' images is only possible to get if you first calibrate both cameras (in the sense that you calculate the extrinsic and intrinsic parameters). In my feeling it is otherwise impossible to reflect the fact that we are dealing with 3D objects. T will only be able to transform the 2D images. Is this correct? If so, can you elaborate more on why this is the case?


texts: Effect of low pass filter on the time domain

texts:
Consider an ideal (rectangular profile in frequency domain) low-pass filter (LPF) which simply sets to zero all the frequencies beyond a certain cut-off frequency. Let $x$ be a discrete-time signal of duration $N$ in time domain, i.e., $x=[x_1,x_2,\ldots,x_N]$. Apply $x$ as input to the LPF and let $y=[y_1,y_2,\ldots,y_N]$ be the corresponding output signal in time domain. I have checked the spectrum of input and output signals and I can confirm the filter works well and also the input and output signals make sense.

From simulations, I can see that the following condition holds:
$$
\sum_{t=1}^{N} x_t = \sum_{t=1}^{N} y_t.
$$
My question is why this condition should hold. Is it there a general rule? I can think of an example where it holds. If I filter every frequency except the DC component, then the output signal in time is the mean value of the input signal and indeed the condition above is verified since
$$
\frac{\sum_{t=1}^{N}x_t}{N}=\bar{x},
$$
where $\bar{x}$ denotes the mean value of signal $x$. If $y_t=\bar{x}$, $\forall t$, then
$$
\sum_{t=1}^{N}y_t = \sum_{t=1}^{N}\bar{x} = N \bar{x} = \sum_{t=1}^{N}x_t.
$$

For example, I know that by Parseval's Theorem the energy of the output signal will be different from the energy of the input signal (and this occurs) but I am not sure why the condition above should hold.
Thank you very much in advance.


texts: Convert RGB Image to Grayscale and Display It (Python + Matplotlib)

texts:
I just started learning image processing and I was trying to read a RGB image then convert it to grayscale. I was hoping for something like this:

However, what I get was:

I tried using both scipy and PIL but they yield the same results. Am I lacking of understanding about grayscale image here?

Using scipy:

from scipy import misc
car = misc.imread('image.jpg', mode="L")
plt.imshow(car)

Using PIL:

from PIL import Image
pil_im = Image.open('image.jpg')
pil_imgray = pil_im.convert('LA')

img = np.array(list(pil_imgray.getdata(band=0)), float)
img.shape = (pil_imgray.size[1], pil_imgray.size[0])
plt.imshow(img)


texts: First-order low pass filter with bounded derivative

texts:
Given a function $x(t)$ and a first order low-pass filter $\frac{dy}{dt} = \frac{1}{\alpha} (x(t) - y(t))$, is there a way to choose $\alpha$ analytically such that the derivative of $y(t)$ is bounded, i.e. $\forall t \frac{dy}{dt} \leq c$ for some given constant $c$?

Thanks for your help.

Note that this question is similar to the one here.


texts: How to implement HOG with trilinear interpolation by Matlab?

texts: I am studying HOG. I have find the code code1 and code2 about HOG. However, both of them don't implement trilinear interpolation. I have also read some websites, including web1 and web2. I still don't know how to write the HOG code with trilinear interpolation. Is anyone who can help me and provide me Matlab sample code about HOG? Thank you very much for your reply.


texts: Calculate the Derivative of Gradient Field of an Image

texts:
I meet a confusing thing in image processing recently....

Assume the image $x \in \mathbb{R}^n$, with its derivative (difference) matrix: $D^+ = \begin{bmatrix} D_h  \\ Dv \end{bmatrix} \in \mathbb{R}^{2n\times n}$ ($+$ means forward difference), also equal to $\nabla$. Therefore, it is natural to define the divergence: $\triangle = \nabla \cdot \nabla$.

I have seen some papers use $div = \triangle = D_h^-D_h^+ + D_v^-D_v^+ \in \mathbb{R}^{n\times n}$, where $-$ denotes the backward difference.

Here is my question: assume I want to calculate the $\frac{\partial\|\nabla x -p\|_2^2}{\partial x}$ where $p\in \mathbb{R}^{2n\times 1}$ is a vector not related to $x$, what is the result? I have seen some authors use $\nabla\cdot (\nabla x -p)$.

However, if writing the $\nabla$ as matrix form $D$ as I have introduced before, $D^T$ is exactly adjoint of gradient, not backward difference. Hence $-\triangle x$ would appear! So what is the right formula? Could anyone tell me?


texts: Are 2nd Order Edge Detectors More Susceptible to Noise?

texts: I am reading about edge detection and I read that 2nd order detectors are more susceptible to noise. Is there a mathematical proof to this ?


texts: Trying to plot frequency response of a filter Transfer Function in MATLAB, it looks wrong

texts:
I have the transfer function below which is for a IIR filter and trying to plot its frequency response for omega<pi. r=0.99 and theta=pi/3:

Here is my attempt at implementing it in MATLAB:
N=5000;
W=(0:pi/(N-1):pi);
r1=0.99;
theta=pi/3;
z= exp(j*W);

num= (1-r1);
den= (1-2*r1*cos(theta)*z.^(-1)+r1^(2)*z.^(-2));
TF=num./den;
TFdb= 20*log10(TF);
plot(W,TFdb)

Here is what I get:

Apparently it should look like this:

I am very new to this and can't tell what I'm doing wrong, would appreciate if anyone can help.


texts: Frequencies of complex exponentials in Discrete Fourier Transform

texts:
What I understand is that using DFT, we are representing a given discrete signal using a basis of complex exponentials of different harmonic frequencies. If I am taking 16 point DFT of a signal sampled at 1 KHz, k=0 corresponds to 0 Hz, k=1 corresponds to 62.5Hz etc. Is this correct?
In the figure, a cosine of 187.5Hz is shown and it is sampled at 1KHz. The sampled signal is actually the cosine part of the complex exponential of k=3 in a 16 point DFT. What confuses me is that, although the continuous time signal is periodic with frequency 187.5Hz, the sampled signal is not having the same period.
If the sampled signal is not of frequency 187.5Hz, how can we say that basis vectors of k=3 picks up the signal component of 187.5Hz?


texts: Pitch correction using Fast Foruier Transform

texts:
I am very new to digital signal processing and I have a project about audio programming. For the project, I wanted to try to make an Auto-tune like effect.
I started by experimenting on the signal processing on Matlab.

Firstly, I started by trying to change the frequency of a given audio signal. To do so, I had in mind to just take the fft of the signal windows, shift the frequency samples accordingly (of course taking into conisderation that the frequency samples are mirrored on the fft result) and to take the ifft but it does not seem to work.

Is my reasoning for pitch shifting conceptually correct and I am just making a simple mistake or should I do it in a different way?

Thank you


texts: Spectral peak location estimation using complex DFT

texts:
In this paper a simple method to estimate a spectral peak is proposed, by using quadratic interpolation between three samples of the DFT of the signal. Namely, the position of the peak relative to the index $k$ (they call this difference $\delta$) is calculated with this formula in the paper:
$$\delta = \frac{|X_{k+1}|-|X_{k-1}|}{4|X_{k}|-2|X_{k-1}|-2|X_{k+1}|}$$
This picture will make the formula easier to understand:

Then in the paper it is stated that:

The expression is simple, but it is statistically
biased and performs poorly in the
presence of noise. Some simple changes
[...]
improve its accuracy dramatically, for instance by using the complex
DFT values rather than the magnitudes
as follows:
$$\delta = -\mathrm{Re}\left[\frac{X_{k+1}-X_{k-1}}{2X_{k}-X_{k-1}-X_{k+1}}\right]$$

I understand where the first equation comes from. One can get to that equation by simply finding the coefficients of a parabola such that $y(m) = |X_m|$ for $m\in \{ k-1, k, k+1\}$, and then one can find the maximum for that parabola and get to the first expression for $\delta$. However, I don't understand why when using the complex DFT, the result the paper shows is that one.
Why does that negative sign appear? Why does the denominator seem to be divided by 2? Why do they take the real part instead of the magnitude, completely ignoring the imaginary part?


texts:
Say I have a signal $x[n]$.

What is $x[3-n]$?

My solution #1.

$x[-n]$, reverse first.   Then, $x[-(n-3)]$, shift to the right by 3.

My solution #2.

$x[n-3]$, shift right by 3. Then $x[-(n-3)]$, reverse the entire shifted signal.

Both of my solution is incorrect. Why?


texts: Efficient Hessian-Laplace blob detector implementation

texts:
As it is mentioned in a paper for SURF, it is possible to approximate hessian determinant using integral images.

If I want to implement Hessian-Laplace detector, is it feasible to also approximate Laplacian of Gaussian with the same approach?

Basically, I want to use the fast determinant of Hessian from SURF and while computing it, also get the laplacian by taking the trace of Hessian.


texts: How to apply neural network parallelly on each part of image

texts:
I have an image which is divided into four equal size square blocks. I want to apply neural network for denoising. Usually, I apply on the whole image. But i was thinking that is it possible to divide the image into equal parts and apply NN on each part parallelly.

Anyone, please help me how can I do that


texts: Intuition behind the Gaussian Filter in Image Processing

texts: I've been using a Gaussian Filter and know how to use it but I don't understand the physical significance behind using the filter. We use it but why? What is the significance? I'm just starting out in image processing, so please no high level responses. Thanks!


texts:
I found this comment inside MATLAB's deconv.m function

  Deconvolution and polynomial division are the same operations as a digital filter's impulse response $B(z)/A(z)$.

What does this statement mean?

Does this mean that one can recover the original signal, $x[n]$, given an impulse response $h[n]$ and output $y[n]$? If so, how?

Is it correct that if I subject an impulse signal $\delta[n]$ as input to a filter with the coefficients of $y[n]$ as the denominator and the coefficients of $h[n]$ as numerator I will get the original $x[n]$?


texts: Output of IIR filter not matching the frequency response - Proximity to fs/4

texts:
After not having dealt with digital filters for a long time, I have now been playing around with filter design in octave and I am observing a behavior which I do not understand.
After designing a low-pass Chebychev filter with cheby1(1,3,0.4) and plot its frequency response, it can be seen that the -3dB point is exactly at the specified cutoff frequency.
However, when I test the filter with an input wave x=cos(2*pi*cutoff*t), using the filter function y=filter(b,a,x), the amplitude of the output signal can get significantly lower than the expected $0.707$, $0.63$ for this example in particular.
It seems that the output of the filter better approximates the plotted frequency response for cutoff frequencies either close to Nyquist frequency, or close to $0$, but as it gets closer to the middle point between these two, the output steps away from the expected attenuation.
What is the reason behind this?


texts: STFT multiplied with Gaussian window vs STFT multiplied by rectangular window

texts:
I am currently analysing my signal by looking at its spectrogram to determine the sinusoidal frequency content at the local sections of my signal overtime. I can do my spectrogram in 2 ways:

Directly get the FFT of each local sections. Same as I multiply each section by a rectangular window with a height 1 and get the FFT.
Multiply each section by a Gaussian window and get the FFT.

Apparently, I get 2 different pictures of my spectrogram. Number 2 is known as the Gabor Transform.

My question here is, what is the motivation for doing the Gabor Transform vs directly doing the FFT at each section of a signal?


texts: How can I measure noise and sharpness of an image?

texts:
I'm working on a project which ranked some images based on quality.

For this project, I want to figure out the noise and the sharpness from a image.

To calculate the  noise (from a CCD-Sensor) I think I can calculate the average noise from a image. How could I do this? I've read something about MSE, PSNR and SSIM.  However, all these require a second image. Or is there a modification, so as I can use these algorithms for one image?
To calculate a value which represent the sharpness I have no idea. Maybe I can calculate the peak with the sharpest point of the image (because there are different kinds like out-of-focus or motion-blur)

Is there an available reference paper or an implementation in any language?

Update
 Can I use (slanted-edge) MTF to measure sharpness? I need some normalized metric to compare sharpness between images. Or is there a better solution?  A stand alone Laplacian is not normalized, I think.


texts:
In DFT calculation following formula is used
$$X[k] = \sum_{n=0}^{N-1} x[n] e^{-j2\pi\frac{kn}{N}}$$
where the Twiddle factor is known as complex root of unity, that is a complex number $W_N$ such that $(W_N)^N = 1$. There are $N$, $N$-th roots of unity.
$$\big( W_N \big)^{k} = e^{j2\pi\frac{k}{N}} = (\omega_N)^k$$

Suppose I am doing 8 point DFT. Then I am able to get the 8 frequency bins output of this DFT formula : $X[0], \ldots, X[7]$.

Please suggest what magic this twiddle factor does that when each twiddle factor is multiplied with samples & summation is done then we get the respective frequency bin?


texts: How is binary data related to double precision data?

texts: I am using wavread in MATLAB, which outputs the data in a .wav file in double precision. I am wondering how this relates to binary, such as 0's and 1's. Thank you!


texts: Understanding the lowpass filtering of a digital signal

texts:
I do not have any background in Electrical Engineering and I have recently started a project which involves signals captured from sensors.

Lowpass filtering: The way I understand it is: The values below the CUTOFF are allowed to pass through, above the CUTOFF are simply filtered.

So far so good. Now, how does this work in real world?

The data I have is captured 100 times per second at equidistant intervals, hence my sampling frequency is 100 Hz. This is also understandable.

But now, my CUTOFF is 20 Hz. What does it mean? Because all I have is some digits. None of them is below 20. When I read about filtering it makes me think of CUTOFF as some value from the range of signal itself. I have given multiple explanations to myself.

Somehow, from the signal, find out the frequency of each data point and if that frequency is below 20 Hz, don't do anything. Otherwise put 20 Hz in the output. But I have no idea how to find out frequency of single data point. After all, its just a number, right?
It has to work on multiple values at a time. That is, from one data point to the other, if there is some above average peak, just smooth it out. And this 20 Hz is essentially a limit of how sharp the peak can be.

Please help me understand in the simplest terms. I asked the same question to my guide and he explained me using the terminologies in Electrical Engineering and some more alienate stuff, which was ways and bounds beyond my brain.


texts: Audio signal comparison for automatic singing evaluation

texts:
I am trying to compare audio waveform from input waveform (A) to preset waveform (B)from in the device.

I try to lookup everywhere. Most likely someone give such a source code as follow :

    function compireAudio(){
    var audio1 =    "http://soundjax.com/reddo/86502%5Ealarm.mp3";
    var audio2 =    "http://soundjax.com/reddo/44368%5EALARME.mp3";
    var i,j,d;
    var matching = 0;
    var t = 0;
    var i,j,d;
    var matching = 0;
    var t = 0;
    var audio1Arr = Array();
    var audio1Len = audio1.length;
    for (i = 1; i<=audio1Len; i++) {
        //reverse so its like a stack
        d = audio1.charCodeAt(audio1Len-i);
        for (j = 0; j < 8; j++)
        {
            audio1Arr.push(d%2);
            d = Math.floor(d/2);
        }
     }
     var audio2Len = audio2.length;
     for (i = 1; i<=audio2Len; i++) {
       //reverse so its like a stack
       d = audio2.charCodeAt(audio2Len-i);
       for (j = 0; j < 8; j++)
       {
         if(d%2 == audio1Arr[t])
         {
             matching++;
         }
         d = Math.floor(d/2);
         t++;
       }
     }
   var avarage = Number(matching)/((Number(t)+Number(audio1Arr.length))/Number(2))*Number(100);
    alert('The Matching with the two audio is '+avarage+' %.');

And most people said this is not correct because it compare the stream instead of the audio content.

Anyway, I have think of compare every samples after normalization (ensure that amplitude is not a factor here). However, a phase is another problem here.

I have solution is cross-correlation between A and B and find the biggest convolution as output. In this case, they should be in same phase.

In short.
WAS Question is What are the common methods for two waveform comparison ?

UPDATE Maybe I should ask What are the common characteristic of a audio waveform for comparing audio waveform ?

P.S. I read this Question and answer. The bottom method seems work, but the comment said No.


texts:
I start a working with HART devices and I really try to understand how digital data is transferred trough 4-20ma current loop.
I start read this article: https://instrumentationtools.com/hart-communication-tutorial-part-1/ and one paragraph said this:
"The HART protocol makes use of the FSK technique to superpose the digital communication on top of 4–20 mA signals. The digital FSK signal is phase continuous and has a 0.5 mA amplitude having two different frequencies, 1200 Hz and 2200 Hz, representing binary 1 and 0, respectively. Since the average DC value of a sine wave over a time period is zero, the FSK signal does not add any DC component on the 4–20 mA analog signal."
I understand that the digital data is superpose on top of 4-20mA, but what I don't understand is if that analog signal "vibrate" to different frequency to produce digital communication data, or is another signal (the "digital" one) beside that, and if it is, how can they don't interact?


texts: Why the average signal power should be 1

texts:
When I read some books or papers related into signal modulation, for example, frequency-domain OFDM signal, it's always mentioned that the average power of signal is assumed to be 1.
Why does that assumption is taken? what's if that average signal power is more or less than one?


texts: On Video recording with IR camera, a file in .ptw is obtained. I want to analyze the file using standard software, like MATLAB. However, video processing in MATLAB requires the file to be converted to some standard formats like .avi or .mp4 or .wmv files. Please provide a way to make similar conversions, with the help of a software tool or any matlab function etc.


texts: Interpretation of a sampled signal in the frequency domain

texts:
Suppose we have a signal $y(t)$. For sampling we use a Dirac $\delta$ function.
The sampled function is $\widetilde{y}(t)$.
So $$\widetilde{y}(t) = y(t)\cdot\sum_{n=-\infty}^{\infty}\delta(t-nT).$$ The Fourier transformation is $$\widetilde{Y}(\omega)=\mathcal{F\{\widetilde{y}(t)\}} = \sum_{n=-\infty}^{\infty}y(nT)e^{-i2\pi\omega nT}$$
where $i$ is the imaginary unit and $\omega$ angular frequency. $y(nT)$ are the sampled points but I am having problems in understanding what $e^{-i2\pi\omega nT}$ of $\widetilde{Y}(\omega)$ means? I could write it down with $\cos$ and $\sin$ but this does not make it clearer. I would appreciate it if someone could explain it to me.


texts: how to find the "Natural and Total Response" of the system

texts:
Hello there I am a Student.

I need to know how to find the Natural and Total Response of the given system:

where: $x(t)=e^{-t}u(t)$ and $y(0^+)=2, \dfrac{d}{dt}y(0^+)=3$. (If the image above is not clear)

This is for my exam preparation, please kindly help or at least specify where
I can find the solution for this question, and  best tutorial for signal and system.


texts:
I have a map (in image format) describing the power grid of a continent.

Power plants have flags next to them, indicating their type (hydro, gas, oil, etc.). The power lines have a color indicating their tensions (different voltages). The cities are marked as black dots.

Here's a piece of the map, courtesy of the ENTSO-E consortium

Full maps here. Things get much more complex in populated area.

As you can see, the power lines are often overlapping each other. Moreover they are not simple straight lines. Two cities (points) can be connected by a broken line, with no middle point in between.

I need to turn that map image into a graph (dataset). The broken lines may be straightened and have their full length marked as the weight of the arc. Or they may be handled by inserting middle points.

I'd like to automatize as much work as I can, but, since the map is so complex, I understand I'll probably need some manual tool to do the final pass.

What would you suggest?

I think finding the power-plants should be possible using an automatic tool, then corrections and addition of arcs could be done using an assisted manual tool.

EDIT: perhaps this is something that can be done with a plugin for GIS software? If programming is involved, my favorite languages are Java and Python. I know C++ too.


texts:
In the filter graph below:

where circle with 'X' inside is a multiplication
circle with 'Σ' inside addition
and the triangle is a delay element

What could be the values x(k) in this type of filter? There is a rule? There is a range? I can understand the matrix of coefficients but i don't know about the x(k) values.


texts: RF Downconversion using Heterodyne Principle

texts:
after a RF down-conversion using heterodyning principle, will there be an information loss?
If we translate to a fixed IF frequency, is there is an intuitive way of explain that the information can be retrieved?
Is it correct to say that it is the relative change that matters during demodulation?
For example for AM it is the amplitude change and for FM its
frequency change and this does not change even if we down-convert to
a fixed IF frequency?


texts: Cascading filters at different sampling rates

texts: We are currently designing a type 2 compensator $G_1$ (1 pole at the origin, 1 zero and 1 pole) to stabilize a power factor correction (PFC) circuitry. The crossover frequency is low - 2-3 Hz - and the compensator is implemented using a biquad structure sampling at 10 kHz. For ripple filtering reasons, this filter will be followed by another low-pass 50-Hz filter $G_2$ having a sampling frequency of 200 Hz. I need the magnitude and phase responses when the two filters are cascaded. Is it correct to convert these filters in the s-domain then study the response of $G_1(s)G_2(s)$ or do I need to rescale $G_2$ in the z-domain with a 10-kHz sampling frequency before analyzing the product of the two transfer functions? Thank you.


texts:
I am trying to understand the concept of frequency modulation. As written in Wikipedia, if I have a signal containing information $x_m(t)$ and I want to transmit it using frequency modulation, I need to determine a center frequency $f_c$ of the carrier wave, which has a constant amplitude. To do so, I define
$$
f(\tau) = f_c + f_{\Delta}x_m(\tau)
$$
And then, I modulate my carrier signal
$$
y(t) = \cos\left(2\pi f_ct + \int\limits_0^tf_{\Delta}x_m d\tau\right)
$$
Where $f_{\Delta}$ is the the peak frequency deviation, i.e the maximum shift away from $f_c$.

I understand the roll that $f_{\Delta}$ takes, but I am having troubles understanding how to calculate it. For example, I want to transmit the signal
$$
x_m(t) = H(t-t_1) - H(t-(t_1+\Delta t)) + H(t-t_2) - H(t-(t_2 + \Delta t))
$$
i.e transmit a binary code in some sort. How can I find the frequency deviation? How do I calculate the carrier signal?


texts:
I'm trying to decipher the uncommented source code of SoundBox which is a little music tracker written in javascript.

There is an included synthesizer, which applies a filter on the output samples. I'm struggling to understand how it works.
You can find where the filter is applied in the source code here (line 251). However it is not commented.

Here is my interpretation of its definition.
First, the filter parameters:

a = cutoff/samplerate
f = 1.5 * sin(PI * a)
q = 1.0 - resonance

cutoff is in Hz. The samplerate is fixed at 44100.

then the filter process

low[i] += f * band[i-1]
high[i] = q * (x[i] - band[i-1]) - low[i]
band[i] += f * high[i]

y[i] = low[i]

where x is the input sample array, y the output and low/high/band some other variable whose purpose I don't fully understand yet.

This looks like some kind of IIR filter to me. Do you recognize it? Can you break it down for me? Explain it to me?

This is the low-pass filter version. One is supposed to be able to get a high-pass filter (or a band-pass) by changing the output to y[i] = high[i] (or band[i]).

I've made some experiments and it works pretty well, however the actual cutoff is a bit shifted and is not exactly equal to cutoff. I've been able to correct the problem by changing the definition of f to f = sin(2.0 * PI * a). Now the cutoff is exactly where it is supposed to be, but I don't know why. If you want to see nice pictures of that, you can see the issue I've opened on GitHub, but no response yet.

Thanks.


texts:
In this paper that I'm reading, I see this equation:
$$S_0 \star (S_0 * N) = N,$$
where $\star$ denotes cross-correlation, $*$ denotes convolution and $S_0 \star S_0 = \delta$. Is it true in general that $f \star (g*h) = (f \star g)*h$ and if not, why is it true here?


texts:
I want to know that what features might be needed for recognizing a word i a sentence exactly?
I guess the routine for recognizing the word in a sentence is ganna follow this:
1-calculate voiced and unvoiced and silence frames
2-determine a threshold
3- when ever we get to a silence frame,that could be an end point of a word besides considering other features ...
This is the main idea i guess , and if it is wrong or right or anything else,i would really appreciate if you help me out with completing these steps...
Thanks


texts: Fast Hartley Transform Implementation in MATLAB

texts: I want to implement Fast Hartley Transform (Specifically Discrete Hartley Transform) in a script file in MATLAB. Does anyone know have a reference implementation of this in MATLAB or another language so that a complete novice can understand it?


texts: Low data rate with high frequency offset

texts:
I am trying to implement a basic digital modulation scheme (BPSK) with a low data rate of 5 kbps. The requirement is to support a frequency offset of +/- 10 KHz.
I would like to know what are the criteria to decide how much offset can be corrected? My burst data header is only 50 bits. I want to know if it is possible to track the frequency offset and also do the timing recovery (gardner) in the header bits.


texts: Problem of processing speech. Required to determine the phonemes and identify vowels and consonants. Anyone involved in this? Please advise what work on the subject is worth reading?


texts: Is zero-padding necessary for speech processing to satisfy linear convolution property?

texts:
In the FFT domain, for example, if I multiply a noise reduction gain to the noisy signal, $ Y(w)H(w) $, this translates to a circular convolution in the time domain of the same length $ y(t) \circledast h(t) $. If I want to convert this to a linear convolution, I should do zero-padding such that the noisy signal y(t) is now twice the original length minus 1 (assuming the noisy signal $ y(t) $ and filtering signal $ h(t) $ are of the same length).

My question is, is obtaining a linear convolution necessary for speech processing? What happens if I just stay with the circular convolution (i.e. NFFT length = signal length)? What if I just want to maintain the same signal length before and after processing? I am quite confused about the importance of satisfying linear convolution property in the context of STFT.


texts:
I have multiple images like that shown below in which there are essentially two different brightness levels. I've looked into histogram equalization techniques in scikit-image as well as several background subtraction techniques in ImageJ, neither of which seem to be effective over the parameter ranges I've tested. I've thought of using edge detection to process the two regions separately, but my concern is that it will result in unnatural edge effects at the boundaries. There's also a lot of features in the image, making the simple edge detection techniques I've tried so far not work so well.

Are there better techniques for doing this sort of processing? I'm working in python with scikit-image, but would welcome any solution.

If it's not clear what kind of result I'm looking for, consider the below image that has an evenly balanced background.


texts:
How should I design FFT with fixed samples - always 2000, sampling frequency is also 2000, memory is external, there is no need to get sorted array.
As far I know it may go like factoring 2000 into $2^4 * 5^3$ and creating stages, maybe using optimal 16 point FFT or like in this paper about prime sizes to some power, but how the proper way of designing FFT from scratch looks like?

I am going to write it in C, but I am interested in design, a way to create optimal (in the number of multiplications and additions, counting real addition as 1, complex addition as 2, real multiplication as 1, complex multiplication as 6) FFT of given length with input being real signal and output being complex.


texts: How to get fundamental frequency of a signal using autocorrelation?

texts:
I am trying to get the fundamental frequency of a signal that only has a single pitch. I coded out the autocorrelation function using FFT and already got the autocorrelation result. Unfortunately, I don't know how to get the fundamental frequency from the autocorrelation result. Can someone help me? My JAVA code for getting the fundamental frequency using autocorrelation is below:

public double getPitch(double[] buffer, int firstSample, int lastSample, double sampleRate)
{
    int lengthOfFFTWindow=lastSample-firstSample;
    double[] input_buffer=new double[lengthOfFFTWindow];
    DoubleFFT_1D fft = new DoubleFFT_1D(lengthOfFFTWindow);
    double[] autocorrelation_values=new double[lengthOfFFTWindow];
    double[] fftData = new double[lengthOfFFTWindow * 2];
    double max=-1;
    double max_i=-1;
    //FFT on each sample in each window
    for (int i = 0; i < lengthOfFFTWindow; i++) {
        // copying audio data to the fft data buffer, imaginary part is 0
        fftData[2 * i] = buffer[i+firstSample];
        fftData[2 * i + 1] = 0;
    }
    fft.complexForward(fftData);
    for (int i = 0,j=0; i < fftData.length; i += 2,j++) {
        // complex numbers -> vectors, so we compute the length of the vector, which is sqrt(realpart^2+imaginarypart^2)
        autocorrelation_values[j] = Math.sqrt((fftData[i] * fftData[i]) + (fftData[i + 1] * fftData[i + 1]));
    }
    fft.complexInverse(fftData, false);
    for(int i=0;i<autocorrelation_values.length;i++)
    {
        if(max<autocorrelation_values[i])
        {
            max=autocorrelation_values[i];
            max_i=i;
        }
    }
    return max/2;
}

Is it correct to return the maximum autocorrelation value divide by 2 as the fundamental frequency? I keep getting wrong answers when I do that.


texts: Estimating and Improving the accuracy of fourier transform in the low frequency sector

texts: I have a time series file which starts with 1 and then quickly tends to oscillating about 0.001. The time series has a resolution of 0.01s and has 10^6 sequential points starting from t=0. The goal is to study the divergence of the fourier transform at Zero frequency. Is there any trick that can be employed to improve the accuracy in the low frequency sector?


texts: How to Apply Gaussian Filter to Raw Audio Files in Python?

texts: I am recording raw files in python to later break them into phonemes, but the noise in the surrounding environment is hampering the result. So, there is a need to apply a filter to the recorded raw audio files. How can this be done ??


texts: scipy.signal.deconvolve returns an array of NaNs

texts:
I am trying to implement a deconvolution-based event detection algorithm in python, but scipy.signal.deconvolve doesn't seem to work in my case. Here is a basic example:

#!/usr/bin/python
import numpy as np
from scipy.signal import convolve, deconvolve, unit_impulse

def event(x, start, a, t1, t2):
    """Event model based on two-exponent differential.

    Positional arguments:
    x - time array
    start - event start time
    a - event amplitude
    t1 - rise tau
    t2 - decay tau
    """
    y = -np.exp(-(x - start) / t1) + np.exp(-(x - start) / t2)
    n = a / y.max()
    res = n * np.array([0 if t < start else i for t, i in zip(x, y)])
    return(res)

signal = unit_impulse(1000, idx=100)
ev = event(np.arange(300), 0, -10, 1, 5)
conv = convolve(signal, ev)
signal_recovered = deconvolve(conv, ev)[0]

Here, signal_recovered always ends up containing all NaNs, except for the first value, which is Inf. Why does it happen?


texts:
I have a large number of images that are supposed to look something like the top part of the image:

Instead, some have defects in them, as in the bottom part of the image. As you can see, there are 2 types of defects:

Outliers: These are pixels (or small areas) of one colour located in a vast area of another colour.
Missing edges: These are black areas on the edges between two (non-black) colours.

There's also a third defect in some images, which is blur on the edges, but I think I can deal with that myself.

I'm looking for a way to automatically fix these images so that:

The outliers get replaced with the colour they're located in (so a red pixel in the green area gets painted green).
The missing edges get coloured in with the outer colour (so the black edge on the boundary between green and red gets painted green).
The rest of the image is left as is.
No additional defects (such as blur or image noise) are introduced in the process. The only colours present in the 3 ellipses should be (0,255,0), (255,0,0), (0,0,255).

Is such an automatic process possible using some kind of filter-based method or would I have to do this with some clever if-then rules for handling pixels based on their neighbourhoods?


texts:
I'm trying to detect when a signal is "on" from samples I have. Those samples come from a software defined radio, if that matters, and the signal i'm trying to detect is a WiFi signal.

The problem is separating "noise" from "signal", as I did by hand on the following image; green parts are when the signal is on, and non colored ones are when there is no signal (x axis: samples, y axis: energy level).

The main problem I have is that I do not now how to detect such signals, automatically. I tried by using threshold, but the noise level is subject to change. I can always determine when a signal is emitted « graphically », but i'd like to do this automatically.

Below is an exemple of "tricky" situation (signal is on on the left of the image):

What method could I use? I'm searching, specifically, to approach the one  in use in Wifi card, to sense signal and avoid interferences.


texts: Why am I not getting a flat phase for a Gaussian pulse when doing a Fourier transform in Python?

texts:
I have been trying to obtain a spectrum and a spectral phase of a Gaussian pulse using the Fast Fourier Transform provided with numpy library in Python. Here are the results:

It is known that the spectral phase of a Fourier-limited Gaussian pulse should be flat (i.e. equal to some constant across the whole spectrum). However, after having Fourier-transformed the pulse, I am getting a strange spectral phase as a result. I find this phase using the function angle provided with numpy which should calculate the phase of a complex number. Is there any idea what I a missing here?
Here is the code that I use.

import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import speed_of_light
from scipy.fftpack import fft, fftshift, ifft

# construct Electric field of a Gaussian pulse in time domain
def buildPulse(delays, wavelength = 700, fwhm_fs = 20, time_position = 0, phi0 = np.pi/2):
    frequency = speed_of_light/wavelength*10**9 # frequency in Hz
    period = 1/frequency*10**15 # period in fs
    sigma = fwhm_fs*(2*np.sqrt(2*np.log(2)))**(-1)
    envelope = np.exp(-(delays-time_position)**2/2/sigma**2)
    Ef = envelope*np.sin(2*np.pi*frequency/10**15*delays-phi0) # electric field
    return Ef, envelope, frequency, period, fwhm_fs

# fast Fourier Transform
def FFT(Ef,t0,tf,t_step,delays,fwhm_fs):
    # get frequency axis in Hz and wavelength axis in nm
    frequencies = np.linspace(10**(-25), (2*((tf-t0)/((tf-t0)/t_step+1)))**(-1), delays.size//2)*10**15
    clbr_const = (frequencies[3]-frequencies[2])*10**15 # freq axis calibration const
    print("clbr_const = ",clbr_const)
    wavelengths = speed_of_light*frequencies**(-1)*10**(9) # in nm
    wavelengths = wavelengths[::-1] # reversing wvelength axis to make it increasing
    # fast Fourier transform of Ef (electric field in time domain)
    spectrum = fft(Ef)
    # half of the spectrum-vector
    spectrum_half = spectrum[0:len(spectrum)//2]
    # normalization factor
    A = 2*(tf-t0)/spectrum.size/fwhm_fs
    return spectrum,spectrum_half,frequencies,wavelengths,A

# construct time-axis (delays in fs)
t0 = -200 # first time-point in fs
tf = 200 # last time-point in fs
t_step = 0.01  # time-step in fs
delays = np.linspace(t0, tf, int((tf-t0)/t_step)+1)

# construct the electric field of a Gaussian pulse
Ef, envelope, frequency, period, fwhm_fs = buildPulse(\
    delays, wavelength = 700, fwhm_fs = 20, time_position = 0, phi0 = np.pi/4)
print("frequency = ",frequency," Hz\nperiod = ",period,' fs')

# fast Fourier transform
spectrum,spectrum_half,frequencies,wavelengths,A = FFT(Ef,t0,tf,t_step,delays,fwhm_fs)
print("len(spectrum) = ",len(spectrum))

# amplitude spectrum
amp_s = A*np.abs(spectrum_half)
# real and imaginary parts of the spectrum
real_s = A*np.real(spectrum_half)
imag_s = np.imag(spectrum_half)
arg_s = np.angle(spectrum_half)

# plotting the results
plt.figure()
plt.plot(delays,Ef,delays,envelope)
plt.xlim([-100, 100])
plt.legend(["Electric field (Ef)","Envelope"],loc="upper left")
axs[0,0].set_xlabel('time (fs)')
plt.figure()
plt.plot(frequencies/10**12,amp_s)
plt.xlim([0, 1100])
plt.legend(["abs(fft(Ef))"],loc="upper left")
axs[1,2].set_xlabel('frequency (THz)')
plt.figure()
plt.plot(frequencies/10**12,arg_s)
plt.xlim([0, 1100])
plt.legend(["angle(fft(Ef))"])
plt.xlabel("frequency, THz")


texts: What does it mean to train and test a data for feature extraction?

texts:
I know how to do a feature extraction of a data using specific feature like entropy, and energy, using its train and test file to get the accuracy of it. But, i'm still quite confused on the concept of what is the train and test data.

Does train data mean it changes the data after it goes to the feature like entropy?
Then afterwards the accuracy will be checked using the test data?


texts:
I was wondering which type of signals have bounded-support Fourier transform. e.g. their transform is limited from zero to some non-infinite frequency.

The main reason I'm into it is that in Shannon's sampling theorem, we know that for some sampling rate, reconstruction is possible without aliasing, but I guess that's only true for functions which have a limited (cut-off) frequency


texts: How to convert from .wav (hydrophone data) to pressure (SPL)?

texts:
I am new here, since I started recently with signal processing. I am trying to analyze a .wav file recorded by a hydrophone, however, I need to convert it to SPL. I have a calibration file which contains 2 columns one with the center frequency of each bin and another with sensitivity calibration for each bin (dB re counts/uPa). How could I use this?

Edited: more characteristics of the hydrophone, the hydrophone I am using is LF (Low Frequency), therefore, the characteristics are LF column.

And here is the instrument sensitivity curve:


texts: time invariance $ y (t) = x(\frac{t}{3})$

texts:
check time variance of this system
$$y (t) = x(\frac{t}{3})$$

my solution
$$y_1(t) = x_1(t/3)\\
y_2(t) = x_2(t)=  x_1(\dfrac{t}{3}-t_o)$$
where
$$ x_2(t) = x_1(t-t_o)\\
y_1(t - t_o) = x_1(\dfrac{t-t_o}{3}) \ne y_2(t)$$
is this correct?


texts: Removing values from FFT result same as filtering?

texts:
I don't quite understand why the textbooks say it is impossible to implement an ideal low pass filter.

If I was to take the FFT of a discrete signal x[n], with Matlab's fft function I'd be returned with a complex sequence X[n] which represents the magnitude of each frequency from 0 to n/2 and is repeated. If I was to then say simply make all the lower frequency bins equal to zero and keep the remaining the same aren't I applying an ideal low pass filter. I am excluding all the frequencies I don't want and keeping the ones I do.

For example say I have the signal below

This is the fft, with the lower frequencies towards the ends.

I selectively remove the bins I do not want and keep the ones I do, note I don't actually have Matlab all the images are from a html page.


texts: optimization of Image Reconstruction Algorithm using Genetic Algorithm in Matlab

texts:
I'm trying to optimize an image reconstruction algorithm using genetic algorithm.I took initial population size as 10.I have an input image an 10 reconstructed image.fitness function is the difference between these two.That is

fitness_1 = inputimage - reconstructedimage_1;
fitness_2 = inputimage - reconstructedimage_2;
              :
              :
fitness_10 = inputimage - reconstructedimage_10;

I want to chose the best fitness population among them.But my fitness result is an image(matrix with intensity values).So how can I get a single fitness value for each population for doing crossover in the next stage.
Please help.Thanks in advance


texts: I'm wondering if they are some state-of-art algorithms to apply the convolutional neural network approach to 3D pictures, eg. input is no longer a grid of pixels, but voxels. My objective is to extract automatically features from 3D pictures and, cherry on the cake, perform supervised learning using 3D pictures as input data. Maybe others approach exist to extract features, but I would like to stay in the scope of machine learning approach (eg. don't want to use methods such as Fourier transform). Thanks in advance for your insights!


texts: Why having a ridge like Ambiguity Function implies lack of Doppler resolution?

texts: I was wondering why if the AF (Ambiguity Function) has a ridge like form it has low Doppler resolution.


texts: What's the relation between the sampling rate and FFT size in OFDM

texts:
In OFDM system,

Is there relationship between Sampling rate and FFT size? For example, if we downsample or oversample the received signal, Should we decrease or increase the FFT size accordingly?

thank you


texts: Calculation of actual analog input from bipolar ADC's output

texts:
I have a $14$-$\textrm{bit}$ ADC which can take $-10\textrm{ V}$ to $10\textrm{ V}$ as input. So, $0$ to $16383$ (digital) represents the voltage from $-10$ to $10$. If I want to get the actual voltage from the digital values I am getting, what should I do? i.e. if $8192$ is coming then my program should identify it as $0\textrm{ V}$.

Please help me out. If my understanding is wrong, please correct me.


texts: elementary one and multidimensional real examples of continuous/discrete LTI systems

texts:
By an LTI system, we mean a time-invariant linear map on continuous/discrete-time signals.
What (elementary one and multidimensional) real examples of continuous/discrete LTI systems do you suggest to provide a nice motivation for pure mathematicians?


texts:
Can you please explain in simple terms what do the input parameters indicate in the ordfilt2 function in matlab?

B=ordfilt2(A,Order,Domain)

I have seen people use this function as J = ordfilt2(I, 9, true(5)) or J=ordfilt2(I,25,ones(3,3))

But I do not understand what each input does to the image I to give J as output..

Thanks a lot in advance


texts:
So after a good while of digging and practicing, I think I've managed to gain a decent intuition for some of the very core concepts related to linear systems, filter coefficients/parameters, FIR/IIR filters, the DFT/FFT, analyzing spectra and using statistical measures for random signals (stationary,non-stationary). I have a fairly good idea of magnitude and phase, and implementing and analyzing an STFT.

BUT... I struggle quite a lot with implementing something I read in a paper, especially if it's to do with more practical applications that need adaptive filters or estimating filter parameters. I can follow along for most of the math and understand what is being said for the most part, but find myself very easily lost for weeks to no end.

I'm curious if anyone out there has had similar issues, and if there were any solutions that were particularly useful for getting more comfortable with the core concepts. I honestly feel it would help a lot to have some kind of supervisor/TA that I could go to with my questions. Perhaps there are tutoring/mentoring websites out there? StackExchange is honestly really great, but sometimes I either find myself struggling to ask the right question, or not knowing enough to understand the given answers.


texts: Why do envelope extraction before pitch detection?

texts:
I am referring to this report on pitch estimation.

The author does envelope extraction using Hilbert transform before applying AMDF.

What is the advantage of doing that?

Is speech a narrowband or wideband signal? I read somewhere that hilbert envelope extraction works better for narrowband signals.

When I extracted envelope of a speech signal using Hilbert transform, in some places the envelope was almost the same as the original waveform(Figure 1), whereas in other places it tracked the upper portions of waveforms (Figure 2).

Red curve is the Hilbert envelope, blue curve is the speech waveform.

Fig 1

Fig 2


texts: How to assess perceptual volume from FFT

texts: So far I could estimate signal volume from FFT using amplitude information, then adding all amplitudes together and divide this number by the number of frequencies. But I think this method does not apply for estimation of subjective perceptual volume.


texts: Representing data in combination of QAM and BPSK

texts:
I have a question regarding the data representation in different modulations. Assuming we are using MIMO system whith $4$ $T_x$ x $4$ $R_x$  which means four transmission antennas by four receiving antennas. My question, if three antennas are using QAM modulation, and the other antenna uses BPSK modulation. Is it possible the Receiving antennas can distinguish the data sent from each antennas ? I mean is it possible to detect the data sent from transmission antennas?

I'm asking that because in QAM modulation, data will be represented with real and imaginary parts, where in BPSK, data will be represented in real part only. So I see it logic that receiving antenna can detect the data perfectly. But I'm not sure.


texts:
I have a signal X(n) of length 24. But I want to find 1024 point FFT of this signal. I can do this by padding 1000 0s in x(n). But this requires huge memory which actually will be having only 24 valid data points.

Is there any way I can avoid this extra padding and yet be able to perform FFT. To be very specifica I am using CUFFT for finding FFT on the GPU. The padding 1000 0s means I have to allocate this extra memory on the GPU and also do copying operations from GPU to CPU and CPU to GPU etc.

Any hint?


texts: Envelope reconstruction algorithm for audio processing

texts:
I need to reconstruct the envelope of a sound.

Audio data are professionally-recorded natural sounds (speech, bird songs) with very little noise. I would prefer working in the time domain rather than in the frequency domain (I've seen some algorithms based on FFT transformations that looked overcomplicated for what I need). The algorithm will be implemented in an interpreted language so it needs to stay "light" in computation.

As a first approach, I considered using a peak detection algorithm, then doing a linear interpolation between the peaks. But isn't there some pitfalls with such a naive approach? Are there some standard ways of implementing envelope reconstruction in the time domain that would better suit my needs?

FWIW, I'm not familiar with digital signal processing vocabulary, so do not hesitate to reword my question if I misused some terms


texts:
Is it possible to design linear-phase filters that sum to a flat frequency response?  If so is it practical to use them in real-time audio processing for as many as 10 bands?
My experience has only been with Linkwitz-Riley IIR filters, but I would like to explore the possibilities of linear phase or minimum phase filters.
From my initial research it looks like the frequency sampling method would result in ripples and wouldn't sum to a flat response (especially across several bands).


texts: Low pass equivalent of bandpass white noise

texts:
Let
$$n(t) = Re\{z(t)e^{j2\pi f_ct}\},\ $$ where $z(t)$ is the low pass equivalent of white noise $n(t)$. We know the autocorrelation of $n(t)$ is
$$R_n(\tau) = \frac{N_0}{2} \delta(\tau),\ $$
$\delta(\tau)$ being the Dirac delta function and the PSD is $S_n(f) = N_0/2$.
From Proakis' Digital Communication book, I learned that the autocorrelation of $z(t)$, $R_z(\tau) = N_0\delta(\tau)$, and PSD is naturally, $N_0$.
Now consider
$$z(t) = x(t) + jy(t)$$
I also know that $$R_z(\tau) = R_x(\tau) + jR_y(\tau)$$ So what are $R_x(\tau)$ and $R_y(\tau)$? Proakis' book mentions $R_z(\tau) = R_x(\tau) = R_y(\tau)$. But that seems a bit off to me.
Since, $R_z(\tau)$ is real then shouldn't $R_y(\tau)$ be zero being as it is the imaginary term in a real quantity?
Reference: Proakis, Digital Communication, Third edition, Chapter 4: Characterization of communication signals and systems, section 4-1-4, Representation of Bandpass Stationary Stochastic Processes.


texts: Inter-point interpolation using FIR filter

texts:
Suppose I have discrete noisy signal $X = (0.096, -0.0632, 0.351, 0.531, 0.360, 0.006, -0.320)$ sampled at discrete time points $T = (1, 2, 3, 4, 5, 6, 7)$. Filtering (zero-padded) $X$ with symmetrical FIR $G = (\frac{1}{4}, \frac{1}{2}, \frac{1}{4})$ gives me a good approximation of underlying $f(t)$ but only at discrete time points $T$. Is it possible to use filter coefficients to approximate the values of $f(t)$ between discrete values, e.g. estimate $f(\sqrt 2)$?

In Interpolation with an FIR filter user Hilmar mentions Whittaker–Shannon interpolation formula, but it is sensitive to noise. Is it possible to construct smooth but more noise-robust interpolation by using FIR coefficients somehow?

Or, separate interpolation step (e.g. spline or polynomial interpolation) after FIR application is the only practical way to go?


texts: Relation between Gaussian and Savitsky-Golay kernels

texts: I would like to make a mathematical comparison between two methods in my field. One smooths with a Gaussian filter, and one smooths using a second-order Savitsky-Golay filter. Let's say the window size is the same in each case. Is there any way to formally compare these two approaches in terms of their impact on a function f? Can one be expressed in terms of the other, or in some common framework?


texts: Kalman Filter to estimate 3D position of a node

texts:
Code given on this link works for 1D:
Kalman filter for position and velocity: introducing speed estimates

In my problem I need to estimate 3D position.What is the criteria ?

How F, G ,H,Q and R change in 3D case.
This problem is restricted to estimate position only  (No velocity,No acceleration).What measurement vector should contain.Only positions?
Please respond!I am sorry for any inconvenience


texts:
I'm an IT student and got an assignment to do about Dynamic Time Warping(DTW) using the Speech Signal Processing Toolkit (SPTK) and comparing some words spoken by 2 speakers and finding the similarities. I managed to get the SPTK working, collected 8 people(4 females, 4 males) who recorded 8 words each for me(same words for every person) and saved them as files with a .wav extension.

My .wav files are in the following format:

RIFF (little-endian) data ;
WAVE audio ;
mono ;
sampled at $16\text{ kHz}$.

I transfered every .wav file into .raw data files with the SPTK conversion function :

wav2raw +f source_maleA.wav

The .raw file I get is:

Unsigned 8 bit ;
Sampled at $8 \text{ kHz}$ ;
Mono.

I transfered every .raw file to a .mcep file with this line of code:

x2x +Sf < source_maleA.raw | frame -l 320 -p 160 -n | window -l 320 -L 512 -n 1 | mcep -l 512 -m 13 -a 0.42 > source_maleA.mcep

After that, I went to compare the .mcep files with this line of code:

dtw -m 13 -s Scorefile target_maleB.mcep < source_maleA.mcep > source_maleA_target_maleB.dtw

The output of that command line (the "Scorefile") is a binary file.

I programmed a code that decodes the binary sequence written inside of the Scorefile and the output is some kind of decimal number: $0.678382$, which could imply a percentage of something.

Since by the SPTK documentation they are using some .short files of their own, I tried to remove the header of the .wav files and use them as .raw format and then convert it to .mcep file for the further use.

Since my understanding of DTW is limited by itself, plus my understanding of the SPTK tool is also limited, could anyone tell me if what I did is good?

I divided the files into frames of $320$ samples and periods of 160 and I used $x[0]$ as the first point of the first frame. I applied a Blackman's window of 512 samples length with the normalization computed by this function:

$$\sum_{n=0}^{L-1} w^2 (n) = 1 $$

After that I used the mel cepstral analysis to get the coefficients with $alpha = 0.42$ and I set the mc order to $13$.

Since when changing the length of the window, frames, period etc. etc. I don't get any better result, could anyone explain me what would be a good setup for all those factors?

Link to the SPTK (for the documentation and examples)


texts: How to extract a signal received from a given angle by two microphones

texts:
Please bear with me, as I'm only a programmer, and have no knowledge of signal processing as a discipline.

I have an application which generates a short pulse of 12 kHz frequency sound from a single central source, then captures any reflected sound with a pair of stereo microphones a few cm apart.

I want to be able to, effectively, scan across a range of angles, and extract the reflected sound at each angle, in order to build a picture of what is reflecting the sound.  Essentially, sonar.

I've tried extracting the signal at different angles by sampling the incoming waveforms at different points corresponding to the time difference each angle would represent; but I'm not sure how to get something sensible from that.
(I've tried calculating what I'm calling the correlation by dividing the absolute difference between the left and right signals and dividing by the maximum possible to normalise it; but all I seem to get, if I plot it, is noise).

I've spent a couple of days trying to find it online; but I'm hampered by my utter lack of knowledge of what even the most basic terms mean, and it's also a long time since I studied maths.


texts: I work on an ECG signal that I collect from a sensor, and it is very noisy. Having researched it above I read that FFT or so Nyquist-Shawon's casting theories were advised, being novice in the field thanks for advising me some methods would be best.


texts: transient and steady-state response of first order system

texts:
Considering this general 1st order transfer function

$$
H(z) = \frac{b_0 + b_1z^{-1}}{1-az^{-1}}
$$

How to find (analytically) the transient and steady-state responses?

With steady-state response I mean response to a sinusoid. I'm particularly interested in the case when $a=\pm1$.

Conceptually I have some difficulties grasping how to deal with the fact that the z-transform for a causal sinusoid only exists for $|z|>1$ (explained here) and that for the case when $a=\pm1$ the z-transform does not converge for $|z|=1$. So the 'straight-forward' procedure of multiplying $H(z)$ with the z-transform of a causal sine and then inverse z-transform the result seems to not be possible/valid. I'm confused.

Edit:

simple example

fs = 48000;
f0 = 1000;
T = 3/f0;
N = round(T*fs);
t = linspace(0,T,N);
x = sin(2*pi*f0*t);

bd = [1 0];
ad = [1 -1];
yi = filter(bd, ad, x);
figure;
plot(t,x,'b'); hold on;
plot(t,yi,'r')


texts: VLFEat: How to extract the SIFT descriptor without SIFT feature detection?

texts:
I am using the MATLAB interface to the VLFeat toolbox in order to calculate a SIFT descriptor for image patches extracted around key points. Due to the greater framework of what I'm doing, I cannot rely on the SIFT (DoG) feature point detector, but rather have to be flexible and calculate the descriptor for any given pixel and the given surrounding patch (currently of fixed size).

The difficulty I am currently facing is that (VL_)SIFT usually needs not only the position for which the descriptor should be extracted, but also scale and orientation, which usually comes from the DoG feature detection step. Since I don't have these, how can I still proceed? Or in other words: What are reasonable choices for scale and orientation in that case?
The purpose eventually is calculation of the similarity of two given patches rather than object recognition or classification, if that is of importance.

And, as a side question: How big is the neighborhood VLFeat's SIFT implementation considers for descriptor extraction? Is my whole patch used?


texts: 2-sided Regions of convergence for Z transforms

texts: Given a z transform with one pole can you have a 2 sided Region of convergence or does 1 pole limit it to being only left or right sided? I know when you have two poles the 2 sided scenario is when a "ring" forms between the two poles in the z-space but when you have one pole does the case when the entire z space is in the RoC excluding the ring formed by the one pole count as the two sided case?


texts: Multipath channel estimation in single carrier modulation

texts:
I think it’s a basic question, but I couldn’t get it’s clear answer. If we have data symbols $x$ vector of length $N$ x $1$ ; it’s convoluted with a multipath channel $h$ of length $L$ x $1$; the resulted signal
$y$ = $h * x$ ;
where $*$ is convolution operation.
if we have $x_{(1:4:N)}$ is the pilot symbols which well-known at the receiver, how can we get $h$ based on $y$?
thank you.


texts: Recommended resources for noise reduction

texts:
I know the question What Resources Are Recommended for an Introduction to Signal Processing (DSP)? and I have already read some general DSP books, such as Rick Lyons's "Understanding DSP,"  and also have browsed through Oppenheim's.

More specifically, what (printed) book would you recommend for denoising techniques in general?

Including techniques adapted for audio, spectral subtraction,  Wiener filtering,  etc. and if possible adapted to discrete signal processing with an algorithm/engineering point of view
  (i.e. rather x[k] than continuous x(t) and integrals...)

I just ordered a used version of Advanced digital signal processing and noise reduction, Vaseghi, but I'm looking for other recommendations.


texts: Difference between the use of 'bandwidth' in DSP and computer networking

texts: As far as I know, bandwidth is measured in herz or 'radian/second' in digital signal processing or in analog communications. But in computer networking it is measured in 'bits/second'. I don't get  how these two are related. Can anybody please help?


texts: Combining time domain and frequency domain data for BPM detection in real time

texts:
I would like to write a BPM detector. Does either of the domains provide more information for this type of analysis?

What exactly is being looked for in the data to detect onset for BPM detection in either domain?

Does tracking energy values in the time domain lead into rhythm detection?

Obviously pattern recognition can be used but how can it be done fast enough in real time using c?


texts: Why do we get less amount of lines then desired in line detection using HoughLines tranformation from OpenCV? How could we improve this method and get all the lines appearing in the image? I would still use HoughLines if probable.


texts: Why Do I Get This Crackling Noise on Zeroing out the High Frequencies?

texts:
I recently started playing with the Fourier transform (after spending a few weeks learning about the mathematics behind it). I decided to try hacking together a low-pass filter on the following sound bite:

In particular, I took the Fourier transform, zeroed out the highest 1/2 of the frequencies, and then took the inverse Fourier transform. This is what I got

Why is there that crackling noise?


texts: What do we know about the transfer function away from its zeros?

texts: So lets say I have a transfer function for an FIR filter $H(z) = (z-a)...(z-n)$ where $a,...,n$ are points along the unit circle.  But what about other points along the unit circle that correspond to frequencies we want to leave alone?  Won't we end up multiplying these frequencies by random complex numbers? when we would really like them all to just be multiplied by one?


texts: How to make low pass filter using frequency sampling method?

texts:
https://www.allaboutcircuits.com/technical-articles/design-of-fir-filters-using-frequency-sampling-method/
So there is two main equation:

I wish to filter out frequency $\le 10000Hz$, for example. So my $H(w)$ needs to be a rectangle wave with length 2*1000. However, H(w) needs to be periodic with period $2\pi$, because it's the Discrete-time-FT of $h_d(n)$.
In the link, $H(w)$ is sampled from $-\pi$ to $\pi$.  But my $H(w)$ needs to be sampled from $-1000Hz$ to $1000Hz$.
Which step am I missing? How to make a low pass filter using frequency sampling that work with any frequency (not just $\lt \pi$)?
Thank you.


texts: Power Spectrum and Power Spectral Density

texts:
From signal theory we know that a very useful representation of some power signals is that of its power spectral density, whose curve represents how the total power of the signal is distributed at all frequencies. For instance, it is a couple of dirac pulses for a sine wave of frequency f0 because its power is concentrated at frequencies f0 and -f0.

But in some different situations I have seen that we often use not exactly the power spectral density representation, but the power representation.

EXAMPLE 1: Measurements with Spectrum Analyzer

If we use a spectrum analyzer, we see in abscissa the different frequencies, and in ordinate the power of the signal. For instance, this is a measurement I have done:

I have sent to the instrument a sine wave of -13dBm of power, and its total power is represented in ordinate of the peak. What does it mean from a math point of view?

I think this representation has no sense: the ordinate should be the power spectral density, not its integral in a neighborhood around the frequency considered!

Example 2: simulink

This is the representation of the power spectral density of a certain noise:

This is the representation of the power of the same noise:

What is the link between them? Power should not be function of frequency (it is the integral on all frequencies of power spectral density), power spectral density yes! So what does it mean that we see the "power spectrum"?


texts: Using a Wiener Filter to Estimate a Transfer Function

texts:
As a follow-on to this question about estimating a transfer function of an unknown system using a Wiener filter,

How would you put a minimum MSE criteria on how well the estimated filter weights matched the actual transfer function of the system? [Suppose you needed the MSE to be no more than -50dB]?
How would you change his formulation if you wanted poles as well as zeroes (an IIR rather than an FIR filter)?


texts: Frequency resolution and timestep in DFT

texts:
I am learning DFT and I am not sure I understand it correctly. I am just going to write out the process of DFT and I am asking you to tell me if I am thinking the right way.

Suppose we have a signal on which we run DFT to get the frequencies incorporated in the signal. We use a window of size N samples and calculate DFT on it. The result are frequencies which occur in this chunk of audio. Now we can display the spectrum (like Winamp does). But we would like to display the spectrum while the song is playing thus calculating DFT for many such windows. Because it would take a long time to do this with all the windows, we say we have a timestep (dt) between windows. This way we loose some frequencies (not all samples are processed) but we gain in computing time and this way it is possible to display spectrum "realtime" while the audio is playing.

Again, I am not sure if what I wrote is correct so please shed a light.

Even if everything what I wrote above is true indeed, where does the frequency resolution (df) step in? My first answer would be the window size (N) because that way we can test more samples.


texts:
Below are the 2 images using modulation index. We need to find the difference between the two files.
Gear noise file:

Okay motor file:

The upper image is from a noisy gear.  Modulation is clearly seen from the color map.
The lower image is a motor with no noise and no modulation in the range of 1kHz to 2.5 kHz.
We need to find the amplitude modulation index.


texts: Derive Frequency Representation of Impulse Train Function

texts:
I want to walk through the derivation of the frequency representation of an impulse train.

The definition of the impulse train function with period $T$ and the frequency representation with sampling frequency $\Omega_s = 2\pi/T$ that I would like to derive is:

\begin{align*}
  s(t) &= \sum\limits_{n=-\infty}^{\infty} \delta(t - nT) \\
  S(j\Omega) &= \frac{2\pi}{T} \sum\limits_{k=-\infty}^{\infty} \delta(\Omega - k\Omega_s) \\
\end{align*}

Using the exponential Fourier series representation of the impulse function and applying the Fourier transform from there results in:

\begin{align*}
  s(t) &= \frac{1}{T} \sum\limits_{n=-\infty}^{\infty} e^{-jn\Omega_s t} \\
  S(j\Omega) &= \int_{-\infty}^\infty s(t) e^{-j\Omega t} dt \\
  S(j\Omega) &= \int_{-\infty}^\infty \frac{1}{T} \sum\limits_{n=-\infty}^{\infty} e^{-jn\Omega_s t} e^{-j\Omega t} dt \\
  S(j\Omega) &= \frac{1}{T} \int_{-\infty}^\infty \sum\limits_{k=-\infty}^{\infty} e^{-j(k\Omega_s + \Omega) t} dt \\
\end{align*}

To get from there to the end result, it would seem that the integration would need to be over a period of $2\pi$. Where $\Omega = -k\Omega_s$, the exponent would be $e^0$ and integrate to $2\pi$ and for other values of $\Omega$, there would be a full sine wave that would integrate to zero. However, the limits of integration are negative infinity to positive infinity. Can someone explain this? Thanks!


texts: How can noise be added to a signal to obtain a specific SNR?

texts:
How can I add noise to a recording to obtain a SNR value provided by the user? I am tryin to test the effects of noise on my algorithm. Is there any function or app for doing that kind of task?

Thank you.


texts: What kind of power spectrum implies uncorrelation in time?

texts:
I am new in signal processing field, and actually I just need some basic tools for what I am working on. I've learnt that the autocorrelation function is the inverse Fourier transform of the signal's power spectrum, and that if the power spectrum is flat then the autocorrelation function is the Dirac delta, so that the signal is uncorrelated in time.
But what if the power spectrum is constant only within the range of the cutoff frequencies?
In particular, I am given the following power spectrum for a signal $x(t)$:

$ S_{xx}(f)= \frac{1}{2(f_u-f_l)}$, for $\vert f\vert \in [f_l,f_u]$,

where $f_u$ and $f_l$ are the upper and the lower cutoff frequency respectively.

Does the uncorrelation still hold? If not, does the signal satisfy any property anyways?

Thank you in advance.


texts: 1-D Fourier Transform Of A 2-D Image But At An Arbitrary Orientation

texts: If one has a 2-D array and would like to take the 1-D Fourier transform along a direction $\theta$ degrees off the horizontal, is there a better/faster way to do this rather than rotating the image by $-\theta$ degrees, taking the 1-D FT across the columns, and then rotating the result back by $\theta$ degrees?


texts:
Can filter "depth" be adjusted by mixing dry and wet signals?

I.e. can I simulate e.g. a +6dB bandshelf/peak filter at 1kHz by mixing in some of the dry unequalized signal and some of a wet signal that has been bandpass filtered at 1kHz and the filter has around the same shape as the bandshelf/peak.

Can it be theoretically the same?


texts: Do i need to remove mean in STFT when working on music audio?

texts:
i need to apply a STFT to some music audio files but i can't understand if i should remove the mean or not. I know that for stochastic signals that is a must and that sometimes also necessary for deterministic ones but i can't figure out whether it's a proper procedure or not for audio signals.
To be more specific i'm referring to the average of a window at a particular time t, not of the whole signal since (correct me if i'm wrong) it doesn't  make any sense to me to remove that since it's time dependent. Also, if i were to not remove the mean, wouldn't that cause spectral leakage since there is a minimum retrievable frequency for the FFT?
Thanks in advance


texts:
I am trying to understand some basic concepts with IFFT as represented here OFDM Modem page 50-53, and 108-114.

Some basics that are represented -

The base sampling rate is 8khz.
The symbol period is 32ms, which would calculate to 250 total samples.
The fft size is 64.
The bin separations are 32hz.
The bandwidth used is from 1000-3000hz(1024-3072?)

I cannot get my mind around how to get from a ifft size of 64 to an output bandwidth of 1000-3000 and 32khz spacing.  Is there some basic reason why I wouldn't use a much larger ifft size of something like 256, and then use only 32-96? That would calculate to 31.25hz per bin.

In short, this thesis is proposing that you use a fft size of 64 to cover a bandwidth of 2khz beginning at 1khz, 1k-3k.  This isn't coming together for me at all, how this can get shifted.

If I have to be math'ed here, be gentle.

First attempt at upconversion using a spreadsheet:

=(C12*ROW(C12)*EXP(-1*2*PI()*10*ROW(C12)))/ROW(C12)

Where 10 is the carrier freq, C(12) is a row containing a sine lookup value.


texts:
I need to get information about contrast of an image, and I compute its value in this way:

contrast=Pmax/Pmin

where Pmax is the pixel of the image with the highest value, an Pmin is the pixel of the image with the lower value.

Is this the correct way, or there is another approach?


texts: Interpreting zero-mean Gaussian noise in the context of Kalman Filters

texts:
Consider an object moving in 2D space with constant speed $v_x$,$v_y$. If its  acceleration is modelled as zero-mean Gaussian $ a_x \sim N(0,\sigma_{a_x}^2)$ and $ a_y \sim N(0,\sigma_{a_y}^2)$ within each time step $\Delta t$.

In my understanding it means that if we were to take samples of either $a_x$ or $a_y$ several times within the same time step $\Delta t$, the mean of the sampled values will be approximately zero, and the variance will be approximately $\sigma_{a_x}^2$ or $\sigma_{a_y}^2$.

Is my interpretation right?

If the interpretation is right then how should the equation for updating the position be written?
$$
x_{new} = x_{old} + v_x * \Delta t \\
y_{new} = y_{old} + v_y * \Delta t
$$

OR

$$
x_{new} = x_{old} + v_x * \Delta t +  {1 \over 2} a_x*\Delta t^2 \\
y_{new} = y_{old} + v_y * \Delta t +  {1 \over 2} a_y*\Delta t^2
$$

As I understand it, the mean value of the accelerations is zero, so the accelerations should have no overall impact on the position. However the variances are non-zero so the variances should affect the variances of the position, let's call them $\sigma_x^2$ and $\sigma_y^2$.

$$
\sigma_{x_{new}}^2 = \sigma_{x_{old}}^2 + {1 \over 4}\sigma_{a_x}^2*\Delta t^4  \\
\sigma_{y_{new}}^2 = \sigma_{y_{old}}^2 + {1 \over 4}\sigma_{a_y}^2*\Delta t^4
$$


texts: Cooley-Tukey Implementation of FFT in Matlab

texts:
For my course I need to implement a 30 point Cooley-Tukey DFT by transforming it into a 5x6 matrix.

I have tried to implement using the following Matlab code:

clc; clf; close all; clear all;
N = 30;
rows = 5;
columns=6;
data = linspace(0, 2*pi, N);
data = sin(data)+0.1*sin(pi*data);
plot(data);
count=1;
matrix=(reshape(data, 6, 5))'; % Read in row wise
test = matrix;
%Perform column-wise dft
for x=1:columns
    matrix(:,x)=dft(matrix(:,x));
end
%Perform Twiddles
for x=1:columns
    for y=1:rows
        matrix(y,x)=matrix(y,x)*exp((-2*pi*y*x/N)*1i);
    end
end
%Perform FFT on rows
for y=1:rows
    matrix(y,:)=dft(matrix(y,:));
end
out=20*log10(abs(reshape(matrix,1,N)));
figure
subplot(211);
stem(out); title('Using cooley-tukey');
subplot(212);
stem(20*log10(abs(fft(data)))); title('Using fft');

Where dft is defined as:

function output = dft(input)
 n = length(input);
 output = zeros(size(input));
 for k = 0 : n - 1  % For each output element
   s = 0;
    for t = 0 : n - 1  % For each input element
     s = s + input(t + 1) * exp(-2i * pi * t * k / n);
   end
   output(k + 1) = s;
 end
end

The instructions that were in our lecture were:

Load 2D array by rows
Transform each column
Twiddle each element
Transform each row
Unload 2D array by columns

Now it outputs some very different outputs:

Anyone know what I am doing wrong?


texts: Weak sense stationarity sufficient for multitaper spectrum analysis?

texts:
This is a general question on multitaper spectral analysis of signals and stationarity

I work with time series which are non stationary. In this regard I have two questions

Is weak sense stationarity of second order sufficient to apply multitaper spectrum to compute valid estimates from contiguous time series objects or strick sense stationarity is required.
Multitaper works with signals that are periodic, quasi periodic, nearly periodic, and semi periodic signals however I find hard to diferenciate between periodic and the rest as to be able to see if the series I am working with belong to any of the mentioned groups.

Your help will be welcomed


texts: Extraction of non-sinusiodal repetition rates

texts:
I have an auto-correlation function that was generated from a signal, and I am trying to extract its 'repetition rate' in order to calculate the dominant frequency of the pulse, but I am not exactly clear how to do this.

Here are two cases, labelled 'good' and 'bad' to mark best/worst case scenarios. What methodologies exist that I can use here? Since the repetitions are not sinusoidal, the spectrum does not seem to yield good information.

Here is the original 'good' case:

followed by its auto-correlation.

Similarly, here is the original 'bad' case:

again followed by its auto-correlation:

EDIT: Raw data files as requested:

Raw1

Raw2

EDIT On Feedback:

Spectral analysis was suggested, however I did not have too much luck with it as the spectrum does not look too sharp around the region where you would expect it to. I think this may to due to the fact that the signal is not a repetitive sinusoid and so projecting it on sinusoidal bases does not do too well.


texts: Is this a valid z-transform of $ \frac{1}{n^2}u[n] $?

texts:
I was looking over some DSP and came across the following signal: $x[n] = 1/n$. So I wondered whether it had a z-transform but I soon realized that it fails to meet two conditions described here:

  ...(1) the signal starts at a finite time and (2) it is asymptotically
  exponentially bounded...

So I modified it to meet those requirements: $x[n] = \frac{1}{n^2} u[n] $

(I assume $n>0$ is a condition or perhaps $u[n]$ should be changed to $u[n-1]$.)

Considering that signal, I believe it satisfies both requirements however I don't see anything like it in a table of common z-transforms, but it can be rewritten as:

$ x[n] = \frac{1}{1^2}*\delta[n-1] + \frac{1}{2^2}*\delta[n-2] + \frac{1}{3^2}*\delta[n-3]\ +\  ...$

Which I believe transforms to $ X(z) = \frac{1}{z^1} + \frac{1}{(2z)^2} + \frac{1}{3^2z^3} +\ ...  $

Does this transformation make sense? Is it the best approach? And if it's correct, is there a more compact way to express it?


texts: Is the power or root-power scale correct for FFT analysis of an audio file?

texts:
I wrote Python scripts to create a spectrum analysis of audio files. The goal is to compare multiple spectrums to get the dB difference at certain frequencies.

When I started using the Sonic Visualizer tool for my first analyses, then switched to my automated solutions using Python with SciPy and NumPy, I noticed a large difference in the values of the spectrum analysis.

It seems Sonic Visualizer uses the power scale, while most other audio tools use the root-power scale for the spectrum analysis.

Now I am a little bit confused about the two quantities.

Shall one use the power scale or the root-power scale for spectrum analysis of audio files?


texts: How to break a second-order filter into two first-order filter

texts:
Let's assume the transfer function of a continuous-domain filter consists of two poles and one zero:
$H(s) = \frac{k_c (s-\omega_{z_1})}{(s-\omega_{p_1})(s-\omega_{p_2})}$.
Let's consider we do the bi-linear transformation and we get the numerator and denominator coefficients in $z$-domain:
(Numerator coeffs): $\,\,\,\,$  $B = [b_0, b_1, b_2]$ and,
(Denominator coeffs): $A = [a_0, a_1, a_2]$.
Then we filter an input signal $v_{in}$ with this filter to get $v_{out}$:
$v_{out}$ = filter(B,A, $v_{in}$);
Now I want to try another way in which I break the second-order filter $H(s)$ into two first-order filters $H_1(s)$ and $H_2(s)$ where $H(s) = H_1(s) \times H_2(s)$ and
$H_1(s) = \frac{k_c (s-\omega_{z_1})}{(s-\omega_{p_1})}$.
$H_2(s) = \frac{1}{(s-\omega_{p_2})}$.
Same as before we perform bi-linear transformation and we get the numerator and denominator coefficients
of $H_1(z)$:
$B_1 = [b^1_0, b^1_1]$,
$A_1 = [a^1_0, a^1_1]$,
and $H_2(z)$:
$B_2 = [b^2_0, b^2_1]$,
$A_2 = [a^2_0, a^2_1]$,
Now I want to apply these two filters on the same input waveform $v_{in}$ and get the same output waveform $v_{out}$.
Obviously I tried something like below and it did not work:
$v_{mid}$ = filter($B_1$,$A_1$, $v_{in}$);
$v_{out}$ = filter($B_2$,$A_2$, $v_{mid}$);
Can anyone figure out how this can be done properly to applying two first-order filters in sequence instead of applying a second-order filter and get the same output?
P.S.: Here, the plan is NOT to reconstruct coefficients $A$ and $B$ from $(A_1, A_2)$ and $(B_1, B_2)$.


texts: Which one is better method and why? Manually Handcrafted sound features vs spectrogram + convolution

texts:
I am working on classifying different sounds ( not speech or words exactly something like ambulance alarm, police alarm, cough sounds etc)
I read few paper which suggested to extract dsp features such as MFccs, skewness, kurtosis, log energy, entropy, zcr etc ( using total around 20 features ) from each segmented sound event.
I am currently using all these features and training xgboost, 3 layer DNN with ReLU, I am getting good accuracy.
I also read recent deep learning papers where they just used spectrogram images and feed it to convolution network which is capturing both temporal and spatial features. ( Using spectrogram one feature only )
I am looking for some explanation which one is better method for classifying sounds and why?
Any reference paper for comparison would be additional help.
Thank you!


texts:
How can you implement a $9\rm V$ battery with a phase of $45^\circ$?  (As a black box with a DC Voltage of $9\rm V$ and a phase of $45^\circ$)

Please preface your answer with spoiler notation by typing the following two characters first ">!"


texts: DFT of an audio signal stored as a multi-dimensional array

texts:
I'm using the Python scipy library to get the data of a particular .wav file into array format. Now, I'd like to find the Discrete Fourier Transform of that signal. The formula for the DFT is,

$X_k = \sum_{n=0}^{N-1}x_{n}e^{-2\pi ink/N}$ for a signal $x(t)$ of length $N$.

The data returned from the wavfile.read function, however, appears as a multi-dimensional array; it begins: array([[0, 0],
       [0, 0],
       [0, 0],
       ...,
       [0, 0],
       [0, 0],
       [0, 0]], dtype=int16). I've seen the formula for the 2D Discrete Fourier Transform, but I was under the impression that this was used for image processing. How would I go about finding the DFT of an audio signal represented by a multi-dimensional array?


texts: Passing a sampled signal through a filter

texts:
I was wondering why is it wrong to use a band-pass filter on a sampled signal?

If the signal we want to sample has frequencies up to fmax, we sample it with frequency fs = 2fmax (so that Nyquist theorem condition is fulfilled), and the spectrum of the sampled signal will have scaled "copies" of the original spectrum centered around frequencies k * fs (k = +-1, +-2 ...).

What would happen if we filtered that sampled signal with a band-pass filter [fs-fmax, fs+fmax], and why is it wrong?
Wouldn't we end up with the signal we started with?


texts: Is the FFT magnitudes of multiple audio sources additive?

texts:
Is the FFT magnitude of two audio signals when played together the sum of their individual FFT magnitudes across frequency bins? Note I'm talking only about the magnitude, ignoring phase.

For instance, if two pure signals of sine wave of the same frequency but 180 degrees off phase are played simultaneously, would the magnitude of the FFT at said frequency be double that of a single signal or 0?

I believe it's the latter but I want to confirm.

Thanks


texts: Power Spectral Density of a WSS Random Process with 2D Discrete Fourier Transform

texts:
I'm trying to understand how the random process (RP) signal in discrete time domain is related to its power spectral density (PSD) in frequency domain if the signal is wide sense stationary (WSS). If an RP is WSS, then it has the following properly,

$$R_X(n_1,n_2)=R_X(n_2-n_1)=R_X(\tau)$$

So, if RP is WSS and 2D discrete Fourier Transform is completed on the autocorrelation of the RP to get the PSD, why is the below expression true?

$$S_X(\omega_1,\omega_2)=\sum_{n_1}\sum_{n_2}R_X(n_1,n_2)e^{-j\omega_1n_1}e^{-j\omega_2n_2}=S_X(\omega_1+\omega_2)$$

My initial thought was that since the autocorrelation changes from 2D to 1D if WSS, the same should apply in the frequency domain for the PSD. But I do not have the knowledge to go any further than that for proving the above equation to be true.


texts: I already know that lag compensator acts like PI controller and improves steady state and lead compensator acts like PD controller improves transient state but how they achieve their goal?  Despite the fact that apparently both lead and lag compensator have same transfer function?  How are they both different, especially in terms of poles and zeros?


texts:
Dear all,

Please find attached image,
I am not able to understand why is the underlined term is to be included.
Shouldn't it be simply the exponential term?


texts:
Nyquist's formula for maximum channel capacity (noiseless channel): $C=2B \log_2(M)$

Shannon's formula (noisy channel): $C=B \log(1+S/N)$.

I need to distinguish between the symbol rate and the bit rate.
Ragarding the symbol rate, do the two formulas says that one cycle of a signal (i.e 1 Hz) cannot carry no more than 2 symbol/cycle?
Regarding the bit rate, Nyquist formula doesn't put a limit on the number of bits that can be put in each symbol, while Shannon formula takes that consideration.

Is my understanding correct?


texts: What segmentation methods can be used for simple images?

texts:
As related to the project I am currently involved in, I have come to realize that one thing that might help is for me to 'segment' my image. To that end, I have shown a very simple example below.

How do segmentation methods work in general, and what class of them would help getting me from the first image:

...to the second:

Please ignore the scaling that might seem to have occured here, but you get the general idea.


texts: What do certain terms mean in EEG processing describing frequency bands?

texts:
I've recently started a project about detecting driver drowsiness with an EEG and came across some terms I didn't quite understood:

  ...increase in theta activity occur... - ...low voltage theta activity
  during drowsiness induces alpha activity [1]

  ...by theta oscillations [2]

  ...drop of alpha waves

  ...automatically detect so-called alpha spindles [3]

I don't quite get what these terms actually mean and how to recognize them in an EEG signal. Do they talk about amplitude changes? Is there any source describing those EEG signal patterns?

Thanks in advance!

[1] Daniel L. Schacter, EEG theta waves and psychological phenomena: A review and analysis, Biological Psychology, Volume 5, Issue 1, March 1977, Pages 47-82, ISSN 0301-0511, http://dx.doi.org/10.1016/0301-0511(77)90028-X.

[2] Wolfgang Klimesch, EEG alpha and theta oscillations reflect cognitive and memory performance: a review and analysis, Brain Research Reviews, Volume 29, Issues 2–3, April 1999, Pages 169-195, ISSN 0165-0173, http://dx.doi.org/10.1016/S0165-0173(98)00056-3.

[3] Sonnleitner, Andreas, et al. "Alpha spindles as neurophysiological correlates indicating attentional shift in a simulated driving task." International journal of psychophysiology 83.1 (2012): 110-118.


texts:
I'm working on a project to do segmentation of thermal images. So far, the methods have produced limited segmentation performance (k-means, Otsu's Method, Sobel, Canny, LoG).

I am trying to achieve good segmentation of doors and windows in images like these. What approaches would you suggest to try?

I have tried to convert the images to grayscale using the temperature map, but this has done little to improve segmentation accuracy of these regions of interest.


texts: I am wondering what is the proper way to remove DC component from PSK modulated signals. Should I calculate mean value for I and Q channel separately and correct then samples in each of the channel or calculate one mean value for I and Q channel as one channel with interleaved samples (IQIQIQIQ) and then correct samples. What do you think?