texts:
I'm developing a Computer Vision project in Matlab as an aid to visually impaired people. The setup would be a stereo pair of cameras which the blind person would carry. Using this stereo information, I generate a disparity image using Semi-Global Block Matching (SGBM). After that, I process a "virtual disparity", which basically is a homogeneous transformation, to pass the image plane to the ground, resulting in an image like the following:

Now, After removing the ground plane, morphologically improve the image, and threshold it to keep only near obstacles, I get a foreground mask with the approximate shape of the objects.

I was thinking on tracking each one of the obstacles to improve the detection. Considering that the camera is not fixed since the blind person carrying it is moving, I wonder if the relative movement of all the obstacles in the image would be easily followed by a Kalman filter, or it would be better a feature-based tracker like Kanade–Lucas–Tomasi feature tracker (KLT).

Thank you in advance


texts: Techniques to reduce delay in detecting face from video using vision.CascadeObjectDetector in matlab

texts:
I wrote matlab code for face detection.In my code it is detecting face for first 100 frames and it crop faces from each frame and saves it in database folder.Problems iam facing

1.Detecting face frame by frame is very slow.Is there any idea to run faster since i have to work on 4000 frames.

2.In my database folder it has to show 1 to 100 face images but it is not showing 11th and 12th face images directly it showing 13th face image after 10th image.23rd face image is blurr.Likewise so many images are missing and some are blurr.Last image number it is showing as 216.But total 106 face images are there in database folder.In that 12 images are blurr.Remaining are correct images.

clc;
  clear all;

  obj=vision.VideoFileReader('basu.avi');

  for k=0:99

  videoFrame      = step(obj);
  %using viola-jones algorithm
  FaceDetect = vision.CascadeObjectDetector;

 %FaceDetect
  BB = step(FaceDetect,videoFrame);
  %BB
   figure(2),imshow(videoFrame);

  for i = 1:size(BB,1)
  rectangle('Position',BB(i,:),'LineWidth',3,'LineStyle','-','EdgeColor','r');
  end

  %crop faces and convert it to gray
  for i = 1:size(BB,1)
  J= imcrop(videoFrame,BB(i,:));
  I=rgb2gray(imresize(J,[292,376]));

  %save cropped faces in database folder
  filename = ['G:\matlab_installed\bin\database\' num2str(i+k*(size(BB,1))) '.jpg'];
  imwrite(I,filename);
  end
  end


texts: Recovery of Bandlimited Signals after Companding and Low Pass Filter

texts:
Let $\Omega > 0$ and denote by $\mathcal{B}_\Omega$ the subspace of $L^2(\Bbb R)$ consisting of signals that are bandlimited to $(-\Omega, \Omega)$.  Denote $\mathcal{L}_{\Omega} : L^2(\Bbb R) \rightarrow L^2(\Bbb R)$ the ideal lowpass filter that projects signals $x \in L^2(\Bbb R)$ into $\mathcal{B}_\Omega$: i.e., $\mathcal{L}_\Omega$ takes $x$ to the signal $y$ with

\begin{equation}
\hat{y} =\begin{cases}
    \hat{x} & \text{for } |\omega| < \Omega\\
    0 & \text{otherwise}
  \end{cases}
\end{equation}

A function $\gamma: \Bbb R \rightarrow \Bbb R$ is monotone increasing if $\gamma (t_2) > \gamma (t_1)$.  The companding of a signal $x: \Bbb R \rightarrow \Bbb R$ by $\gamma$ is the signal $[\gamma \circ  x](t) = \gamma(x(t))$.

Denote $u(t) = sinc(2\Omega t)$.  Find an explicit expression of $\mathcal{L}_\Omega (u)(t)$.
If $x \in \mathcal{B}_\Omega$ and $\gamma$ is monotone increasing, then $\gamma \circ x$ is generally not bandlimited.  In particular, $\mathcal{L}_\Omega (\gamma \circ x) \neq \gamma \circ x$.  Suppose $x_1, x_2 \in \mathcal{B}_\Omega$ and $\mathcal{L}_\Omega (\gamma \circ x_1) = (\gamma \circ x_2)$.  Show that $x_1 = x_2$ almost everywhere on $\Bbb R$.

My Attempt/Input

For the first part,  since the sinc function is a low pass filter in the time domain, are they essentially just asking for its corresponding rectangular function?

As for the second part, I know I start with the integral of the product of $(x_1 - x_2)$ with $(\gamma \circ x_1 - \gamma \circ x_2)$ but not sure how to go about it.


texts: How to reduce noise in plot of velocity calculated from GPS points?

texts:
I'm interested to see if it's possible to compute the velocity given only GPS data and so, I calculated the distance between GPS points and computed the velocity by dividing it by the time interval between the points. However, when this computed velocity is plotted against time, I obtain a very noisy plot.

What is the best way to reduce the noise and obtain a smooth plot?

I read about using Butterworth filters and specifically, Low Pass Filters to remove impossible changes in the velocity but unfortunately, I do not know which filter is most appropriate for this problem and how to configure them using the libraries in Python.

Code

import gpxpy
import pandas as pd
import numpy as np
from geopy.distance import vincenty, geodesic
import matplotlib.pyplot as plt

"Import GPS Data"
with open('my_run_001.gpx') as fh:
    gpx_file = gpxpy.parse(fh)
    segment = gpx_file.tracks[0].segments[0]
    coords = pd.DataFrame([
    {'lat': p.latitude,
     'lon': p.longitude,
     'ele': p.elevation,
     } for p in segment.points])

"Compute delta between timestamps"
times = pd.Series([p.time for p in segment.points], name='time')
dt = np.diff(times.values) / np.timedelta64(1, 's')

"Find distance between points using Vincenty and Geodesic methods"
vx = []
for i in range(len(coords.lat)-1):
        if(i<=2425):
            vincenty_distance = vincenty([coords.lat[i], coords.lon[i]],[coords.lat[i+1], coords.lon[i+1]]).meters
            vx.append(vincenty_distance)
print(vx)

vy = []
for i in range(len(coords.lat)-1):
        if(i<=2425):
            geodesic_distance = geodesic([coords.lat[i], coords.lon[i]],[coords.lat[i+1], coords.lon[i+1]]).meters
            vy.append(geodesic_distance)
print(vy)

"Compute and plot velocity"
velocity = vx/dt
time = [i for i in range(len(dt))]
plt.plot(velocity,time)
plt.xlabel('time')
plt.ylabel('velocity')
plt.title('Plot of Velocity vs Time')
plt.show()

Reference for GPX Data:
https://github.com/stevenvandorpe/testdata/blob/master/gps_coordinates/gpx/my_run_001.gpx


texts: How to use MFCC (or any other tool/method/algorithm) for speech verification


texts: Say I want to design a low pass filter with stop and pass band ripple constrained to $\epsilon$ and transition region $\delta$, what is the smallest FIR Filter length that suffices? Can you please provide a derivation?


texts: In signal averaging, will the noise be reduced if the noise is not Gaussian?

texts:
My understanding is that signal averaging works this way. If we take the average of the waveform, we get the average of the signal component (which is the magnitude of the signal) and the average of the noise component (which becomes closer to zero as number of samples are increased).

However, this is based on the assumption that the noise has zero mean and constant variance (i.e. white or Gaussian noise). What if the noise is not white? For example, what if the noise decreases as frequency increases? Will the noise still be averaged out by signal averaging?


texts: convolve to differentiate black and white colors

texts:
a figure for instance of size 500*500 has half above part with black and below half white should result in a white line where the
white meets the black (something like  a single line at line 250 with pixels as 255) on convolution with a matrix.
 I am trying to make a matrix, but not able to visualise how the matrix would be? can some one help me build the matrix for this


texts: How to implement separable bilateral filter?

texts:
I’m trying to optimize my naively implemented O(n^2) bilateral filter for 2D images. I googled and found a lot of theoretical explanations about the separate one. However, it seems there are things that should be taken special care of, regarding to the normalization.

I’m wondering if there are good references for especially the implementation?


texts: Understanding this Gabor Filter equation

texts:
I am working on a project where I need to implement road edge detection. This research paper suits my requirement in the best way, so I am studying it: http://imagine.enpc.fr/publications/papers/TIP10a.pdf

But I cannot understand the Gabor Filter equation they have used and also the set of parameter values they have used. Almost everywhere the Gabor Filter equation is different then theirs. If someone can explain, it would be great.


texts: Capturing the sampling rate from a basketball being dribbled

texts:
I'm taking an online image and signals class and the structure is absolutely horrible.

I'm wondering if you can provide me hints, or tips to solving the below question.  I'm not looking for an answer, because I'd actually like to learn something!  The structure of the class is just not conducive to learning as they just point us to online resources without any real "teaching."

  Consider a basketball being dribbled. If the height of the basketball can be described by a sine wave of maximum height 2h, average height h and minimum height 0, and the ball hits the ground once per second, how fast would a video camera have to sample the dribbling to extract its frequency? What happens to the frequency estimate if the sampling rate is too low?

So just thinking out loud... the ball is bouncing at a rate of $1\frac{bounce}{sec}$, which from my reading tells me the frequency is just the inverse of this, so $1\frac{sec}{bounce}$.

I don't understand, though, how to extract how fast a video camera would need to sample this to extract its frequency as it seems like I already have the frequency.


texts: Circular convolution of real signal N by N/2 sized complex IFFT

texts:
There are two related questions with good answers;
for calculating the forward FFT in N/2 values, and
calculating inverse FFT from N real values, now I'm in search for the missing link of packing the N/2+1 element complex signal X back to the N/2 element complex signal that it was derived in the first place for memory and arithmetic efficient inverse FFT.

Having calculated N/2+1 valued complex FFT from N real values (code from the first link):

x = [ 1 2 3 4 5 6 7 8 ]; n = 8; n2 = 4;
Z = fft(x(1:2:end) + i * x(2:2:end);
Ze = .5*( Z + conj([Z(1),Z(n2:-1:2)]));
Zo = -.5*j*( Z - conj([Z(1),Z(n2:-1:2)]));
X = [Ze,Ze(1)] + exp(-j*2*pi/n*(0:n2)).*[Zo,Zo(1)];

I have actually packed the real valued element X(n2+1) to imaginary part of X(1), saving some memory. Then I've point wise multiplied X with G representing the FFT of a same sized real signal g.

In order to finish the (circular) convolution of conv(x, g), I'd need to calculate the packed N/2 sized complex signal Z from (X.*G) for IFFT.

The first coefficient can be reverted as Z(1) = real(X(1)+X(n2+1))/2 + i*(imag(X(1)-X(n2+1)))/2;

As the other values X(2:n2-1) are originally produced from a bufferfly operation of
x(k) +- exp(j*k/N) * x(n2-n), I would hope that all the elements would be recoverable. The question is how.

EDIT

I need to recheck the formulas, but since for a pair A=Z(k+1), B=Z(n2+1-k):

                                         [ 1-s 1+s   c     c ] [Real(A)]
 [Real(A') Imag(A') Real(B') Imag(B')] = [ 1+s 1-s  -c    -c ]*[Imag(A)]
                                         [ -c   c    1-s -1-s] [Real(B)]
                                         [ -c   c   -1-s  1-s] [Imag(B)]

with invertible matrix, there really is a solution.


texts: Help in understanding from book expression of variance of an estimator : PRBS vs real valued input

texts:
The question is based on   Book : Fundamentals of Statistical Signal Processing by Steven Kay, Chapter 4 : Eq(4.21). The expression for the variance of the estimated coefficients when the input is PRN as

$$\textrm{Var}\left(\hat{h}_i\right)= \frac{\sigma_w^2}{Nr_{uu}[0]} \tag{1}$$
where $\sigma_w^2$ is the variance of the measurement noise; $\sigma_u^2$ is the variance of the input.

Let the model be:
$$x[n] = \sum_{i=1}^m h[i]u[n-i] + w[n] \tag{2}$$

where $u[\cdot]$ is the input process, and $w[n]$ is a zero mean white gaussian noise. $\sigma_{\rm input}^2$ is the variance of the input, $u[n]$ and   $\sigma_{\rm noise}^2$ is the variance of the measurement noise $w[n]$. The cross-correlation function $R_{x,u}[\cdot]$ between $x[\cdot]$
and $u[\cdot]$ is the periodic convolution between the sequence $h[\cdot]$ and the periodic autocorrelation function $R_{u,u}[\cdot]$

Performance is evaluated using CRLB of channel coefficients.

Can somebody please explain to clear my confusion about what the expression of  the variance of the estimator i.e, Cramer-Rao lower bound for the channel coefficients will be

(a) when $u[n]$ takes real values. Is it $\frac{m\sigma_{\rm noise}^2}{N \sigma_{\rm input}^2}$
(b) when $u[n]$ takes values from a finite symbol set $\{+1,-1\}$. Is it $\displaystyle \frac{m\sigma^2_{\rm noise}}{N}$ where $\sigma^2_u = 1$ and $r_{uu} =1 $

The expression in the book is for PRN sequence, but I don't quite understand what PRN sequence is. is it another term for symbolic values (not real values)? By PRN do we mean the values are ${+1,-1}$?

EDIT of the update based on the answer and offline discussions

Just to confirm if I am on the correct track. The general formula for $var(\mathbf{\Delta h}\mathbf{\Delta h^T}) =\frac{ \text{variance of measurement noise}}{\text{normalizing factor * autocorrelation of input}}$ = $\frac{\sigma^2}{D*\text{autocorre of input}} $ where $D = N * variance = N {\sigma^2_u }$.

Therefore, $var(\mathbf{\Delta h}\mathbf{\Delta h^T}) = \frac{\sigma^2}{N \sigma^2_u \sum u[n]u^*[n]}$ = $\frac{\sigma^2}{N(\sigma^2_u \sigma^{*2}_u)^2}$  [autocorrelation having complex conjugate term] ??

For +1/-1 sequence, this formula evaluates to $var(\mathbf{\Delta h}\mathbf{\Delta h^T}) = \frac{\sigma^2}{N\sigma^2_u} $

For QAM :$var(\mathbf{\Delta h}\mathbf{\Delta h^*}) = \frac{\sigma^2}{D (\sum u[n] u^*[n])}$ = $\frac{\sigma^2} { \big(N \sigma_u \sigma_u^*\big) \big(\sum u[n] u^*[n]\big)}$


texts:
Suppose I have a channel described by $h[n]$ or $H(z)$ over which I send a simple PAM2 signal. After the channel AWGN is added.

What is the best possible SNR with equalization?

As suggested in the comments I could assume a zero forcing or MMSE equalizer and e.g. for the former arrive at:

$$
\mathrm{SNR_{out}} = \mathrm{SNR_{in}} \frac{1}{\frac{2}{N} \sum_{k=0}^{N/2+1} \frac{1}{|H[k]|^2} }
$$

which matches well with my simulations. However, what I am looking for is the best theoretic bound, not assuming any particular equalization technique. For this derivation, it is assumed that I split the channel into small pieces of frequency bands (over which the channel is assumed constant and hence no equalization required) and equate the channel capacity to the channel capacity of an ideal AWGN channel. This results in:

$$
10\log_{10}(1+\mathrm{SNR_{out}}) = \frac{2}{N} \sum_{k=0}^{N/2-1} 10\log_{10}(1 + \mathrm{SNR}_k) \approx \mathrm{SNR_{out,dB}}
$$

and $\mathrm{SNR}_k = |H[k]|^2/\sigma^2/(N/2)$.

However, something is odd with this: Assuming a perfect channel, an input signal of unit power and $\sigma=0.001$, the SNR would be 60 dB. Executing the formula above for any lowpass filter (e.g. $N=1000$), the SNR is better than 60 dB because the low frequency SNRs are so high. For example, for low $k$, $|H[k]|\approx 1$ and hence $\mathrm{SNR}_k=1/\sigma^2/(N/2)=90\,\mathrm{dB}$. Even if they degrade at higher frequencies, the average is still more than 60 dB.


texts: Binomial Approximation of Gaussian Distribution

texts:
It is said that we may use the binomial coefficients ( a layer from Pascal's triangle) to approximate the 1-D Gaussian kernel with certain $\sigma$, where $\frac{n}{4} = \sigma$ and $n$ is the index of the layer.

This works really nice when we want to generate a gaussian quickly. But is there a way to prove this? Or just coincidence?

And how do we decide the variance of certain layer of Pascal's triangle? Say the third layer is [1 3 3 1] (consider [1 1] as the first layer), and it is used to approximate gaussian kernel of  $\sigma = \sqrt{\frac{3}{4}} = \frac{\sqrt{3}}{2}$. But how do we prove this?


texts: How to decode speaker gender from spoken transcript

texts:
I have 20 audio recordings (raw format) of people reciting the same ~50 word transcript. I would like to use audio signal analysis to decode speaker gender from audio recording.

Intuitively, it seems I need to align the audio signals and then cluster them. Assuming this is correct,

For alignment, would you recommend cross-correlation?
For clustering, would you recommend principal component analysis vs independent coordination analysis?

Thanks!


texts: Is there a method to speed up beam-forming if you only care about the total power in a given direction, or total power in frequency groups?  I've googled this, and can't find anything.  My intuition says that wouldn't make sense given that you need the power in each frequency to properly cancel out signals to create your beam.


texts: How does modulation work in simple language?

texts:
I am reading modulation from this site (am a beginner). In the end, they've given this example:

I am having trouble understanding how exactly they arrived at the two modulated results for AM and FM. I have attempted to understand it, and this is my attempt (I am assuming the $x$-axis is time axis):

Amplitude Modulation: At each time $t=t_0$, they have taken an increase factor as $k=\frac{\text{amplitude of modulating wave at } t_0}{\text{constant amplitude of carrier wave}}$. Hence, to obtain the modulated result at each instant, they've done $\text{Final displacement}=\text{Original displacement of carrier wave}\times(1+k)$. Negative amplitude of modulating wave implies decrease of carrier wave's displacement, and positive amplitude of modulating wave implies increase.
Frequency modulation: I'd say a similar increase factor is at work here, but instead, that factor is now affecting the frequency of the carrier wave instead of its amplitude.

I am sorry if these are beginner knowledge but I don't have any good book to study from. I checked Wikipedia for these two as well. My guess for amplitude modulation's working seems reasonably close to their mathematics, especially the $y(t)=[1+m(t)]\cdot c(t)$. But, I could not understand why an integral is employed in frequency modulation. What is it supposed to do?

I hope I have a reasonably detailed and specific question here. I am looking for simple language explanations. Thank you!


texts: Capacity of cascade binary symmetric channels

texts:
Let's imagine that we have interconnected in cascade $L$ binary symmetric channels each with the same transition probability $p(y|x) \in \{p, q=1-p\}$, where the output of each BSC is connected to the input of the next.

The overall channel is also a BSC channel, but what happens as $L \to \infty$?


texts: Frequency spectrum of a set of images in Matlab

texts:
I wish the compute the frequency distribution of a set of images. I basically am keen on finding out how the the frequency varies in the images.

I know I can use the 'fft2' function to compute the 2-dimensional Fourier Transform. I can do this for each image. But I am not sure how to obtain the isotropic frequency distribution of all the images. I want to find a method to compare the frequency distribution.

What is the best way to go about this problem? Thanks for your help.


texts: I am working on a radar simulation to calculate the range and the Doppler frequency of a target. I would like to build a range-Doppler map or range-Doppler matrix. I do not know the steps to develop the range-Doppler map or matrix. I hope there is someone out there kind enough to help me.


texts: Building a FIR filter from an arbitrary frequency-magnitude response curve (eg. Least Squares fitting)

texts:
I'm trying to create a FIR filter from a magnitude equation, where my starting equation provides the magnitude (amplitude) between 0 and 1 for any given frequency in Hz.

I posted the magnitude equations I would ideally like to convert into an FIR filter here:

https://math.stackexchange.com/questions/3666215/how-to-do-an-inverse-fourier-transform-of-this-equation

It seems there are more than one ways to get the result, but as I have never made a FIR filter before I'm not sure of the best way.

Option #1: Integral-Based Solution

One suggestion I was told was that I need to take the magnitude equation, do an Inverse Fourier Transform on it (which depends on the integrals), and then from that equation I can somehow construct a FIR filter.

But the integrals involve crazy operations like "Ei" and "erf" that probably aren't practical. So to do that, I would need to make a polynomial line of best fit for the magnitude equation and then use that for the reverse Fourier and FIR build.

Option #2: Least Squares Fitting

Alternatively, I read here a different suggestion for what I think is essentially the same problem:

Design a linear-phase FIR filter approximating the magnitude of a given IIR filter

That shares instructions on how to build a FIR filter to copy a IIR filter. If I understand, they used the "freqz" operation in Matlab to create a vector of frequency-vs-magnitude data points from the IIR filter. Those points were then fed into a least squares FIR filter design called "lslevin.m" which would then compute the FIR coefficients (or provide some output needed to get the coefficients).

If I'm reading that correctly, that approach would entirely solve my problem. I wouldn't even need the "freqz" operation, since I already have the amplitude/magnitudes at every frequency. I can just input those directly to the least squares FIR filter algorithm. It would also be linear phase which would be ideal.

Am I understanding this correctly, and if so, will that give me what I need?

Option #3: Directly Mapping Frequency-Amplitudes to FIR Bins

As a third option, I was recently told another approach:

  If you can get a value for the desired magnitude at any given
  frequency, the easiest approach is to sample the spectrum: simply
  compute an array of desired magnitudes with frequencies matching the
  FFT bin-frequencies for an FFT of your array size. No integration
  required. Essentially you just build the array that you would like to
  get out of FFT if you had the perfect filter.

  Then you can take IFFT to get a (periodic) signal that matches the
  desired spectrum at the compute bin-frequencies exactly. At this
  point, you want to apply some window function (with basically the same
  considerations as for any other windowed filter design), so you get a
  single IR (rather than a cycle of a periodic signal). This will smooth
  out the response slightly, so it won't be exact anymore, but assuming
  your original magnitude is reasonably smooth with respect to the
  length of the filter (ie. the frequency samples we took don't vary
  widely from one bin to the next) the windowed approximation is usually
  decent and you can make it better by computing a longer filter (by
  sampling more points and computing a longer IFFT).

  This type of design isn't "optimal" in any sense, but it's nice and
  simple and it works as long as you can tell the desired magnitude at
  any given frequency.

Is that going to be the same or different from the least squares method and in what ways? Which approach will be cheaper or more accurate?


texts: Dynamic compressor - ratio in logarithmic scale problem

texts:
I want to use decibels to describe compression ratio. So for example ratio 4:1 means that every 4 input decibels above threshold causes raise of output only 1 decibel. And I also want ratio to be constant on whole range above threshold. So for 4:1, if input is 8 decibels above I want output raise 2 decibels.

But decibels are in logarithmic scale, so when I draw linear graphical representation (dB in logarithmic scale) of my compressor characteristic it is clear that my ratio is not constant, and looks like that:

So when I convert my graph to be logarithmic (dB on linear scale), then my ratio section is curved like that:

How to make my ratio which is described in decibels, to make it constant?

My ratio function is like that now:

$o = \left( \frac1r + \frac { t ( r - 1 ) } { g} \right) \cdot {i}$

where:

$r$ - ratio
$t$ - threshold
$g$ - input gain
$i$ - input
$o$ - output

I suppose I need to modify that equation somehow, but have no idea how?


texts: How to use Principal component Analysis(PCA) to extract feature from images

texts: How can use principal component Analysis to extract feature from image that is been acquired by the camera?


texts: How to correct for inperfect 90 degree phase shift before doing IQ demodulation?

texts:
I want to sample two signals, S and R and later do IQ demodulation on these.

I am multiplying S with R and I also want to multiply S with a 90 degree phase shifted version of R by shifting the samples in R so I get a 90 degree phase shift.
The problem I encounter with this is that unless I have a sampling rate that is 4*n of the sine signal frequency (where n is an integer) I wont be able to phase shift the R signal by 90 degrees. And this is my case as the sampling rate and the signal frequency are not in this multiple of each other. So let's say I am able to do a 82 degree phase shift. Is it then possible to correct for this somehow for the total number of periods I choose to sample?

Does it at all give any additional information when doing IQ demodulation when I phase shift the reference signal by shifting the samples to get a 90 degree phase shift?

EDIT:
Measuring range is 3k->300k Hz. S is a single frequency sine wave and R a square wave.


texts: How the Fourier transform of a cosine signal is existed?

texts:
As I know, if an aperiodic continuous-time signal be absolutely integrable, i.e.

$$\int\limits_{-\infty}^\infty \vert x(t) \vert \ dt \ < \ \infty $$

its Fourier transform is existed.

Also, the Fourier transform of $\cos(\omega_0 t)$ is $\pi(\delta(\omega-\omega_0)+\delta(\omega+\omega_0))$.

Now, my question is that: how the Fourier transform of a cosine signal is the above relation, while, this signal is not integrable !?


texts: Looking for project ideas to match my interests

texts:
I have a Bachelor of Science in Electrical Engineering, concentrating in VLSI, and I am currently in the process of switching fields to go into Physics. I love physics, and mathematics. I like pretty problems that need subtle insight to solve, which is why I'm moving from engineering to physics. Even though the prettiness of a problem may be subjective, I like the "feeling" I get when I'm doing physics, which was totally absent when I was working in VLSI.

That said, before I make the transition complete, I would like to learn about other areas of electrical engineering that may be closer in spirit to physics and applied mathematics. I have a vague idea that signal processing and imaging are areas that may be quite different from VLSI. Are there any others? Which area should I dive into to get a feel for a different kind of electrical engineering? (I have matlab on my computer and I would like to make use of it).

I especially like to use mathematics on real world problems, and the reason I didn't enjoy VLSI too much is because it is full of boolean algebra, which is somewhat boring and non-visual. It would be helpful if, along with your topic suggestion, you could tell me what areas of mathematics it would involve. Thanks in advance.

PS - I don't have enough points to add "projects" and "careers" tag, so it would be nice if someone could do that for me.


texts:
I have a 2D uniform distribution. I would like to assign probability-weights in the distribution, according to the standard deviation to convert the distribution into a 2D gaussian.

I know how to do it in the 1D case, by splitting the points from -1 to 1 sigma, etc and assigning the probability as a weight but I haven't found a way to combine the probabilities from the 2 planes (eg at 1 sigma in x and 6 sigma in y)


texts: Frequency response of $\mathrm{sinc}[n]$

texts: In this image the frequency response of a discrete time filter given as $h[n]$. Can someone explain how the magnitude of the frequency response is found ?


texts: As the title suggests, I'm a bit of a dummy, and utterly perplexed by the concept of OFDM, overlapping the carriers at the clock nulls and somehow magically not creating an unusable amount of cross carrier interference. What's the science (or sorcery, as is so often the case with wireless communications) behind this concept?


texts: Is sum of period samples in the DSP domain?

texts:
Following program outputs sum of samples of signal's period. Values in program are:

Sample rate 96 ksamples/sec.
First frequency (fundamental, 1st harmonic) 96 Hz.
Second frequency (2nd harmonic) 192 Hz.
n = 1 to 1000, representing one (the first) period of the signal.

Output (sum of period's samples) should be zero. Actually is 18.4062, apparently due to round off errors. In general, when samples are multiple of fundamental's (in this example: 2000, 3000, ... samples), sum is least. Other sums are much greater. So first harmonic is represented by the first least sum.
I have some question about, but first of all, I have to ask whether this process belongs to DSP domain.

// Outputs sum of input values.

#include <iostream>
#include "math.h"

int main()
{
//Unchanged variables.
float pi = 3.141592653589793; //pure number.
int n = 0; // sample.
float xn = 0; //pure number.
float xn_cos = 0; //pure number.
float xn_sin = 0; //pure number.
float sum = 0;

//Sampling frequency and samples of segment.
int samplFreq = 96000; // sample/second.

// 1st existing sinusoidal.
float ampl_1 = 70000; //pure number.
float existFreq_1 = 96; // Hz.
float phase_1 = 0.67 * pi; // rad.
float unitAngle_1 = (existFreq_1 / samplFreq) * (2 * pi); // rad/sample.

// 2nd existing sinusoidal.
float ampl_2 = 600000; // pure number.
float existFreq_2 = 192; // Hz.
float phase_2 = -0.37 * pi; // rad.
float unitAngle_2 = (existFreq_2 / samplFreq) * (2 * pi); // rad/sample.

for (n = 1; n <= 1000; ++n)
{
xn = ampl_1 * sin(n * unitAngle_1 + phase_1)
   + ampl_2 * sin(n * unitAngle_2 + phase_2);
sum += xn;
}
 std::cout << sum;
return 0;
}


texts: How to add awgn noise to a signal in Fourier domain for given SNR

texts:
I want to know the equations required to add awgn noise to a signal in Fourier domain for different SNR values. I know the procedure in time domain but not able to do the same in  frequency domain for the signal $x(t) = e^{2 \pi j f t}$ .

Thank you


texts: How to determine a quantization table for image compression with DCT?

texts: The quantization table is given on the JPEG Wiki page. How was this table derived? I'm currently doing a project where I have to come up with custom quantization table for an image, but I don't know how to begin. I figure if I learn how the JPEG table was derived, I might come up with a semi-original idea.


texts: Estimate changing time lag between signals

texts:
Suppose I have two timeseries $x_1(t)$ and $x_2(t)$, shown in the image that I drew below. They look almost identical in general form, except some features are shifted slightly in time from one series to the other by an about $\delta t$. Sometimes they are measured first in $x_1$, and sometimes in $x_2$, so sometimes $\delta t$ is positive and sometimes negative. The change in lag between features is random, but constrained to be of a small range so that shifts never overlap and cancel.

I want to know, what is the mean time lag between the two signals?

Even better, would be to know the distribution of time lags so I could estimate the mean, variance and range.

Does anyone have ideas or suggestions for how to do this?

My own thoughts so far are: I can imagine calculating the cross correlation between signals $x_1$ and $x_2$. However, I would expect the result to be strong correlation at zero time lag, because the time lags can be both positive and negative, so that the average lag is zero. However, the width/stretching of the zero peak, must be related to the average time lag, however, I can't figure out how exactly at the moment.

Another thought I have had is to create a moving correlation estimator. In a similar way to how wavelet analysis can be used to estimate how the power of certain frequency components changes as a function of time. I could develop a function that measures the lag correlation as a function of time by breaking one of the signals into smaller chunks and convolving it across the second signal while stepping along.

All suggestions appreciated.


texts: How to Remove a Glare / Clipped Brightness from an Image?

texts:
I have an image

Is there any way of removing the bright white spots ? Please help thanks

Edit:

After operating with gaussian and then displaying using imagesc get the following output which clearly shows the bright red spots How do i get rid of them

Red Channel :

Green channel:

Blue channel:

Edit 2:

Defect detection using Gabor filter

Its Histogram :

How to calculate its appropriate threshold adaptivily.?


texts: How does one quantify how "white" some noise is? Are there any statistical measures, or any other measures (FFTs for example) that can quantify how close to white noise a particular sample is?


texts: How can I compute a log-spaced power spectrum?

texts:
I would like to compute a power spectrum in which the frequencies are logarithmically spaced.

In Welch's method there is a trade-off between the frequency resolution of the resulting power spectrum and the number of averages (i.e. error in the result).  I would like this trade-off to be dynamic, i.e. do fewer averages for low-frequency points in order to have a finer resolution at low frequency.

Is there a standard way to do this?

I suppose one way would be to initially do pwelch with a very high resolution (low number of averages), and then rebin the resulting spectrum using logarithmic binning.


texts:
After applying STFT to a signal, you typically need to convert the frequencies to the Mel scale. Typically the frequency values range from $0$ to $N/2$, where $N$ is the width of each sliding window.
I have read so many articles about Mel Spectrogram. Basically they all say to convert frequencies to Mel Scale in the following way:

Partition the Hz scale (i.e. partition a sequence of numbers ranging from $0$ to $N/2$). In this way we will have a number of bins. This number is for example indicated in librosa by "n_mel". These bins are called frequency bands.

Covert each bins into Mel Scale using the formula $2595*log(1+f/700).$

Application of triangular filters for each bins to capture the energy at each frequency band and approximate the spectrum shape.

It seems that when this is buried in the articles, nobody really knows why these operations are carried out. I find it difficult to fully understand:

Why divide the Hz scale into bins?

What exactly is meant by a frequency band?

Why do we apply triangular filters?

What exactly is a triangular filter? How is it defined mathematically and from what concept?

Can anyone explain exactly these things to me or recommend a book where these steps are explained in detail? There seems to be no book that explains these concepts exactly.


texts: How to set covariance for Bivariate Logistic Distribution

texts:
This is the logistic distribution of single random variable (taken from Wikipedia).
x = random variable
mu = mean of all random variables
s = variance.

Now, I want to do a Bivariate logistic distribution (having two random variables x1 and x2). My dataset is going to be image pixel values!
When I find the covariance of two random variables, it turns out to be a 2 x 2 square matrix but I need a single number! How to actually compute a bivariate model?


texts: In MATLAB, latency at the start of the output of a filter can be handled by discarding those bits and starting the signal where the latency ends. but how can the garbage value at the end be handled?


texts: How to create a band limited signal of sine waves that is nearly uniform distributed

texts:
I would like to create a signal that is nearly uniform distributed (as depicted in Figure 1). It must consist of some single sine waves (e. g. 400 Hz, 430 Hz, 500 Hz) or a random band limited signal (e g. 495 to 500 Hz as depicted in Figure 2).
I expiremented with some parameters but I didn't get a good result. Does anyone know an analytical mathematical description or a kind of "thumb rule" for creating such signals?
Additionally I would prefer a signal that is as harmonic (in time domain) as possible (one single frequency would be the best - but of course not possible ;-) ). The signal is faded in and out with an raised cosine, because it's repeated periodically by a signal generator and I want to avoid steps in my signal.

To answer the "why" question:
I have an nonlinear system which I want to correct by avaraging (see picture 3). Usually I would get the red point which differs from the linear "true" value represented by the blue dotted line. The magenta colored dots are createt by a sine-wave and the big blue dot is gained through the avaraging of those magenta dots. This works whith a sine-wave signal, but since a sine-wave is not uniform distributet it is not perfect and the big blue dot differs from the big green dot representing the true value.
I tried to combine three sinusoids with different amplitudes. The result was not to bad but its a trial and error way. I would prefer an analytical way if there is any.


texts: Cross correlation to compute delay between two lines does not work

texts:
I have zero experience with signal processing, and I am stuck in what I believe to be a very simple problem.
I am trying to use the xcorr in matlab to find delay between two signals.
The signals are basically two time-series that look like two lines:

I am using the function xcorr in matlab. If I  try to run

[acor,lag] = xcorr(Y,X);
[~,I] = max(abs(acor));
lagDiff = lag(I);
timeDiff = lagDiff/Fs

where Y and X are the two lines I get a delay (timeDiff) equal to zero. Which is obviously not true. But if I run the same code on two delayed sinusoids like these:

I get the correct delay (-0.5).

I don't get why with two lines I can't get the right delay. What am I missing?

Here the entire code:

example_sig = 'sinusoid';
% example_sig = 'line';
switch example_sig
    case 'sinusoid'

        Fs = 10;

        t1 = (0:100-1)/Fs;
        t2 = (0:100-1)/Fs;

        X = sin(t1);
        Y= sin(t2+0.5);

    case 'line'
        Fs = 10;

        t1 = (0:100-1)/Fs;
        t2 = (0:100-1)/Fs;

        X = 1 + 4*t1;
        Y = 1 + 4*(t2-2);

end

[acor,lag] = xcorr(Y,X);

[~,I] = max(abs(acor));
lagDiff = lag(I);
timeDiff = lagDiff/Fs
figure
plot(lag,acor)
a3 = gca;
% a3.XTick = sort([-3000:1000:3000 lagDiff]);

% figure, plot(X),hold on, plot(Y), plot(inc_surf(indx0-100+delay+1:indx))
figure, plot(X),hold on, plot(Y)

Thank you in advance!


texts: What is the capacity of MIMO channels with deterministic interference plus random noise

texts:
It should be obvious that if there is no interference but only zero-mean random noise, as it is discussed in many textbooks. When there is known deterministic interference, what is the capacity now?

In details, the discrete channel model is as follows:
$$\mathbf{y}(n) = \mathbf{H}\mathbf{x}(n) + \mathbf{i}(n) +\mathbf{n}(n),$$
where $\mathbf{y}(n)$ is the received signal vector at time index $n$, $\mathbf{x}(n)$ $\mathbf{i}(n)$ $\mathbf{n}(n)$ are the transmitted waveform, interference signal vector and  the noise for time $n$, $\mathbf{H}$ is the channel which is known and does not change. I believe the answer should be $\log|\mathbf{I}+\mathbf{R}_n^{-1}\mathbf{H}\mathbf{R}_{x}\mathbf{H}^H|$, where $\mathbf{R}_n$ is the covariance of the noise. The effect of interference is directly removed from the receiver. Is this correct?

Another problem is what if the values of the interference are unknown to the receiver and transmitter but they only know the value for any time index is deterministic? What can we say about the capacity? What will the receiver and transmitter do in practice? will the receiver try to estimate the interference?


texts: Applying filter in scipy.signal: Use lfilter or filtfilt?

texts:
I saw in a SO thread a suggestion to use filtfilt which performs backwards/forwards filtering instead of lfilter.

What is the motivation for using one against the other technique?


texts: Automatic detection of noise-only segments in audio

texts:
This is my first question for this community. My connection to DSP comes via machine learning/deep learning, and I am working in the Python ecosystem.
As a preprocessing step to audio classification, I am looking for a simple method to reduce noise.
Promising noise reduction methods such as 1 expect a noise-only sample as input, then are able to subtract noise. (The approach is also described in an answer of 2)
Getting a noise sample manually is doable for denoising a few recordings. However, it does not scale to processing thousands of recordings with different noise types and volumes.
Can you recommend a method for automatically obtaining a noise sample from every recording? Alternatively, denoising methods that do not require a noise sample as input?


texts: How to interpret frequency response of moving average system in discrete time signal processing?

texts:
Excerpt from Discrete Time Signal Processing by Alan Oppenheim:

The text says this can be considered as an approximation of a Low Pass Filter. A low pass filter in continuous signal system is something that would block frequencies above a cutoff. But here in the discrete system, how is this to be understood? In a discrete time system, "frequency" is just angle/sample. Does the picture above mean "the system allows samples taken at the rate (0 to $2\pi/5$) / sample and blocks the rest" ?
EDIT:
Is it like this: say there is signal with a frequency range 20Hz to 50Hz. The sampling frequency in 100Hz. The lower frequency components get smaller $\omega$ and for higher frequency (50Hz) it gets close to $\pi$. If I have a low pass filter, it would block out those samples with large $\omega$. And this functionality now resembles a continuous time low pass filter. Is this a correct interpretation?


texts:
From the definition I know:

$$|\sum_{n=-\infty}^{+\infty}x[n] \cdot z^{-n}| < \infty\space\space\space(1)$$

Is there any sequence of x[n] which can not be written as

$$x[n] = y[n] \cdot u[an-b]\space,\space\space\space a,b \in \mathbb{Z}$$
(where the dot means a multiplication and $u[k]$ means the discrete step function. In other words, x[n] is an infinity sequence)

but do satisfy the definition in (1)?


texts:
I'm working in MATLAB to try to take pristine APT satellite images (two greyscale images of the earth taken at different wavelengths) and turn them into one false-color image. I also have a second image generated by the groundstation's telemetry info about the satellite pass that shows landmasses.
,
I only have two wavelengths, so a true false coloration is is not possible (I think). I was doing to try to use the map to segment the image into land vs. sea, segment that further into clouds vs land via Otsu's method, and simply color the areas green, blue or white with an saturation/value determined by the two channels respectively.
I'm having trouble finding resources on how this is already done, besides some vague advice found on an existing APT decoding software (https://noaa-apt.mbernardi.com.ar/how-it-works.html).
Does anybody have an idea on how this is usually done, or have more information?


texts:
I was reading this article to understand the fft - JACK SCHAEDLER - A WALKTHROUGH OF THE DFT - STEP BY STEP.
I understand that:

the fft takes a block (256 or 512) of the signal, creates a sinusoidal and cosineidal wave of frequency "f" and multiplies each sample for each sample of the signal to decompose,
add the value of all the samples of the cosine and sine wave product, if it gives greater than 0 it means that the frequency wave "f" is present in the signal
the result of the sum of each product wave gives a complex number

now what I want to know what is the next formula to rebuild the signal, ie an inverse fft


texts: GNU Radio | Grouping just 24 consecutive soft bits from a repeating tagged stream onto 3 bytes, starting from a specified tag

texts:
A vector source [0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1] produces repeatedly a tagged stream with one tag, my_tag (offset: 2), in blue, I want to group 24 consecutive bits onto 3 bytes, starting from my_tag and send them to a file, out.dat.
out.dat would be then filled with consecutive 0x01's: 0x01 0x01 0x01 0x01 0x01 0x01 ...

I am adding a flowgraph (GR-v3.8) that does everything except the part I am looking for. How can I change this FG to achieve the goal?


texts: What is difference between outputs of Fourier transform and Fourier series of a periodic square waveform?

texts:
We can use Fourier transform of an aperiodic signal and Fourier series of periodic signal. But we can use Fourier transform formula for periodic function also.

Now, let us consider a periodic square wave with fundamental period $T$ . Then I want to ask is

  What is difference between the outputs of Fourier transform and Fourier series of a periodic square waveform?


texts: Does the sound volume affects the MP3 file size?

texts:
Let's say I have an X music track in some lossless format (wav?).

If I convert it to MP3 format with its original volume and get the file "A.mp3".

Then I edit the lossless source and reduce the volume by 50% (in some way without affecting its quality) and convert it to MP3 and get the file "B.mp3".

Will be any size difference between "A.mp3" and "B.mp3"?

Does the volume reduction cause a loss of information?


texts: Detecting multi-path propagation when one acoustic signal is dominant

texts:
I am sending an acoustic signal from a source to a receiver where there are limited number of paths the signal can travel. I want to detect if there has been multipath propagation or not when one path is the dominant line of sight path. Based on this link - Cross-correlation peaks in acoustic multi-path conditions , it seems like cross-correlation and checking for multiple peaks is an option, but it does not work when there is Fading (one dominant signal and others being attenuated).

It seems like this sort of Fading is called Rician Fading - however, I am not sure how to use this to detect if their has been multipath propagation or not. How to use the source and receiver signals to know if multipath propagation happened or not. (Also, I cannot use time of arrival of chirp pulses since the difference between time of arrivals of different paths is less than the chirp width)


texts: Is it possible to add some kind of noise to a non stationary (having unit root) signals to make them stationary?

texts:
I am working on time-series signals for which I need to fit a model (like MVAR) that could describe the process satisfactorily. However, my signal has a unit root and is highly non-stationary because of which it doesn't meet the required stationarity criteria for MVAR. With highly non-stationary, I mean it is of differencing order of 7 which makes the interpretation difficult. So, I was wondering if there is any way to make the signals stationary by adding some noise (preferably white) of some specified frequency range.
Thank you!


texts: New member here.  Recently got hired into a mid level EE position.  Have a BSEE but performed more radar performance analysis at a higher system level previously.  In my new group we're doing a lot of digital signal processing design, validation and verification.  I have a strong background with Matlab and am looking for educational resources on pulse doppler, pulse compression, a/d converters, FPGA design using verilog.  Appreciate any input that anyone can provide.  Thanks guys and process on.


texts: Can we use discrete cosine transform with imaginary part

texts:
I have been reading about the difference between the use of iFFT and iDCT with OFDM.

What I understood that iDCT can only be used with one phase modulated symbol which is PAM/BPSK modulation.

It means for example 0 and 1 can be mapped into -1 and 1, respectively before using the iDCT.

Can  we map the 0 and 1 into -j and j? I mean in the imaginary direction. Then,  use the iDCT in the place of iFFT at the same usual way? Does that give sense? Is is the same of normal case when mapping the modulated symbols into the real parts ?


texts: is it possible to matching b / w images without feature extraction steps? if possible which algorithm may be more suitable?

texts:
these are example of my image

i have a 245 images similar to it ,i obtained these b/w images after preprocessing stage , i want to use them for recognition persons(not verification) in matlab. can i performe matching algorithm on these image after division into 2 group(one for training and the second for testing) without implementing feature extraction algorithm such as PCA,ICA,.....?

if it is possible , which are the suitable matching algorithms that are preferable for this purpose , especially i need to use matlab ?

any help please?really i need your opinions and consultations.

thanks in advance


texts: Geometric representation of a signal using basis functions

texts:
I'm trying to solve the following problem where I need to express $x(t)$ in terms of the given $φ_i(t)$ functions. (It is proven that the $φ_i(t)$ functions are orthonormal).:

Here's what I tried:
In order to find the coefficients, the following definition of the geometric representation of a signal was used. (Simon Hagkin - Communication Systems)

Using equation 5.5 above
$$ x(t) = \sum_{j=1}^{3} x_{j} φ_j(t) $$
Referring to the equation 5.6 above, I have tried to find coefficients ($x_{j}$) of each basis function. However, all three coefficients became zero.
This is how it was solved for $x_{1} $:
$$ x_{1} =\int_{0}^{4} {x(t) φ_1(t)} dt $$
$$ x_{1}  =\int_{0}^{1} {-1 . (1/2)} dt +\int_{1}^{2} {1 . (1/2)} dt +  \int_{2}^{3} {1 . (-1/2)} dt + \int_{3}^{4} {-1 . (-1/2)} dt$$
$$ x_{1} = 0 $$
for $x_{2} $
$$ x_{2} =\int_{0}^{4} {x(t) φ_2(t)} dt $$
$$ x_{2}  =\int_{0}^{1} {-1 . (1/2)} dt +\int_{1}^{3} {1 . (1/2)} dt +  \int_{3}^{4} {-1 . (1/2)} dt $$
$$ x_{2} = 0 $$
for $x_{3} $
$$ x_{3} =\int_{0}^{4} {x(t) φ_3(t)} dt $$
$$ x_{3}  =\int_{0}^{1} {-1 . (1/2)} dt +\int_{1}^{2} {1 . (-1/2)} dt +  \int_{2}^{3} {1 . (1/2)} dt + \int_{3}^{4} {-1 . (-1/2)} dt$$
$$ x_{3} = 0 $$
What am I doing wrong?


texts: Can somebody help me with some very basic questions about the fundamentals of information theory?

texts:
I just started to study information content of the source and there are some very fundamental topics I am not really clear on. These might be a long question or a series of questions. Please help me.

Relationship between uncertainty and information:
Information is related to uncertainty or surprise. What is the nature of this relationship? Is there any difference between uncertainty and information? Before the information reaches the destination, there is an uncertainty at the destination about which signal would appear. When the information reaches the destination, there is no uncertainty left, right? So, information is literally killing or eliminating the uncertainty. Is my concept about information correct?
Information content of an improbable or unlikely message:
The relationship between the probability of a message and information content is $I=\log_2(1/P)$, right? So If the probability of occurrence of a symbol is one, then the destination is always sure that that definite symbol will occur. So there is no uncertainty about the message. In other way, when the message reaches the server, there is no surprise. So the information content of that symbol is zero. Mathematically it is zero too. That is, the source didn't really need to transmit that message as the destination knew what message was coming beforehand, correct?

But what would be the information content of a message with probability zero? I know mathematically it is infinity. But what would be the physical interpretation? And the probability of the message to occur is zero, meaning that symbol is never going to be generated. So the destination is never waiting for that symbol to occur. So in that case, isn't the information content of that message supposed to be zero?

That is going to be my first question. I might need to post a few questions later. Thanks in advance.


texts: What are the rough steps in obtaining and processing an image from an infrared camera?

texts:
I have asked the same question in stackoverflow, but since I am not getting any responses , I am going to ask it again here.

My project is to design an interface between an IR camera (Xenics XTM-640) and an ARM/FPGA unit and then process the data to make some comprehensible image.

At the moment I am working on creating timing waveforms to control sensor and capture of frames and I am planning on how to go on from there onwards.

From what I can see there is number operations which can be performed to make the image clearer. Terms I have came about such as:

quantisation
convolution
Gaussian filterring
contrast enhancment
noise cleaning/noise smoothing
neighbourhood operation
normalisation
edge crispening

What is the difference between preprocessing and processing?
Is there a preferred order to performing this steps?
Are some absolutely necessary, while others not so much and can be skipped?
How would this differ between processing normal light vs IR radiation?

Ideally I've been looking for a flowchart/diagram that shows all (or some) of the stages from capturing IR radiation to displaying false colour image on a screen.

In the "Digital Image Processing" by William K. Pratt it seems the chapters are broken down into

CONTINUOUS IMAGE CHARACTERIZATION
DIGITAL IMAGE CHARACTERIZATION
DISCRETE TWO-DIMENSIONAL LINEAR PROCESSING
IMAGE IMPROVEMENT
IMAGE ANALYSIS

Is that roughly the correct chronologically description of the whole process?


texts: Using an error prediction filter for filtering a semi-known signal

texts:
I'm trying to wrap my head around the proper use of a Wiener or error-prediction filter for filtering data. It seems to me that it is only a whitening filter, so how is it used when the data you want to recover isn't an AWGN signal?

For instance, I have a signal that has several distint interfering signals - I can see them on a PSD, but I don't know that they are a) stationary and b) what properties they have. I can use a method like Yule-Walker equations to recover the AR model for the whole signal, but in this case I only want to recover the model of the interfering signals, not the portion I want to recover.

I tried implementing an adaptive LMS notch filter, with the reference signal being a single sinewave, but this turned out to me much too narrow and didn't track frequency changes in the signal very well.

I guess basically my question is this, if I'm using an error prediction filter to filter real data, then how do I separate the data portion from the noise portion? In other words, I don't want to whiten the whole signal, only the noise portion. What am I missing?


texts:
I am trying to implement a butterworth bandpass filter
My filter requirement is Fs= 500Hz, Fc1=0.4Hz, Fc2=4Hz, Oreder=2.

Below is the code which is implemented on 16bit-mcu and is called for every new sample
The coefficients are calculated from http://www-users.cs.york.ac.uk/~fisher/mkfilter

static int32_t xv[4+1], yv[4+1];
int32_t my_filter(int32_t sample)
{
    xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4];
    xv[4] = sample / 1.989695029e+03;
    yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3]; yv[3] = yv[4];
    yv[4] = (xv[0] + xv[4]) - 2 * xv[2]
                 + ( -0.9380260977 * yv[0]) + (  3.8116138294 * yv[1])
                 + ( -5.8091337665 * yv[2]) + (  3.9355459731 * yv[3]);
    return yv[4];
}

This is the output of code
What i want is output similar to scipy_filter.


texts: Minimum bit-width for fixed point FFT outputs

texts:
I was wondering if there is a formula to determine what the best case (minimum) bit-width should be for the imaginary and real outputs of an fixed-point FFT, assuming an input bit width of $M$ ($M$ bits for the real and $M$ bits for the imaginary portion of the input). Best case meaning there is no possibility of overflow, and I maintain the same number of fractional bits as the input.

I can sort of see that for a $N$-point FFT, there will be $\log_2(N)$ butterfly "passes" or "columns", and always the twiddles have complex magnitude of $1.0$, so a simple assumption would be: $M + \log_2(N)$. I think this is treating it as a worst-case adder assumption. But I know that the twiddles vary a lot after the first column, so this is probably not "best case" analysis.


texts: Low recognition rates using GMM for image classification

texts:
I want to use GMM for image classification.
So, I have extracted SIFT features from each image in the corpus.
Then, I apply EM algorithm to learn GMM parameters (I have coded it in matlab).
I get very low Recognition rates for unseen images when I test the model on larger number of classes (>=4).
Who can explain this result ?  Thanks.


texts:
Is it possible to read a JPEG file and skip parts that are corrupt?  I have three corrupt JPEG files and I can detect the first corrupt block, but can I skip it and continue with the next block?

I can already stop and convert the blocks I've processed so far, but I would like to recover as much as I can.  This is not a JPEG in a sequence, so skipping all the remaining blocks wouldn't help.


texts: Why Does the DFT Assume the Transformed Signal Is Periodic?

texts:
In many signal processing books, it is claimed that the DFT assumes the transformed signal to be periodic (and that this is the reason why spectral leakage for example may occur).

Now, if you look at the definition of the DFT, there is simply no that kind of assumption. However, in the Wikipedia article about the discrete-time Fourier transform (DTFT), it is stated that

  When the input data sequence $x[n]$ is $N$-periodic, Eq.2 can be computationally reduced to a discrete Fourier transform (DFT)

So, does this assumption stems from the DTFT?
Actually, when calculating the DFT, am I in fact calculating the DTFT with the assumption that the signal is periodic?


texts:
I'm attempting to beamform some data which has signals coming from all directions in a 180 degree range.

I found an example of using the phased array toolbox, in MATLAB, to beamform a signal in https://uk.mathworks.com/help/phased/examples/conventional-and-adaptive-beamformers.html however, when I added a second signal from a different direction, the results aren't what I would expect.

If the two signals are coming from directions which are symmetrical about 90 degrees, i.e. 30 and 150 or 70 and 110, the beam forming algorithm cannot separate them. Is there a way of suppressing the signal coming from the other direction?

The code below is an example of what I mean where two signals are incoming from 30 and 150 degrees and then the beamforming algorithm is trying to isolate the signal from 30 degrees.

clear;
clc;
close;
t = 0:0.001:0.3;                % Time, sampling frequency is 1kHz
s = zeros(size(t));
s = s(:);                       % Signal in column vector
s(201:205) = s(201:205) + 1;    % Define the pulse
s_2 = zeros(size(t));
s_2 = s_2(:);                       % Signal in column vector
s_2(41:47) = s_2(41:47) + 1;    % Define the pulse
figure(1)
plot(t,s, t, s_2);
title('Pulse');xlabel('Time (s)');ylabel('Amplitude (V)');
carrierFreq = 30e6;
wavelength = physconst('LightSpeed')/carrierFreq;
ula = phased.ULA('NumElements',10,'ElementSpacing',wavelength/2);
ula.Element.FrequencyRange = [90e5 110e6];
inputAngle = [30; 0];
x = collectPlaneWave(ula,s,inputAngle,carrierFreq);
inputAngle2 = [150; 0];
x2 = collectPlaneWave(ula,s_2,inputAngle2,carrierFreq);
rs = RandStream.create('mt19937ar','Seed',2008);
noisePwr = .5;   % noise power
noise = sqrt(noisePwr/2)*(randn(rs,size(x))+1i*randn(rs,size(x)));
rxSignal = x + x2 + noise;
figure()
subplot(211);
plot(t,abs(rxSignal(:,1)));axis tight;
title('Pulse at Antenna 1');xlabel('Time (s)');ylabel('Magnitude (V)');
subplot(212);
plot(t,abs(rxSignal(:,2)));axis tight;
title('Pulse at Antenna 2');xlabel('Time (s)');ylabel('Magnitude (V)');
psbeamformer = phased.PhaseShiftBeamformer('SensorArray',ula,...
                'OperatingFrequency',carrierFreq,'Direction',inputAngle,...
                'WeightsOutputPort', true);
[yCbf,w] = step(psbeamformer, rxSignal);
figure()
plot(t,abs(yCbf)); axis tight;
title('Output of Phase Shift Beamformer');
xlabel('Time (s)');ylabel('Magnitude (V)');

Is it possible to get the signal from just one direction if the signal composes of reflected energy from all directions?- And if so, how?

Thanks for reading!


texts: Preserve specific information in compressed sensing

texts:
I have a signal that isn't perfectly sparse and I would like to apply compressed sensing on it for lossy compression. However I would like to preserve specific section of the signal so that this "important" section can be perfectly reconstructed.
Is it possible? How?
(I hope this is ok to ask this kind of question - I'm not very deep in the theory of CS, just playing with code samples after reading brief overviews).


texts: Matlab `filtfilt` provides excessive transient

texts:
I observed that filtfilt suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a 'home-made' version of zero phase filtering based on filter. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the filter function.

% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)
bp = designfilt('bandpassiir', 'StopbandFrequency1', 50, 'PassbandFrequency1', 250,...
    'PassbandFrequency2', 3600, 'StopbandFrequency2', 3800, 'StopbandAttenuation1', 30,...
    'PassbandRipple', 0.1, 'StopbandAttenuation2', 30, 'SampleRate', 8000, 'DesignMethod', 'cheby2');
% check stability
assert(isstable(bp),'Unstable filter');
% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
x = randn(2^20,1);
y = filtfilt(bp,x);
% apply 'home-made' filtfilt to the same input; output signal shows a more acceptable transient
y2 = flipud(filter(bp,flipud(filter(bp,x))));
% compare effects
figure; semilogy(abs(y-y2));

As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.

Where is the problem? Have I missed some recommendations or hints in the function's help?


texts:
I am trying to understated the the achievable bit rate in noiseless and noisy channels. Particularly, I would like to solve the following problem:

  Let a real symbol $0\leq x_i < 1$ be transmitted every $1$
  milliseconds through the following channels:

  $I$: Noiseless channel such that the output $y_i=\alpha x_i$ where
  $\alpha$ is the attenuation.

  $II$: Noisy channel such that $y_i= x_i + n_i$ where $n_i$ is the
  noise and $|n_i|<0.0000223$.

  What are the achievable bit rates for (i) channel $I$ assuming
  $\alpha$ is known, (ii) channel $I$ assuming $\alpha$ is unknown (iii)
  channel $II$.

The rate is in bits/s and so we need to find how many symbols per second is transmitted and how many bits is needed per symbol. We are transmitting one real symbol each $1$ ms. Thus, we are transmitting $1000$ symbols/s. Now for the second part, I am not sure how many bits is needed per symbol. How do I find that out?

For channel $I$, I know that in noiseless channel we get an infinite rate, but that's only if we know $\alpha$. What is it that we do if we don't? Can we ever obtain it? and how?

For channel $II$, is the achievable bit rate same as the capacity? We have a  bound for the noise magnitude and we can see that $|x_i|<1$, thus $\mathrm{SNR}=|x_i|^2/|n_i|^2$ and $C = B\log_2(1+\mathrm{SNR})$. I don't know how to proceed though.


texts: PeakEq center frequency does not match frequency response

texts:
Following the Cookbook i calculed these coefficients:

b0: 1,001511976106398860153
b1: -1,999957163328258458179
b2: 0,998488023893601139847
a0: 1,000379791226643000357
a1: -1,999957163328258458179
a2: 0,999620208773356999643

For Fs = 48000, Fc = 50, Q = 4.318477, dbGain = 12.

Applying a pink noise and analyzing the frequency response showed me that the real center frequency is approx. 93 Hz

What i want is know why this happened and how to get right center frequency.

This is actually frequency response.

The code used to implement is the following:

double filter(double in)
{

    double y = .0;

    y = (b0 / a0) * in + (b1 / a0) * xb[0] + (b2 / a0) * xb[1]
        - (a1 / a0) * yb[0] - (a2 / a0) * yb[1];

    yb[1] = yb[0];
    yb[0] = y;
    xb[1] = xb[0];
    xb[0] = in;

    return y;
}

xb and yb are two double arrays.


texts:
I have made a stft_func in MATLAB which takes window length i.e t_short  as a parameter for window length. Now, this function is giving me a very blurred image with $f_s=1000\mathtt{Hz}$, radar target $10\mathtt{GHz}$ (fm) and $T_{short}=0.5 \mathtt{s}$
How to find frequency resolution from spectrogram.?


texts:
Assume we have:
$$x_c(t)=\sum_{k=-9}^{9} a_k e^{j(2000\pi kt)}$$

and Fourier coefficients out of $$|k|>9$$  is zero. So, it is band-limited.

The sampling frequency is:$$F_s=\frac {6} {10^{-6}} HZ$$ and $$T_s=\frac {10^{-3}} {6}$$

My question: what is the maximum frequency? how we can calculate it?

I know the answer that is $$F_n=\frac {9} {10^{-6}} HZ$$

But how?


texts: How do I reconstruct text from an image using only morphological operations?

texts:
I want to reconstruct the text from the following image as best as possible. The tricky part is that I want to do it only using morphorogical operations on the image

I tried using erosion, dilation, opening and closing but the result is not very good.

Is this even possible?


texts: How do I implement a footstep recognition algorithm? One that recognizes the start and end points of each footstep?

texts:
I have some time series data captured from a person's footsteps/strides (specifically, a person on rollerblades). It came from an IMU sensor placed on a person's boot. Each data point captures acceleration, angular velocity, etc.
Here's a graph of "acceleration in the x direction vs. time" for one foot:

Problem/Goal: I want to write an algorithm to detect all the footsteps in the data, specifically, the start and end times of each footstep. (Start = foot leaves the ground; End = foot touches the ground).
Here's an example below. Each shaded region represents the duration of a footstep (from start to end). Annotated data like this is available for me to use, perhaps in a supervised learning model.

Here are some of the approaches I am considering after searching around. (Feel free to SKIP this section.)

Dynamic sliding window + classifier

This involves somehow sliding a dynamic window over the time series. At each window, run a classification model to determine whether the windowed data is a footstep or not. A dynamic window is necessary because each step varies in length.
From this blog, I know how to create a signal classification model. I can use Fast Fourier Transform or Wavelet Transform to extract features to use in a supervised learning model.

Gradient Boosting Machine

I read this paper that created a model to recognize the start/end points of footsteps...
for turkeys lol. It uses a Gradient Boosting Machine and trained on data where all data points belonging to a "footstep" were annotated (e.g. all shaded areas in the graph above).

Question: Does anyone have any suggestions for how to approach this problem? Or perhaps any comments on whether the approaches above make sense or don't make sense.
Note: My knowledge in Deep Learning is pretty basic, so I am not considering Deep Learning approaches for the sake of time. Perhaps something for the future.


texts: Time-domain filtering to match a target time-varying frequency response

texts:
I would like to implement a filter in the time domain based on a desired frequency response that changes over time. The initial goal is a bandpass filter with a time-varying center frequency, where the bandpass filter has a shape that is defined in the frequency domain. I will illustrate with a simple example.

Here we have 2 gaussians, one centered at 1000Hz and the second centered at 8000Hz. I would like to design a filter in the time domain that can perform a linear sweep between these 2 center frequencies for some fixed duration.

Another way of stating this is that I would like to be able to do the following:

Define a shape for a bandpass filter in the frequency domain for timepoints 1 and 2
Define the morph between the filter shapes at the 2 timepoints (in the example the shape is constant and it is only center frequency that varies)
Given that desired frequency domain information and a duration, I want to design a time-varying time domain filter.

I understand that the resulting filter will have time-varying coefficients. It is okay if the frequency response does not exactly match what I have outlined in the frequency domain as long as it is close.

I am looking for strategies to approach this type of problem, although if the solutions are highly dependent on the shape of the filter in the frequency domain, then a strategy to solve the provided example would be a helpful starting point.


texts: Understanding the resulting image matrix when differentiating image

texts:
Let $A$ be a image matrix and let $P(i,j)$ be the gray level of pixel $i,j$. Let $0$ be black and $255$ be white Assume I want to differentiate this image with respect to the columns $(x)$ as in I want $P(i,j)=P(i,j+1)-P(i,j)$ in the new image.

I get that I can achieve this with convolution of $A$ with the filter $f = [1 \ -1]$ since you flip the filter in the $x-$direction (so pixel $i,j$ would be multiplied by $-1$ and $i,j+1$ with $1$ which gives me what I want.

My understanding is that this process is supposed to highlight differences in the $x-$direction.

Two questions:

How does the gray-level scale in the resulting image work? If one pixel had gray level $240$ and the next pixel had gray level $5$, this would result in the new pixel having the gray level $-235$, what does that mean in the scale of $0$ to $255$? Does my scale change from $0...255$ to $-255...255$?
Does it matter if I convolve $A$ with the filter $[-1 \ 1]$ instead of $[1 \ -1]$?. What would be the result?


texts: Linear model of the modified error function

texts:
We can write the error function ($E(w)=1/2\sum_{n=1}^{N}\{y(x_n,w)-t_n\}^2$) as a linear model using its partial derivatives. Is it possible to do the same thing about the modified error function?

The modified error function is (page 10- pattern recognition by Bishop):

$$E(w)=1/2\sum_{n=1}^{N}\{y(x_n,w)-t_n\}^2+\dfrac \lambda2||w||^2$$


texts:
i'm trying to get an FFT of a signal

my FFT has 1024 samples

i added two sin functions one of freq 86,13Hz (2*44100/1024) and one of freq 129,19Hz (3*44100/1024)

the WAV looks like that (for 1 period) :

i then use this code to inspect the FFT

FFTSize = 1024;

Y = wavread('2sins.wav');

current_window = zeros(FFTSize, 1);

for k = 1:length(Y)/(FFTSize)

   for m = 1:FFTSize
       current_window(m, 1) = Y((k-1)*(FFTSize)+m, 1);
   end;

   plot(current_window)

   a = abs(Ydft);
   p = angle(Ydft);

  end;

the bins 2 and 3 have the maximum amplitude of 256 which is right as i used two sin of frequency 2 and 3

but when i look at the phases they are -pi/2 which is weird as they should be 0 no ?

here are the phases :

so you see they are -pi/2, why is that ?

and here is the WAV file i used so you can try yourself:
http://www.khaelis.com/tmp/2sins.zip

thanks for help

Jeff


texts: Difference between Gabor filter implementations

texts:
I was reading a paper and came across this:

I'd like to implement this in matlab, therefore I initially searched for a premade implementation. I stumbled upon this: http://www.mathworks.com/matlabcentral/fileexchange/5237-2d-gabor-filterver123 .
Though they use a different equation. My question now is: what is the difference between this equation and the one from the paper I read ?


texts: Acceptable Carrier Frequency Offset for Specific BPSK system

texts:
I've been working to build a transceiver system, with details as follow:

Consists of Lime LMS6002D MyriadRF-1 board (RF front-end) and own-designed multi-proc SoC (baseband processor).
SoC is running Turbo error coding, with BPSK modulation.
Wireless communication is one-way, running at 433MHz carrier frequency.
Baseband data BW is 1kHz.
Burst transfer of frame size = 768 bits
One unit for TX and one for RX, each is supplied by different clock source as PLL reference

Now just looking only at baseband analog region, everything went well on transmit, while on receive side I have this rotation of received symbol over time due to carrier frequency offset.

Tried to match two PLL clock source as close as possible, and it resulted in around 50-60Hz offset (I got this number by observing rate of symbol rotation in time-domain received data). Normalizing that offset to baseband BW, we got deltaF_norm = 0.06. Sometimes at best I can oppress it to 20Hz.

Before deciding on my next step, I wanted to confirm two things:

Is this offset is still acceptable by rule of thumb, by means I don't need a frequency offset correction implemented? Considering my baseband rate and frame size, it is impossible to have a single transfer where all bits being affected by same rotation.
Should I need an offset correction, will they be able to correct to such fine degree? I've been looking over on publications but still couldn't get a clear understanding on this.

The main reason of me asking this is my SoC actually is a low-powered design which basically isn't very suitable as a baseband processor. Great amount of resources are already taken up due to Turbo decoding on receiver side, so I doubt it will be able to do frequency offset correction either, considering the processing speed and memory issue.

Please kindly advise.
Thank you.

Regards,
Dareen


texts: Extracted envelope via Hilbert Transform is tracking the signal

texts:
I am trying to extract the envelope of the signal shown in blue, which is the low-pass filtered output of a second-order system. Low-pass filtering was done in order to reduce measurement noise. To be able to determine the decay of the system I want to extract the envelope of the signal. My MATLAB code looks as follows:

d = fdesign.hilbert(500,0.05);
hd = design(d,'equiripple','SystemObject',true);
coeff = hd.Numerator;
h = coeff / sum(abs(coeff));

y_hilb =  1i * filter(h, 1, y_filt);
y_an = y_filt + y_hilb;
env = abs(y_an);

Unfortunately, the envelope that I am extracting is actually tracking the signal rather than showing the actual envelope. What am I doing wrong here?

Sampling Period: 0.01s

EDIT1:
I changed the code as follows. Unfortunately, the result looks similar.

d = fdesign.hilbert(501,0.05);
delay = (N - 1) / 2;

y_an = y_filt(1 : end - delay) + 1j * y_hilb(delay + 1 : end);

EDIT2:
As suggested, I removed the scaling of the coefficients. Result:


texts: Different phase response plots using MATLAB's $\tt freqz$ and $\tt fvtool$?

texts:
I have a butterworth filter in MATLAB:

[B, A] = butter( 2, 3000/16000*2, 'high' );

I plot it in two ways:

using freqz:[h,w] = freqz(B,A,8000);
plot(w);
and using fvtool:h = fvtool(B,A);
h.Analysis = 'phase';
h.Fs = 16000;
h.FrequencyRange='[-Fs/2, Fs/2)';

First plot gives me linear phase, and second one not.

Why do I get different plots?


texts: calculate fft convolution for an LTI system given its input (in time domain) and its poles and zeros

texts:
I have considered taking the fft (MatLab) of the input (x) and create frequency bins for the first half (problems with an odd number of samples, tried solution zero paddings) and evaluate the transfer function in these freq bins. Then apply conjugated symmetry for completing the fft of the Transfer function. This pair of sequences are multiplied term by term and then apply ifft (MatLab). Finally scaled by the sum of the fft signal of the transfer function.
There is something strange/invalid with this procedure? How I can correct it? Bibliographical references are appreciated.
Thanks, again.


texts: LTI filtering for wide-sense stationary process

texts:
Why is it that if $U[n]$ is wide-sense stationary and it is convolved with $h[n]$ to produce $W[n]$, the autocorrelation becomes $R_{WW}[n] = R_{UU}[n]*h[n]*h[-n]$?

I know that in general $R_{WW}[n_{1},n_{2}]=R_{UU}[n_{1},n_{2}]*h[n_{1}]*h[n_{2}]$ and that wide-sense stationary means $m_{U}[n] = m_{U}$ along with $R_{UU}[n_{1},n_{2}]=R_{UU}[n_{1}-n_{2},0]$, but I can't get to the above relation from these facts.


texts:
I know this question has been previously asked just saw it and tried to do myself but reaching an expression which is different from expression of PSD which I remember for modulated signal

Actual answer $$S(f-f_c)+S(f+f_c)$$

My answer $$S(f-f_c)+S(f+f_c)+2X(f-f_c)X(f+f_c)$$

where $S(f)$ is PSD of $x(t)$ and $X(f)$ is its Fourier transform while it is modulated by $\cos$ signal of $f_c$ frequency.

What I have followed is to find fourier transform of modulated signal and then square it.Where i have done wrong.


texts:
I am attempting to implement a generalized least squares estimator that uses a noise covariance matrix from measured data. The basic model is as follows

$$\hat{c}_{GLS} = \left(\bf{A}^T\bf{\Sigma}^{-1}\bf{A}\right)^{-1}\bf{A}^T\bf{\Sigma}^{-1}\bf{r}$$

where $\bf{A}$ is a matrix of my basis functions, $\bf{\Sigma}$ is the noise covariance matrix and $\bf{r}=[r_x r_y r_z]^T$ is a column vector of my vector measurements ordered as shown. Likewise the noise vector measurements are $\bf{n}=[n_x n_y n_z]^T$.

The statement is made in the paper that $\Sigma = E\left\{\bf{n}\bf{n}^T\right\}$, which results in $\Sigma$ being size $3N\times 3N$ which makes sense. However, when I do this I get horrible results and the structure of $\Sigma$ doesn't look right. I expect it to be diagonal dominant and then falling off.

My question is what am I doing wrong?
How do I build the noise covariance matrix correctly?

I have data for $\bf{n}=[n_x n_y n_z]^T$
 It isn't just the $3\times 3$ covariance matrix I am use to dealing with.

Edit: added code

minutes = 5;
NSamples    = Fs*60*minutes;
NOverlap    = NSamples/2;
Sigma = zeros(3*NSamples,3*NSamples);
M=20;

for nn = 1:M

nStart = (nn-1)*NOverlap+1;
nStop  = nStart+NSamples-1;
nx = x1(nStart:nStop);
ny = y1(nStart:nStop);
nz = z1(nStart:nStop);
Rxx = xcov(nx );Rxx= (Rxx(NSamples:end));
Rxy = xcov(nx,ny );Rxy= (Rxy(NSamples:end));
Rxz = xcov(nx,nz );Rxz= (Rxz(NSamples:end));
Ryy = xcov(ny );Ryy= (Ryy(NSamples:end));
Rzz = xcov(nz );Rzz= (Rzz(NSamples:end));
Ryz = xcov(ny, nz );Ryz= (Ryz(NSamples:end));

N   = [toeplitz(Rxx) toeplitz(Rxy) toeplitz(Rxz);
       toeplitz(Rxy) toeplitz(Ryy) toeplitz(Ryz);
       toeplitz(Rxz) toeplitz(Ryz) toeplitz(Rzz)];
Sigma = N + Sigma;

end
Sigma = Sigma/M;


texts: What is the optimal adaptive grid for calculating a DFT using a fixed number of sampling points?

texts:
I'm currently facing the following problem: I want to approximate the Fourier transform $F(\omega)$ of a (let's say, $L^2(\mathbb R)$) function $f(x)$ by calculating the discrete Fourier transform, using only a fixed number of sampling points. These points are allowed to lie arbitrarily far away from the origin. In addition, we don't care about computational costs, so the grid can be chosen completely free.

What is the optimal (with respect to minimizing the error) choice for the grid?

I guess that this choice is dependent on the bandwidth $B$ of $f$. Does this mean that Nyquist-Shannon forces the grid to being broader than $2*B$?

Also, I found literature about sparse Fourier transform sampling in case of known sparsity in $F(\omega)$ (compressed sensing). But since my signal does not appear to have sparse support in the frequency domain, I don't see how these methods would be applicable in my case.


texts: Audio localization accuracy with two microphones

texts:
I am attempting to find the location of sound using two microphones, using cross-correlation methods. I am not getting very consistent and accurate results, there are instances where there seem to be some kind of noise signals that interfere with the signal of interest and generate rubbish values of angles of arrival.

I have tried looking at various methods to make it more accurate, but now I'm wondering whether I should be using more than two microphones to localize the sound. Is it possible that my decision to use two microphones only is causing the poor accuracy of localization?


texts:
I'm  currently studying sound design, however over the past couple of years i started creating audio effects/instruments. I have also been programming in C++ for quite some years.
I noticed my shortcomings though; i can design compressors, envelopes and simple stuff like additive synthesis quite well along with basic signal knowledge (like samplerates, nyquist theorem), however i don't understand the theory behind some of the more dense mathematical subjects like filter designs, transfer functions, fourier transforms, complex numbers, time/frequency domain etc., or even the mathematical notation of such.

Without sounding too oblivious, what are the relevant fields for educating one in such topics? Also, if anyone has some book recommendations for easy introduction to required math/basic signal theory i would be most grateful :)

Regards


texts:
In my recent study of signal processing I came to know that we can compress images/signal using DFT/DCT. If we consider the lossy compression of audio or any image then it follows the same steps:

Apply DCT/DFT on N samples of data.
Collect coefficients which contains most of the signal energy i.e., a signal's DCT representation tends to have more of its energy concentrated in a small number of coefficients when compared to other transforms like the DFT.

But I have doubt that how to get these coefficients. In DFT we have
$$ {\tt ORIGINAL:}\ X(e^{jw})=\sum_{n=0}^{N-1} x[n]e^{-j2{\pi}/Nn}\\
{\tt CORRECTED:}\ X[k]=\sum_{n=0}^{N-1} x[n]e^{-j2{\pi}/Nnk}
  $$

Here, $ \omega $ is a continuous variable. Then how to extract coefficients when $ \omega $ is a continuous variable?


texts: Fourier coefficients of product of two periodic signals

texts:
question:
If $x(t)$ and $y(t)$ are two periodic signals(both with period T) with Fourier coefficients $c_{n}$ and $d_{n}$ respectively then, Fourier coefficient of $z(t)=x(t)\cdot y(t)$ is:

(a) $\dfrac{c_{n}d_{n}}{T}$
(b) $T c_{n}d_{n}$
(c) $c_{n}d_{n}$
(d) $c_{n}*d_{n}$

my attempt :

let, $x(t)=\sum_{-\infty}^{\infty} c_{n}\cdot e^{jn\omega_{0}t}$ and $y(t)=\sum_{-\infty}^{\infty} d_{n}\cdot e^{jn\omega_{0}t}$.

Then, fourier cofficient of $z(t)$ will be equal to

$$\begin{align}
\dfrac{1}{T}\displaystyle\int_{0}^{T} z(t) e^{-jn\omega_{0} t}dt
&=\dfrac{1}{T}\displaystyle\int_{t=0}^{T} x(t)\cdot y(t) e^{-jn\omega_{0} t}dt \\
&=\dfrac{1}{T}\displaystyle\int_{t=0}^{T} \left(\sum_{l=-\infty}^{\infty} c_{l}\cdot e^{jl\omega_{0}t}\sum_{m=-\infty}^{\infty} d_{m} \cdot e^{jm\omega_{0}t} \right)e^{-jn\omega_{0} t}dt\\
&= \dfrac{1}{T}\displaystyle\int_{t=0}^{T}\left(\sum_{l=-\infty}^{\infty}\sum_{m=-\infty}^{\infty}c_{l}d_{m}\cdot e^{j(l+m)\omega_{0}t}\right)e^{-jn\omega_{0}t}dt
\end{align}$$

[in above $l$, $m$ are dummy variables]

after changing order of integration and summation i got this:

$$\begin{align}
\displaystyle\sum_{l=-\infty}^{\infty}\sum_{m=-\infty}^{\infty}c_{l}d_{m}\left[\dfrac{1}{T}\int_{t=0}^{T}e^{-j(n-l-m)\omega_{0} t}dt\right]=\displaystyle\sum_{l=-\infty}^{\infty}\sum_{m=-\infty}^{\infty}c_{l}d_{m}\cdot\delta[n-l-m]\end{align}$$

where

$$\delta[n] \triangleq \begin{cases}
1 \qquad & \text{for } n = 0 \\
0 \qquad & \text{for } n \in \mathbb{Z}, n \ne 0 \\
\text{undefined} \quad & \text{otherwise} \\
\end{cases}$$
is the Kronecker delta.

But from here on I'm unable to proceed,

i know answer is option (d)i.e, $c_{n}*d_{n}$ but i am interested in proving the result formally.


texts: Filter to eliminate a 60 Hz frequency range

texts:
I have a analog signal that is converted into a discrete-time signal with an ideal A/D converter with a sampling frequency $fs$.  The bandwidth of the signal of interest is $1 kHz$. The resulting signal $x[n] = x_a(nT_s)$ is then processed with a discrete-time system that is described by the difference equation:
$$y[n] = x[n]+ax[n-1]+bx[n-2]$$
The filtered signal, $y[n]$, is then converted back into an analog signal using an ideal D/A converter. I need to determine values for $fs$, $a$ and $b$ in order to remove a $60Hz$ interference that has a signal in the form: $i_a(t) = Asin(120 \pi t)$
By Nyquist, I know that the value of $fs$ needs to be greater than $2000Hz$, however, I don't know how to determine $a$ and $b$. Any thoughts?


texts:
I'm spending some time in understanding L1 PHY development and have some questions on the start of packet detection in an IQ capture

Let's say I have a WiFi IQ capture which consists of 600 packets and want to extract indexes of start and End of each WiFi Packet.

When I plot abs(IQ_samples), it is like

WiFiPacket|NULL|WiFiPacket|NULL|NULL|NULL|WiFiPacket|NULL|WiFiPacket ....,

so what I have done is demodulator which gives me the plot ranges between 1 and -1,  Since the energy of NULL is very much close to zero compared to the max_value of abs(IQ_sample of each packet).

So my packets have syncwords and Im trying to find the start of my packet by doing cross corelation according to my syncword that every packet have, but the plot of my cross corelation isn't giving me correct plot, it should gives me a high value when there's a syncword found in my demulated IQ samples
that data ranges between 1 and -1.
My main confusion is why the cross corelation isn't giving me a proper plot to see when my packets starts? I mean proper plot which represents a high value when there's a syncword found in my IQ demodulated samples, else would give me a low value ..

any help please how could I detect the first and the end of my wifi packets? thanks alot.

Im using SDR sampler for sampling ..


texts: Need for Oversampling in OFDM and symbol time determination

texts:
I am trying to implement OFDM on gnuradio. I have two questions.

The sampling frequency which is slightly higher than available bandwidth  satisfies Nyqvist criterion for complex baseband signals. So why do we need to add oversampling factor again? Suppose say oversampling factor is 2. How does that help us in recovery of input signal?
I have seen in an OFDM implementation that

$$
t_{\rm symbol}=t_{\rm sampl} *(N_c+N_G)*{\rm oversamplingrate }
$$

where

$t_{\rm symbol}$ = Symbol duration,

$t_{\rm sampl}$=sampling duration,

$N_c$ = No. of subcarriers consisting of data and pilot

$N_G$ = No. of guard band taps.

How does this formula come about? I also have a doubt as to whether each subcarrier corresponds to a single symbol or you can have multiple symbols per subcarrier. What is parameter that decides this?


texts: Music source separation: Incomplete notation in published IS-NMF/EM pseudo-algorithm?

texts:
In a paper by Fevotte et al. on IS-NMF, which describes algorithms/implementation for multiplicative and EM variants of IS-NMF, the following algorithm is provided for IS-NMF/EM:

In the algorithm's footnote, the authors state that the VHAT matrix $\hat{\mathbf{V}}$ only needs to be calculated during initialization, but then go on to say that $\hat{\mathbf{V}}$ is subsequently updated as $\hat{\mathbf{V}}=\mathbf{W}_{-k}\mathbf{H}_{-k} + \mathbf{w}^{new}_k h^{new}_k$ during each iteration.

Therefore, I believe that the hat matrix $\hat{\mathbf{V}}$ actually needs to be updated inside the iterations.  So my question is: Before I start coding anything, shouldn't an update for $\hat{\mathbf{V}}$ be appropriately placed inside the iterative loops?  Also, where would you place it?  Better yet, where would you place all the updates mentioned in the footnote, so that the footnote is not needed.  (why mention updating of coefficients/parameters in a footnote if they can be placed in the algorithm?)


texts: How to realize Poles and zeros at infinity??especially through transfer function?

texts:
I have a question regarding the poles and zeros at infinity
I often read here in DSP SE and also in some textbooks about poles and zeros at infinity

This question also answers somehow (but not in much easy/simple way)
 Pole/Zero existence at infinity

I am confused about how to realize the poles and zeros at infinity especially from observing/looking at system transfer function??


texts:
The transfer function of feedback system is:
$$
\frac{V_{\rm out}}{V_{\rm in}} = \frac{A}{1+Af}
$$
Where $A$ is the open loop gain, and $f$ is the feedback gain.

Now for oscillation to happen, $Af$ term (loop transmission) must be $-1$, which means the system is configured to be on a pole, because the denominator goes to zero. I have got couple of questions on this one.

For oscillation to happen (steady state), the pole must be on $y$-axis (frequency axis) in the $s$-plane. I believe this is an assumption in the oscillation theory not reflected by the above condition that loop transmission is $-1$. Because loop transmission is $-1$ in all poles in the system. So it is up to the designer to make sure that the circuit operates on a pole on $y$-axis. Is this correct?
If I ignore all the Laplace transform thing, and just look at the transfer function
$$\frac{V_{\rm out}}{V_{\rm in}} = \frac{A}{1+Af}$$
On the pole, the output is supposed to be very high (infinity). If I only consider this equation on standalone basis, then how come we have a steady state oscillation, the output voltage is supposed to be very high as denominator is zero. My explanation is that it does not happen, because the supply voltage to the Op-Amp/MOSFET (or whatever we use to implement the circuit) restricts that output voltage. Is this correct?


texts: motion detection within a poor contrast image

texts:
I have a C# desktop application.

Its purpose is to detect motion changes between consecutive frames.

Currently I am using the excellent Emgu wrapper to OpenCV.

Now, I know this question may seem ridiculous but it is an extreme example to demonstrate best what I mean by the question.

I have a complete white background.

Snow begins to fall..

I actually want to detect the motion changes.

Obviously the contrast is appalling and my normal way of detecting motion pixels by comparing the RGB values will need to have a really low threshold.

At the moment I use 10% difference. Any less than that and I will incur noise from more 'contrasted' images.

I could look at the edges instead of the color changes.

I could try to write a test that will detect a low contrast image and lower the threshold to 5% (e.g.).

I will of course attempt these 2 things now.

but is there a more obvious approach to this?

I could post code that shows how I compare the pixels of each image and report motion but that would be a very basic thing to post. But will do if asked.

The way I see it a human can detect this motion of snow so I just need to find what rules would allow my code to do the same thing.

UPDATE
For me I decided to improve the gamma of an image to help me with poor contrast.
This is the code I used:

double intensity = grayCurrent.GetAverage().Intensity;
double g = Math.Log(Shared.Optimum, 256) / Math.Log(intensity, 256);
if (g != 1)
{
    grayCurrent._GammaCorrect(g);
}

What I am doing here is get the average 'darkness' of the overall image.
I then found that 'log' formula on my Google Searches travels.
I then, by trial and error determined that the shared optimum for my particular application is 75.
I then say if the 'balance' is '1' then do not change anything. If it is off the 'norm' then make the changes to the overall image.


texts: Find corresponding wavenumber from FFT - Python

texts:
I have a set of data taken from a high speed camera. I've done some image processing which results in getting a pixel location at each frame. This oscillates with time and so I have performed an FFT on the data using scipy.fft.rfft and I worked out the corresponding frequencies using rfftfreq so I can plot amplitude against frequency. However the theoretical data I am comparing to uses wavenumber on the x-axis rather than frequency. Where wavenumber is denoted as $$k=\frac{2\pi}{\lambda}$$
How can I calculate the corresponding wavenumbers (or wavelength) from my FFT data so I can compare my data against the theoretical predictions.? My camera has a frame rate of 27000 frames per second and I recorded for a duration of approximately 4.3 seconds and a total frame count of ~ 116500


texts:
I am trying to send a short amount of data (10-15 characters) from one mobile device to another via (inaudible) sound within 1-2 seconds. I'd like to be able to deal with normal external noises (chatter, traffic, etc).

I have a software engineering background, but no experience working with sound or audio. Is there a known/documented solution to address this problem of reasonably reliable ultrasonic data transfer? If you know of a guide or some document that'll explain the concepts to me as I develop out a solution that would be really awesome.

I've researched a little bit on this topic, but have been unable to find something concrete for ultrasonic communication. Any direction would be much appreciated (and yes, I know I'm a noob here). Thanks.


texts:
My idea is to find a word in wav/mp3 files. It is just one word.
I have a database with a few hundred songs.

I am looking for pattern matching (this is not an exact pattern) it can be an word i choose but only one.

Can you recommend a pre-processing algorithm. you run the algorithm on the files?
Can you recommend a real-time algorithm?

I have found this online


texts: Impulse response of an LTI system given the input and output signals

texts:
I have been given the input and output signals of an LTI system as:

$x[n] = (\frac{1}{2})^nu[n] + 2^nu[-n-1]$

$y[n] = 6(\frac{1}{2})^nu[n] - 6(\frac{3}{4})^nu[n]$

I have found the system function $H(z)$ by using $H(z) = \frac{Y(z)}{X(z)}$ and using the standard transform tables to get:

$X(z) = \frac{1}{1-\frac{1}{2} {z^{-1}}} - \frac{1}{1-2z^{-1}} = \frac{-\frac{3}{2}z^{-1}}{(1-\frac{1}{2}z^{-1})(1-2z^{-1})}$

$Y(z) = 6*\frac{1}{1-\frac{1}{2} {z^{-1}}} - 6*\frac{1}{1-\frac{3}{4}z^{-1}} = \frac{-\frac{3}{2}z^{-1}}{(1-\frac{1}{2}z^{-1})(1-\frac{3}{4}z^{-1})}$

$H(z) = \frac{Y(z)}{X(z)} = \frac{\frac{-\frac{3}{2}z^{-1}}{(1-\frac{1}{2}z^{-1})(1-\frac{3}{4}z^{-1})}}{\frac{-\frac{3}{2}z^{-1}}{(1-\frac{1}{2}z^{-1})(1-2z^{-1})}} = \frac{1-2z^{-1}}{1-\frac{3}{4}z^{-1}}$

Then this can be further simplified to:

$H(z) = 1 - \frac{\frac{5}{4}z^{-1}}{1-\frac{3}{4}z^{-1}}$

However from here I am stuck on how to get the form of the second term back into the time domain as it does not match anything from the standard tables.

I am just wondering if I have missed anything or made a mistake in my calculations, or if there is some way to get it into time domain form from here that I am not seeing, so that i can get the impule response $h[n]$.

Thank you for any help you can give me.


texts: Detecting corners using structure tensor matrix

texts:
How does eigenvalues of structure tensor matrix help in detecting corners?
For eg, in Harris corner detection, we consider the matrix
$$M = \sum_{w} w \cdot
\begin{bmatrix}
I_x^2 & I_x I_y \\
I_x I_y & I_y^2
\end{bmatrix}
$$
We say that if both eigenvalues are high, then it is a corner. If one of them is high, then it is an edge. If both are low, then it is neither corner nor edge. How do we come to this conclusion?


texts: Comparing two wav in matlab using NullTest

texts:
i have a legacy processed audio wav file. Another UN-processed copy of the source is processed by my algorithm. From both processsing blocks i get processed wav files as output. Now i want to do null tests, because i read (will soon quote the reference) null tests are suitable for objective loudness comparision. So merely sutracting is enough?? But merely subtracting is not working. I see high of difference value. So what other parameters should be considered for null-testing!

wav file descriptions:

Source : 16 bit pcm ,48Khz sampled,32 Seconds length

Output : Both 24 bit,48Khz sampled,32 Seconds length


texts: How to convert between function forms of single frequency signals

texts:
I have an equation x(t) = (3+4j)*e^(j*8*pi*t)+(3-4j)*e^(-j*8*pi*t) and am trying to convert between this and shifted sines and cosines. I'm attempting mash this through euler's formula and got a 10 for the peak amplitude. Omega is 8*pi, but I'm struggling with the finding the phase shifts for the sine and cosine and the amplitudes on the individual sines/cosines: A*cos(2*pift)+B*sin(2*pift).

Is this making sense? Can anyone point me in the right direction? Please and thank you!!


texts: When was the time-frequency analysis invented?

texts: It seems there are several papers from the seventies but backtracking from the references gets quickly difficult. Who calculated for the first time a time-frequency representation of a signal?


texts: Under what circumstances is a non-uniform quantizer preferable over a uniform quantizer?

texts: I am studying btech ECE 3rd year. I want answer that question. Please tell me.


texts:
Given a signal $r(t)$ which is a result of convolution between signal $x(t)$ and a channel $h(t)$ as below :

$r(t) = h(t)*x(t); $

what I know, the time reversal convolution can be process as follows :
$y(t) = r(t)*h^*(-t) = h(t)*x(t)*h^H(-t);$ where * denote to the convolution and $h^H$ is the conjugate. I think that right and clear, but what does mean $h(-t)$.  is it all simply equals to $conv(r(t), -h(t))$ for example as below :

x = randn(1,5);
h = randn(1,3);
r = conv(h,x);
y = conv(r,-h);

Is y is correct in the above example? however I think it should be continuous where the above example is discrete signal.