texts: Local Histogram Processing clarification

texts:
In Gonzales' book Digital Image Processing in the section Local Histogram Processing, he writes, for a 2D image:

  At each location, the histogram of the points in the neighborhood is
  computed and either a histogram equalization or histogram
  specification function is computed and either a histogram equalization
  or histogram specification transformation function is obtained. This
  function is then used to map the intensity of the pixel centered in
  the neighborhood. The center of the neighborhood region is then moved
  to an adjacent pixel location and the procedure is repeated.

He then writes:

  Because only one row or column of the neighborhood changes during a
  pixel-to-pixel translation of the neighborhood, updating the histogram
  obtained in the previous location with the new data introduced at each
  motion step is possible. This approach has the obvious advantages over
  repeatedly computing the histogram of all pixels in the neighborhood
  each time the region is moved over one pixel location.

This last statement I am not clear about. Given a neighborhood, say a 3 by 3 patch centered
at a pixel location $(x,y)$, if we shift the neighborhood over by one pixel to the right say, so it is now centered at $(x+1,y)$, in this case the letmost 3 by 1 column from the previous neighbourhood will not be in the new patch, and a new 3 by 1 column on the right of the previous patch will be present in the new patch.

What does the author mean when he says that this approach has the obvious advantages over repeatedly computing the histogram of all pixels in the neighborhood region each time the region is moved one pixel location?


texts: How to convolve $u(-t)$ with other signals?

texts:
How can I convolve the following
$u(t+1)*u(-t)$
I know that convolution with $u(t)$ gives the integral of a function but what change occurs due to $u(-t)$?


texts: How do the motion vectors work in predictive coding for MPEG?

texts:
In MPEG, there is a process where an image is broken up into macroblocks and a motion vector is computed for each of those macro blocks.  You then transmit these vectors, along with the prediction errors, to reconstruct the next image in the video sequence.

I'm trying to get a firm grasp on how this works.  Each macroblock has a motion vector associated with it, which (if vector is [1,0]), says all the pixels in this block move 1 in the x direction and 0 in the y direction for the next frame.  If all the motion vectors don't align correctly, won't this leave areas of the image unaccounted for (like the area where that macroblock was in the first place)?

For example, I have the following question I found.

Consider the following image at time t:

7   7   7   7
7   7   5   5
7   5   5   8
8   8   8   8
9   9   9   9
9   9   9   9

This image was broken up into 2x2 macroblocks and the following motion vectors were sent along to recreate it:

(0,0)  (0,0)  (0,1)  (-1,1)  (0,0)  (0,0)

The image at the previous time step, t - 1, looked like this:

7   7   7   7
7   7   5   4
7   7   7   7
7   5   8   8
8   9   8   9
9   9   9   9

What were the errors transmitted?

How would you solve this?


texts: Can PSNR > 48 used to validate the signals between two audio files?

texts:
I have written some audio decoding code. I decoded an mp3 file and save as wav file.

In order to validate the code is working correctly, I compare the signal between the mp3 file and the decoded audio in wav file by using PSNR matlab (coding shown below).
The results obtained are shown in the table.

Signal1 = audio.mp3;
Signal2= audio.wav;
[R C]=size(Signal1);
err = sum((Signal1 -Signal2).^2)/(R*C);
MSE=sqrt(err);
MAXVAL=255;
PSNR = 20*log10(MAXVAL/MSE);

How can I comment on the result?

According to the post here, it says ‘If the reconstructed audio signal is exactly same as original signal then MSE =0. And if Max pixel value is 255 (8-bit representation), then the value of PSNR = 20*log(255) = 48dB.’

Since the PSNR of the songs are more than 48, can I conclude that the decoded audio signal in the wav file is valid?


texts: Explanation of binning in frequency analysis post-FFT

texts:
I am creating an Android app which records sound for t seconds at a sampling rate of 44.1kHz with a buffer size of 8192 (16 bit mono samples). I need to plot a graph of amplitude against frequency, and so first I need to run an FFT over the buffer each time it is full (which happens multiple times every second, more so with an increasing sampling rate). However, after I run the FFT I understand I need to 'bin' the frequencies and then apply an A-weighting to each bin. From the Nyquist criterion, I understand that I only need to look at the first half of the frequencies, and disregard the first corresponding to the DC component. However, I am unsure of what 'binning' actually means and would like some clarification as to what it is, and how to choose what goes in what bin.

Please advise :) .


texts: What is meant by "arbitrary" in the context of digital filter design?

texts:
I try to understand the 'arbitrary' what does it meant?
I had read many references ,such a one it is 'begin the process with a transfer function of your choice' ,in other reference :related by the starting point,

In other hand i read about Chebyshev approximation with arbitrary magnitude,
how can i find the better design with arbitrary magnitude ?
any method of design have a criteria ,the 'arbitrary' related by the method of design or related by the transfer function?


texts: A good textbook for designing signal filters

texts:
Since a couple of months ago I started being actively involved in the area of control of dynamical systems.

In most cases, designing a controller for a given dynamic system will require the employment of digital signal processing techniques, especially in the area of signal filters.

Since I do not have a background in control engineering, I wonder if any of you may provide me with suggestions of sound textbooks dealing with signal filters into some detail.

The textbooks should ideally encompass:

Introduction to the most common filters in the area of DSP;
Explanation of their main characteristics in both frequency and time domain;
In which scenarios are they generally used (role or function of the filter).

Although being a naive question, I hope you may advise a couple of textbooks.


texts: How does using DCT help in image compression

texts: I once learnt that the Huffman Encoding is used to rid of redundant information, thus reducing file size. I am not sure how using a DCT, or FFT on an image can help in reducing file size. It does not work on redundancy, then how does it reduce the total amount of data?


texts: How to find the color channel shifting of an RGB image that was supposed to be greyscale?

texts:
I am using a recording device that seems to shift the colors horizontally and I would like to find the amount of unshifting I have to do on 2/3 of the channels in order to obtain an image with minimal color distortion.

You can see here that in the original image at least the blue channel was shifted back with ~1.0 pixel.

The question is how can I detect the optimal unshift values, I'm sure they are not integers.


texts: What is special about the frequency $\omega_0=\pi$ that suddenly causes rate of oscillation decrease?

texts:
In Alan Oppenheim's book Signals and Systems a comparison is made between the properties of discrete-time and continuous-time complex exponential signals in section 1.3 pg. 26.  Specifically it says:

  The continuous-time complex exponential $e^{j\omega_0t}$ has two
  properties:
      1.  the larger the magnitude of $\omega_0$, the higher is the rate of oscillation in the signal
      2. $e^{j\omega_0t}$ is periodic for any value of $\omega_0$

  Consider the discrete-time signal $e^{j(\omega_o+2\pi)n}= e^{j2\pi n}
e^{j\omega_0 n}=e^{j\omega_0 n}$. Because of the periodicity implied by this equation, the signal $e^{j\omega_0 n}$ does not have a continually increasing rate of oscillation as $\omega_0$ is increased in magnitude.  Rather, as illustrated in Figure 1.27, as we increase $\omega_0$ from 0, we obtain signals that oscillate more and more rapidly until we reach $\omega_0=\pi$.  As we continue to increase $\omega_0$, we decrease the rate of oscillation until we reach $\omega_0=2\pi$, which produces the same constant sequence as $\omega_0=0$

My confusion is with the part that is in bold.  For the continuous-time case, we know that

$\omega_0 = \frac{2\pi}{T_0}$ and it makes sense to me that decreasing $T_0$ (more frequent oscillations) would cause $\omega_0$ to increase.  Similarly, for the discrete-time case we know that

$\omega_0 N = 2\pi m$ for $N,m \in \mathbb{Z}$ Solving this equation for $\omega_0$, we get

$\omega_0=\frac{2\pi m}{N}$.  Just like in the continuous-time case, decreasing N should cause $\omega_0$ to increase.  So I am not seeing what is so special about $\omega_0=\pi$, the rate of oscillations suddenly start decreasing. I don't see that in the math if you decrease N.


texts: Is there mathematical relationship between the FFT and DCT transforms

texts:
I need to model the relationship between the DCT and DFT transforms (If it exists). I mean real signal $x \to y = \textrm{DCT}(x) \to z = \textrm{DFT}(y)$, so I need to get the relationship between the $x$ and $z$ if possible.
For more details:
Assume I have a real signal $x[m],\ m=1,2,….N$, the $N$-point IDCT transform of the signal $x[m]$ is $X[n]$ which can be written as follows (let's ignore the coefficients for simplicity):
$$X[n] = \sum_{m=1}^N x[m] \cos\left( \frac{(2m+1)n\pi}{2N} \right)$$
I need to get the relationship between the FFT of $X[n]\ $ and the signal $x[m]$, so taking the $2N-$point  DFT for the signal $X[n]\ $ (I upsampled the signal to have the DFT of each point resulted from the IDCT), that will give:
$$Y[v] = \sum_{n=1}^{2N} X[n] e^{-\frac{j2\pi mn}{2N}} = \sum_{n=1}^{2N} \left[
\sum_{m=1}^N x[m] \cos\left( \frac{(2m+1)n\pi}{2N} \right) \right] e^{-\frac{j2\pi mv}{2N}}$$
with some mathematical operations, we can get:
$$Y[v] = \sum_{n=1}^{2N} \left( \left[ \sum_{m=1}^N x[m] \cos\left( \frac{(2m+1)n\pi}{2N} \right) \right] \cos\left(\frac{2\pi mv}{2N}\right) - j\left[\sum_{m=1}^N x[m] \cos\left( \frac{(2m+1)n\pi}{2N} \right) \right] \sin\left(\frac{2\pi mv}{2N}\right) \right)$$
I am trying to get the relationship between the $Y[v]$ and $x[m]$ from the relationship above if it exists. How can we get it?


texts: Something like Hilbert Transform to obtain arbitrary Phase Shift?

texts:
I was wondering if there is something like a Hilbert Transform but that can implement an arbitrary phase shift to every frequency component.
I mean, I know that the magnitude response of a "Hilbert filter" is 1 for all frequencies and the phase response is $-\pi/2$ for all positive frequencies, but I would like to obtain different phase shifts like $\pi/3, \pi/4, \ldots$ etc.
Is there a transform that can accomplish that?
I guess it would be something like a "trascendental Hilbert Transform"


texts: Allan Variance vs Autocorrelation - Advantages

texts:
I am currently studying oscillator stability and have come across the Allan variance. I gather that it was developed as an alternative to the standard variance as it doesn't necessarily converge for power law noise. However, I have a hard time seeing how this niche tool differentiates itself (or how it is superior) to other more conventional statistical tools like the autocorrelation or PSD.
Does anyone have any insight?


texts:
I'm pretty new to digital signal processing, my degree touched on it briefly, but it's interested me since.
I am trying to determine the fundamental frequency of a guitar note played into a mbed LPC1768.

I am currently reading the analog signal in and storing it as an array of floats, the data is currently sampled at 1000Hz for 1 second.

By plotting the values against 1-1000 (milliseconds) I can create this graph. This is a ~1 second snippet of an E String being played.

I was hoping someone could give me a few pointers on the best library to use to convert my 1D array into a form which would give me the frequencies involved in this converting this data from time-domain to frequency-domain.

I have seen some libraries but I can't figure out how to actually implement them due to a lack of examples.


texts: How to compute number of samples in 1 cycle of signal?

texts:
I have 3 signal sampled at 12 KHz frequency obtained from a motor rotating at constant 2000, 2020, and 2040 rpm. For 1 second signal recording I have 12,000 time samples. Depending on the frequency I can say (1/f) is the time period of oscillation.

But I am confused how to segment the signal with one time cycle from the whole signal, so that I can choose those many samples out of 12000 samples.

Is there any mathematical way to compute length of 1 cycle of signal when its sampling frequency and rpm are given, without observing the peak to peak in oscilloscope?


texts:
So I got some oscilloscope captures for a project I'm doing and I'd like to find a phase shift between them because I don't trust the scope calculation.

So I extracted data from a .csv file and loaded it into Matlab and now I'd like to find a phase shift using FFT (I think). Is there a way to do this even though the second signal, output, is not a perfect sinusoid?


texts: Why is discrete cosine preferred to FFT in neuroimaging GLM

texts:
High-pass filtering is often used in neuroimaging data analysis. Commonly, whenever a general linear model is fitted to the data (as for instance in statistic parametric mapping) a number of columns of the design matrix are assigned to discrete cosines (DC). See the figure below for a graphical example.

I am curious why this is preferred to taking the fourier transform (FT) of the data, and applying a filter or cutoff. Arguments I think would speak for the FT alternative are:

You would not have to re-do the high-pass filtering upon every application of a GLM
Since DCT is discrete I am guessing a FT would be more accurate in extracting all high frequeny components (looking at the figure above, I find it hard to believe that those few cosines cover all the low-frequency spectrum in between them)

Reasons I think DCT might be the preferred method:

Maybe it is faster than FFT.
Maybe there is a reason why it is desirable to perform the filtering concomitantly with your GLM fitting.

Could you tell me what you think about this?

Why is DCT preferred?
Would FFT not be better?


texts: Proof from wave equation of upper limit of active noise cancellation

texts: Anybody know of a proof of the hard upper frequency limit of active noise cancellation using the ear canal volume as a boundary condition to solve for the upper frequency limit? I keep on encountering 1kHz as the upper limit in practice.


texts: Computing main lobe width of Hamming window in Matlab by plotting

texts:
I wanted to verify the fact that main lobe width of a Hann/Hamming window is twice that of a rectangular window, using Matlab. I computed the analytical expressions for the respective frequency responses, and plotted them. I do not get the expected result. Can someone explain this?

Code :

omega = -pi:0.01:pi;
N = 20;
fn = exp(-j*omega*(N/2 - 0.5)).*((sin(omega*N/2))./(sin(omega/2)));
shift = (length(omega)-1)/(N-1); % 2pi/(N-1); length(omega) = 2*pi
fn2 = 0.54*fn' + 0.23*circshift(fn',ceil(shift)) + 0.23*circshift(fn',-ceil(shift));
plot(abs(fn)/max(abs(fn)))
hold on
plot(abs(fn2)/max(abs(fn2)),'r')

This is the plot :

As you can see, neither is the main lobe wider, nor are the side lobes smaller.


texts: What are types for feature extraction in iris recognition? How can I divide it on types which detect phase, edge, etc.?


texts:
I'm working on a realtime FFT processing algorithm in C using PortAudio.  Currently I'm just trying to test if I can do OLA / OLS in (semi) real time using FFTW.  I'm getting some distortion in the output when applying 2x sin and cos windows on the real signal before and after FFTW using the trig identity sin^2+cos^2=1.  This should be an identity system but there is some added distortion on the output.  I'm only using powers of 2 for the transform currently.  Any ideas on why this distortion is occurring?

Regards,
Eric


texts: I want to do a fft spectral decomposition of a dataset, but the data has more than one sample for every time t. The data goes from the discrete years 1998 to 2010, each year has 20-30 points. Every example I can find online has a single point for any time t. Does FFT work fine in this situation? If anyone could push me in the right direction, I would be appreciative. The right thing to google is really the only thing I need.


texts: Practical diversity combining at receivers (Maximal Ratio Combining & Equal Gain Combining)

texts:
I am trying to perform practical diversity combining implemented in GNU Radio by using Ettus N210 USRPs, one as a transmitter and two as receivers.

To compare Equal Gain Combining (EGC) and Maximal Ratio Combining (MRC) techniques, I simply add the same received signal from two different receivers constructively for EGC and multiply each branch with a gain derived from square root of its signal-to-noise ratio (signal+noise/noise) before adding for MRC.

Contrary to the literature, for a few cases MRC is not performing better than EGC. I have noticed that when there is no signal, the noise level for both receivers is not same. In theory, it is assumed that all branches have equal mean power and noise level.

Now, I am confused. Should I attenuate/amplify the received signal (signal+noise) from each receiver to make the mean signal power same across both receivers or should I attenuate/amplify the received signal (signal+noise) in a way that noise level become same in the signal from both receivers before performing EGC.

Once I am done with EGC, should I simply multiply the weight at each branch to perform MRC?


texts: Calculate displacement from acceleration signal data using Fourier transformation

texts:
I recorded acceleration data from an accelerometer attached to a vehicle, and I want to calculate displacement using the Fourier Transformation Integration method.
I used software called vibration Data ToolBox.  This software has a built-in Fourier transformation which lets me save transformed acceleration data into a complex number (real + imaginary).
According to the rules of the Fourier transform, I can perform integration on the time-domain data by dividing the transformed acceleration data by the scale factor (-2πf) where f is the frequency in Hz.
However, the transformed data is a complex number.  Should I divide the real part or the imaginary part or the magnitude by the scale factor?
Also, the software can perform Inverse Fourier transformation just for complex transformed data to obtain displacement in the time domain. how to calculate displacement?
I attached transformed data as Excel sheet.Excel sheet


texts: Meaning of frequency and bandwidth of a signal, despite the fact that we do not know the signal

texts:
First of all, I am completely new to the domain of signal processing.
As far as I know, a signal can be represented with an infinite integral of infinitesimal complex exponentials, which is known as a Fourier Transform. From calculating the Fourier Transform of a signal, we can find the bandwidth of it as well.
We tend to say that voice signals have a bandwidth starting from 50Hz and ending approximately at 10kHz. At the same manner, we say that radiowaves and microwaves lie on a specific bandwidth. How is it possible to know the bandwidth of a signal, if we don't know the signal itself? I mean, when speaking, the output signal produced by my mouth is always different as time proceeds, but we know that the bandwidth of that signal is always at the aforementioned frequency interval. How is that possible to know?


texts: 1D as a 2D FFT - am I understand it properly

texts:
in one of my question about non $ 2^L $ points FFT I got answer with advice to read about that in following book:
Rabiner, Lawrence R., and Bernard Gold. "Theory and application of digital signal processing." Englewood Cliffs, NJ, Prentice-Hall, Inc., 1975. 777 p. (1975).

I read that and I found that equation:

There was also explanation how to calculate it, but I could’t understand it - probably because my lack both of English language and math at all.

I was wondering long time what’s the deal with that equation. Let’s say for example I have N=36 point DFT. And make matrix 3x12. There are in equation 4 variables s, r, m, l. So I still need make calculations for each s (which goes from 0 to 11), for each r (from 0 to 2), for each m (0 to 11) and for each l (0 to 2). So it looks like I need to make $ 12 \cdot 3\cdot12 \cdot 3 $ operations. So it’s $ 36^2 $, the same as regular DFT. So where is the deal, where is that FFT efficiency?

But now after some considerations, testing and thinking. I see I can calculate at first:

So for each m (0 to 11), each l (0 to 2) and each s (0 to 2) it gives me $ 12
 \cdot 3 \cdot 3 $ calculations. And then I need to calculate that:

and for each m, s and r (0 to 11) I need $ 12 \cdot 3 \cdot 12 $ calculations. And then I need multiply each result by each result from previous equation. So it’s $ (12 \cdot 3 \cdot 12)+(12 \cdot 3 \cdot 3) $ which is equal 540, and it’s much less than $ 36 \cdot 36 $. And is it that deal? I am not sure of my way of thinking. Please could anyone help me with understanding it?


texts: How to determine variance/std deviation of Gaussian noise from measured data

texts:
If I have a signal measured in discrete time intervals of a process containing some signal and some Gaussian noise how do I go about measuring the variance of this noise [i.e. the $\sigma^2$ term in $\mathcal{N}(0, \sigma^2)$].

For example if I generate some pure Gaussian noise and plot the time trace, the histogram of counts and the power spectral density like so:

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import scipy.signal

sigma = 0.1
sample_freq = 1e6 # 1 MS/s
dt = 1/sample_freq
r = np.random.normal(0, sigma, 1000000)
t = np.arange(0, 1000000*dt, dt)

# Create 2x2 sub plots
gs = gridspec.GridSpec(2, 2)

fig = plt.figure(figsize=[10, 7])
ax1 = fig.add_subplot(gs[0, 0]) # row 0, col 0
ax1.plot(t, r)

ax2 = fig.add_subplot(gs[0, 1]) # row 0, col 1
ax2.hist(r, bins=100, orientation="horizontal")
for tick in ax2.get_xticklabels():
    tick.set_rotation(270)

ax3 = fig.add_subplot(gs[1, :]) # row 1, span all columns
freqs, PSD = scipy.signal.welch(r, sample_freq, nperseg=1000)
PSD = PSD[freqs.argsort()]
freqs.sort()
ax3.semilogy(freqs, PSD)
ax3.set_ylabel("$S_{xx}$ ($V^2/Hz$)")
ax3.set_xlabel("$f$ (Hz)")

I could fit the equation for the probability density of a Gaussian [i.e. $f(x|\mu, \sigma^2) = \dfrac{1}{\sqrt{2\pi\sigma^2}}e^{\frac{(\mu-x)^2}{2\sigma^2}}$] to the histogram to get the std deviation $\sigma$ of the noise.

However, in the case where we have some signal with some Gaussian noise we get something like that which I have below for a pure 100kHz sinusoidal signal:

rs = r + 1*np.sin(2*np.pi*100e3*t)

# Create 2x2 sub plots
gs = gridspec.GridSpec(2, 2)

fig = plt.figure(figsize=[10, 7])
ax1 = fig.add_subplot(gs[0, 0]) # row 0, col 0
ax1.plot(t, rs)

ax2 = fig.add_subplot(gs[0, 1]) # row 0, col 1
ax2.hist(rs, bins=100, orientation="horizontal")
for tick in ax2.get_xticklabels():
    tick.set_rotation(270)

ax3 = fig.add_subplot(gs[1, :]) # row 1, span all columns
freqs, PSD = scipy.signal.welch(rs, sample_freq, nperseg=1000)
PSD = PSD[freqs.argsort()]
freqs.sort()
ax3.semilogy(freqs, PSD)
ax3.set_ylabel("$S_{xx}$ ($V^2/Hz$)")
ax3.set_xlabel("$f$ (Hz)")

We can now no longer fit to the histogram without deconvolving the sinusoidal signal some how (which may not be so trivial for a more complex signal). However the noise level in the power spectral density remains the same, so there should be some way of getting the std deviation $\sigma$ of the Gaussian noise from this.

I understand that the equation for the power spectral density in discrete time is:

$$S_{xx}(\omega) = \dfrac{(\Delta t)^2}{T}|\sum_{n=1}^{N}x_n e^{-i\omega n}|^2$$

and the equation for the probability density of $x$ (where $x$ is drawn from $\mathcal{N}(0, \sigma^2)$) is

$$f(x|\mu, \sigma^2) = \dfrac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(\mu-x)^2}{2\sigma^2}}$$

But I am unsure how to derive the relationship between the level of the noise in the PSD and the std deviation $\sigma$ of the noise in order to extract the std deviation $\sigma$ in the noise on a measured signal.


texts: How to calculate the discrete power of a discrete signal?

texts:
If I have a time series defined by a series like
$$
x = [a_1, a_2, a_3, ..., a_n]
$$
for time from $t = 1$ to $t = n$

How can I get to the power of the signal in this form:
$$
P_x = [p_1, p_2, p_3, ..., p_n]
$$
Can I use this formula and make it so $N_0 = N_1$

$$
P_x=\frac{1}{N_1-N_0+1}\sum_{n=N_0}^{n=N_1}\left|x(n)\right|^2
$$

Then calculate the $P$ value for every instance in $X(t)$?

Thank you.


texts: Is the SWIPT technology not the good method to increase the life of using battery?

texts:
Is the SWIPT( simultaneous wireless information and power transfer ) technology  not the good method to increase the life of using battery?

Because I design the Full duplex system with three device,and I found that the  number of using battery  with energy harvest vs without energy harvest is just 51vs 50.

Their differences let me feel that SWIPT is not a good method to increase the life of using battery.

Does anyone have other thinking ?


texts: I am testing the dataset DAVIS from here with one of the papers it has. The codes works fine with DAVIS dataset but it does not work for my data. In particular, the code does not accept the mask I create for the images. Does anyone know how to create a mask like in the DAVIS dataset. Is there a recommended way for that? Can someone please help?


texts:
I've been using Open Broadcaster to stream the infrared HDMI output from a 4K Sony video camera. It works pretty well, but one thing that I'm finding a little annoying for image analysis is the presence of grayscale salt and pepper noise in the footage.

Does anyone know if there's a way I could reduce this? I've been trying to change the video bitrate (currently at 40,000), but are there potentially other things I could do (such as play with the downscale filter)? Thanks so much.


texts:
How many 4-connected and 8-connected components are present in the binary image below?

Using definition of connectivities from the same textbook

"A connected component is a group of pixels that are connected in the sense that there is a connected path between any two pixels in the component. 4-connected means that the path comprises only horizontal or vertical neighbours (i.e. NSEW directions). In 8- connected regions the path may include diagonal neighbours as well (i.e. NW, SW, NE, SE directions)."

I get four 4-connected groups and three 8-connected groups.

The answer though is four 4-connected regions and one 8-connected region and it comes with the following diagram.

I realise I might be double counting some of the clusters, but I don't see how does the author get his/her answer from the above picture. Looking at it I get two 4-connected groups and one 8-connected groups. Unless the correct groups are grouped like this.


texts: Autocorrelation of a signal comprised of only the same number

texts:
In MATLAB I generated a signal and its autocorrealtion function using:

  signal = ones(1,500).*5; % a vector of the number 5

  acf = autocorr(signal,numel(signal)-1));

To my suprise the resulting ACF vector is all NaN.

But If i generate the signal with numbers between zero and one (0.3 in this case),

  signal = ones(1,500).*0.3; % a vector of the number 0.3

  acf = autocorr(signal,numel(signal)-1));

I get the following plot,

I am just confused as to what is going on here. I would think in either case the autocorrelation of the same number will produce just all '1's indicating no decay what so ever? So why do I get NaN when the signal is above 1 but a linear decaying signal when its between 0 and 1.

Thanks


texts:
I'm using a biquad filter algorithm in my project. I got 3, 16 size variable arrays summing into one and then gets filtered.

Now i want to filter each array seperately and sum after that, which if the filter was linear wouldn't be a problem, but result is non linear after all.

Am I doing something wrong with this process or biquad's non linear in nature?

If latter is true, can you recommend a nice filter to implement in embedded C, and musical sounding as well? (Quality factor is a must)

I'm using this to generate coefficients

http://shepazu.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html


texts: why difference between this example and matlab result


texts: Which algorithms should use to recognize handwriting numbers from an image?


texts:
I am working on bearing faults detection. I am doing the following steps:
signal->mean zero->high pass->hilbert->y->fft->cepstrum of y.

my code is:

    analy = hilbert(Signal);
    y = abs(analy);
    N = 2*2048;T=N/Fs;
    sig_f = abs(fft(y(1:N)',N));
    sig_n = sig_f/(norm(sig_f));
    Signal_fft_hilbert = sig_n;
    freq_s = (0:N-1)/T;

       figure(3)
      plot(freq_s(2:250),Signal_fft_hilbert(2:250))
      title ('Average FFT after Hilbert enveloping');
     xlabel('Frequency in Hz')

      figure(4)
      c2=cceps(y(2:250));
     plot(freq_s(2:250),c2)

The problem is I am not able to extract the fundamental frequency out of the spectrum or cepstrum. my bearing frequency is 42 Hz.I am not getting prominent peaks in this region. Please suggest something.


texts: low pass filter and FFT for beginners with Python

texts:
I am new to signal processing and especially to FFT, hence I am not sure if I am doing the correct thing here and I am a bit confused with the result.

I have a discrete real function (measurement data) and want to set up a low pass filter on that. The tool of choice is Python with the numpy package. I follow this procedure:

compute the fft of my function
cut off high frequencies
perform the inverse fft

Here is the code that I am using:

import numpy as np
sampling_length = 15.0*60.0 # measured every 15 minutes
Fs = 1.0/sampling_length
ls = range(len(data)) # data contains the function
freq = np.fft.fftfreq(len(data), d = sampling_length)
fft = np.fft.fft(data)
x = freq[:len(data)/2]
for i in range(len(x)):
if x[i] > 0.005: # cut off all frequencies higher than 0.005
    fft[i] = 0.0
    fft[len(data)/2 + i] = 0.0
inverse = np.fft.ifft(fft)

Is this the correct procedure? The result inverse contains complex values, that confuses me.


texts: Why did my sine wave turn into a square wave when written to a WAV file in Octave?

texts:
I am trying to use Octave to generate a pure sine wave. The code for the same is as follows:

x = 10.*sin(2*pi*(300/16000)*(0:1:400));
The sampling rate is 16000Hz, the sine wave is at 300 Hz. I write the above wave to a file using wavwrite like so:
wavwrite(x, 16000, 16, "temp.wav")

When I try to read it back into a variable, like so:
y = wavread('temp.wav');, I get square waves upon plotting y.
I have checked the sine wave and the period indicates a frequency of 300Hz.

How can a pure sine wave become a square wave on simply writing and reading? Or am I going wrong somewhere?


texts: Periodicity of the output of causal time-invariant systems when the input is periodic

texts:
For time-invariant systems, if the input is periodic, the we can argue that the output is periodic:

If we shift the input signal one period, we come up with the same signal as before, and since the output must be shifted the same amount as a result of the system being TI, it should be periodic too.

For causal systems we know that the output signal at time $t$ depends on the input for times up to $t$. My question is, can we conclude that for causal TI systems if the input is periodic before $t_0$, the output will be periodic up to $t_0$ too?


texts: What function to apply a Metamorphopsia (grid warp) translation?

texts:
How would I go about finding or creating a function to warp images dependent on grid lines surrounding an origin (I don't wish for a grid on my actual images):

It should work in practically the same manner as the envelope distort tool in Adobe Illustrator, though I wish for mine to be adjusted according to amplification of the warp, so small multiplier would lead to less warp, whilst higher would lead to greater warp encompassing more of the image surrounding the origin. Also of note is I wish for my images to keep their colours. I use Python. The distortion surrounding the point can be random, just not extreme.

Background info: Compounding adversarial attacks into biological relevance and then researching the biological relations of different NNs. Created images previously (through illustrator) though the amplification will allow me to go back and forth between early and late stages of diseases, and obviously just make it far simpler for me to increase my dataset tenfold, which I desperately need also!

Sorry for using medical term for the translation name, image processing is not my area of expertise in the slightest!


texts: Design IIR Butterworth filter using bilinear transform

texts: Write listing in MATLAB which design a low-pass IIR filter basis on Butterworth (Rp=2dB, Rr=40dB, fp=1000 Hz, fr=1300 Hz, fs=5000 Hz) as a prototype and using bilinear transform without built-in functions. Control the point(fr,Rr). Plot the response characteristic (linear scale, and dBs scale).


texts: Why does dot product return zero at non-harmonic frequency

texts:
If I understand correctly, dot product between two sinusoids should return zero if they are orthogonal. Since dot product is at the heart of the DFT, we can only clearly compare the frequencies that are multiples of the frequency from the equation: (sample frequency / number of samples). If our sinusoid is not a multiple of this frequency, we get spectral leakage. This all seems fine, but I can't understand why does the dot product return zeros at some non-harmonic frequencies as seen in the third example. Let's suppose we have the following:
Sampling frequency = 512 Hz
Number of samples = 512
Our fundamental frequency is then: 512 Hz/512 = 1 Hz, so our DFT bins would represent frequencies from 0, 1, 2, ..., N - 1.
Example 1:
sin1 = real sinusoid with frequency 5 Hz
sin2 = real sinusoid with frequency 5 Hz
Dot product with these two real sinusoids returns 256 as expected.
Example 2:
sin1 = real sinusoid with frequency 5 Hz
sin2 = real sinusoid with frequency 6 Hz
Dot product returns zero as expected.
Example 3:
sin1 = real sinusoid with frequency 5 Hz
sin2 = real sinusoid with frequency 5.5 Hz
Dot returns zero, but I don't understand why. Why do we get zero here instead of a non-zero number that would represent spectral leakage (as the second sinusoid is not a multiple of a fundamental frequency)?
Example 4:
sin1 = real sinusoid with frequency 5 Hz
sin2 = real sinusoid with frequency 5.75 Hz
We get non-zero value, so this works as expected as we get spectral leakage.
Is my understanding wrong?


texts: I am just wondering how does camera auto focus work. What kind of processing does it do on images in order to adjust the focus? Is there freely available code that detects the focus level of an image or video?


texts:
I have a filter designed in matlab with the function cheby2( N, Rs, Ws, 'stop'). The filter would give nice frequency response with for a given parameter set when the filter order is 2 or 4 (N=4). But if I increase the filter order to say 14 the magnitude plot of filter response is not at all smooth in fact in the stop band it gives very high gain instead of attenuation. Any suggesetion what is going on. What I should look at? Do you need any more information to access the problem. The parameters I am using are:
Rs = 40;
Wc = 0.2;
Wb = 1/128
Ws = Wc +0.5*Wb*[ -1, 1];


texts: Filter order vs number of taps vs number of coefficients

texts:
I'm learning DSP slowly and trying to wrap my head around some terminology:

Question 1: Suppose I have the following filter difference equation:
$$y[n] = 2 x[n] + 4 x[n-2] + 6 x[n-3] + 8 x[n-4]$$

There are 4 coefficients on the right-hand side. Are the "number of taps" also 4? Is the "filter order" also 4?
Question 2: I am trying to use the MATLAB fir1(n, Wn) function. If I wanted to create a 10-tap filter, would I set $n=10$?
Question 3: Suppose I have the following recursive (presumably IIR) filter difference equation:
$$y[n] + 2 y[n-1] = 2 x[n] + 4 x[n-2] + 6 x[n-3] + 8 x[n-4]$$

How would I determine the "number of taps" and the "filter order" since the number of coefficients differ on the left-hand and right-hand sides?
Question 4: Are the following logical if-and-only-if statements true?

The filter is recursive $\iff$ The filter is IIR.
The filter is nonrecursive $\iff$ The filter is FIR.


texts: Transfer function of a frequency shifting system

texts:
There is a system which shifts frequencies of input by $-F_c$ such that:

  $$Y(S) = X(S).H(S)$$

But $X(S)$ has value zero from $0$ to $F_c$.

I am confused on how the product of $X(S)$ and $H(S)$ becomes a positive value in $Y(S)$ in that frequency range, for any $H(S)$?

How transfer function of the system $H(S)$ will look like in the frequency domain?


texts: does ifft of higher order equal upsampling signal

texts: I have a signal with length 2000, and am taking an fft by 2048, after I perform analysis and some operation on signal in frequency domain I tried to convert it back to time domain. I received a signal length 2048, looking similar to what I would expect but not the same. I know that taking higher point fft simply generates more samples of the DTFT we would expect from the original signal, it does not add new information. However, when I take ifft my data length increases, I am assuming it must time domain interpolation between signal and output is same as if I would upsample my expected 1000 point signal (the operations I perform can be ignored, in my case if this is true for simply taking higher fft and then ifft of signal as is, then its true for me). I am not sure if this assumption is true, as I have yet to grasp how the IDFT works when length in frequency domain changes. I am performing analysis using MATLAB and am aware of the sampling rate and time. Can anyone please share some insight on if my assumption is true and any mathematical insight into it or point me to some freely available resource?


texts: Frequency resolution - resolution BW relation for different window functions

texts:
I am working on FFT based spectrum analyser and I am not sure how to proceed calculating the RBW.

According to the  document  (page 20) in the link, RBW described as $k \frac{f_s}N$ where $f_s$ sampling frequency, $N$ FFT size and $k$ is window coefficent.

Since $\frac{f_s}N$ is simply frequency resolution, is there a way to calculate $k$ coefficent for different window functions?

I tried to check the book in the references but I couldn't find the information.


texts: How to estimate covariance matrix using Fourier representation?

texts:
So, I have multidimensional time-series $X \in R^{(d \times T)}$, and I want to determine the covariance matrix of that signal in a specific frequency band.

I might filter the signal to that specific frequency band and do the usual $XX'$. However, if I assume the signal to be stationary, I might use the Fourier representation of the signal for a much efficient implementation, according to the Plancherel theorem

However, using only a subset of the Fourier coefficients (those corresponding to my frequency band of interest) for computing the covariance matrix, I get a super ill-conditioned matrix.

Does anybody have an idea about how to get around this (that does not involve regularization of the matrix)? or may any other tips on how to approach the problem from a different perspective? Thanks! :)


texts:
I am trying to get a rough estimate of a position of a hand through using backprojection on frames retrieved from a camera. I do not need perfect detection on the hand, but I can't really afford to get many false blobs. At night, my histogram works fine but at day I get a large amount of false blobs. The patch of skin I calculate the hist from is sufficient enough to provide enough information for the hist to work properly. I am using the YCrCb colourspace but have omitted the third plane to help improve detection in varying lighting conditions. I am using 30 bins for Y and 32 bins for Cr. I am also using a range of 0 - 255 for both. I have tried using several morphological operations, but the false blobs are too large to go away.

Does anyone have any suggestions on how I can remove false blobs? I can compromise on the detail of the positive detections (it can be a little blobby) but I need to remove most of the negative detections for my program to work. If this is not possible, does anyone have any suggestions other than backprojection on how to get a rough estimate of the position of the hand? (Haar or any other machine learning techniques are not possible). I cannot post code or a sample image. I am using the C++ API in OpenCV so please only suggest solutions that can be implemented in this API.


texts:
A BPM detection with FFT has been already highlighted on this site.

Would DWT do the job as well?

I've tried a Python script using DWT but it seems that the output is wrong, that is for the first 10 seconds of these songs I get respectively:

Blue Monday, New Order - 130 BPM
Mighty Oaks, The Great Northwest - 155 BPM

What I want to know in context of this site, whether DWT is generally a wrong method to extract BPM and why.


texts: How to remove dark shadows from camera capturing when combining LED spots and ambient light

texts:
I'm getting strange moving shadow strips on my camera capture during a computer vision experiment:

As the gif image above shows, those strips move to bottom slowly. I have also noticed that it happens only if I use a combination of ambient light and two 10 Watt LED spots aside the camera. Using only ambient light or only LED lights or ambient light plus a single LED spot the problem doesn't happen:

I'm using OpenCV to grab 320x240 images from the camera at 15 fps. The camera model is a Microsoft LifeCam Studio Q2F-00013. The 2 LED spots are like this one:

and power source is 220 volts at 60Hz.
I'm looking for a way to get rid of those shadows. Using v4l2-ctl I can see some camera controls to tune the camera:
$ v4l2-ctl -d 2 -l
                     brightness 0x00980900 (int)    : min=30 max=255 step=1 default=133 value=133
                       contrast 0x00980901 (int)    : min=0 max=10 step=1 default=5 value=5
                     saturation 0x00980902 (int)    : min=0 max=200 step=1 default=103 value=103
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2
      white_balance_temperature 0x0098091a (int)    : min=2500 max=10000 step=1 default=4500 value=4500 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=50 step=1 default=25 value=25
         backlight_compensation 0x0098091c (int)    : min=0 max=10 step=1 default=0 value=0
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3
              exposure_absolute 0x009a0902 (int)    : min=1 max=10000 step=1 default=156 value=156 flags=inactive
               pan_absolute 0x009a0908 (int)    : min=-529200 max=529200 step=3600 default=0 value=0
              tilt_absolute 0x009a0909 (int)    : min=-432000 max=432000 step=3600 default=0 value=0
             focus_absolute 0x009a090a (int)    : min=0 max=40 step=1 default=0 value=8
                 focus_auto 0x009a090c (bool)   : default=1 value=0
              zoom_absolute 0x009a090d (int)    : min=0 max=317 step=1 default=0 value=0

But sincerily I don't know where to start to tweak it in order to remove those shadows.
EDIT:
According to this power_line_frequency=2 means 60 Hz which indeed is the power line frequency here. Playing with exposure_auto/exposure_absolute also don't provide any improvement. The only setting which worked so far have been setting brightness to 173. Anyway, I don't know if increasing the brightness is actually a robust solution.


texts: Is a filter/control transfer function with positive phase "causal"?

texts:
In control we often use transfer functions with positive phase, i.e., a "lead filter" has transfer function

$$G_c(s) = \frac{\alpha \tau s+1}{\tau s+1}$$

(with $\alpha>1$). Since the zero occurs at a lower frequency than the pole, the phase is positive approximately beteen $\omega = 1/\alpha \tau$ (the zero) and $\omega = 1/\tau$ (the pole), with the maximum phase occuring at the midpoint $\omega = 1/\tau \sqrt{\alpha}$. Typically it's used to increase phase at a particular frequency $\omega_c$ for stability.

But how can a system with positive phase actually exist?
Does the positive phase at certain frequencies mean that if I remove the lead filter from the control loop and input a sinusoid, the output will occur before the input?
How is this related to causality and realizability?


texts: Transient and steady-state analysis for adaptive filter

texts:
I have got review for my work saying, that my work (adaptive filter variant) should be analyzed in transient and steady-state before claiming it improves performance.

I have done common (in my opinion) analysis:

prediction of linear system
prediction of non-linear system
prediction of real measured non-stationary data

How can I extend my analysis with transient and steady-state experiments? How the experimental data should look like?

Thank you in advance for any hint, note, reference or example. I am pretty sure that I am missing something basic.


texts: How can I find expansion coefficients of the y vector in a given basis?

texts:
Consider the following vectors in $\mathbb R^4$:

$$\mathbf{v}^{(0)}=\begin{bmatrix}\frac{1}{2}\\\frac{1}{2}\\\frac{1}{2}\\\frac{1}{2} \end{bmatrix} , \mathbf{v}^{(1)}=\begin{bmatrix}\frac{1}{2}\\\frac{1}{2}\\-\frac{1}{2}\\-\frac{1}{2} \end{bmatrix}, \mathbf{v}^{(2)}=\begin{bmatrix}\frac{1}{2}\\-\frac{1}{2}\\\frac{1}{2}\\-\frac{1}{2} \end{bmatrix}
\mathbf{v}^{(3)}=\begin{bmatrix}\frac{1}{2}\\-\frac{1}{2}\\\frac{-1}{2}\\\frac{1}{2} \end{bmatrix}
$$

Let $$\mathbf{y}=\begin{bmatrix}0.5\\1.5\\-0.5\\0.5\\\end{bmatrix} \text,$$

what are the expansion coefficients of $\mathbf{y}$ in the basis $\{\mathbf{v}_0, \mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\}$?


texts: Confusion about systems involving integrals

texts:
$$y_1(t)=\int_a^tx(τ)dτ$$
$$y_2(t)=\int_a^bx(t)dt$$

I'm confused about what are the input signals in each of these systems.

To my understanding, in the second case the input signal is $x$ since both $y$ and $x$ are functions of $t$.

However in the first case we see that $t$ is an upper limit of an integral, so I thought that in fact the input signal is not $x$ but $X(t) =\int_a^tx(τ)dτ$. That would make $y_1$ an identity system as $y_1(t) = X(t)$. That doesn't seem correct. Is this a notational problem or is my logic flawed?


texts:
I apologize if this is not the appropriate site or the appropriate type of question, but I didn't know where else to ask. If it is, please inform me to delete the question.

I took a year in college and wasn't ready and so did horribly. However, A couple of years later now I am definitely ready to go back. I've been self-studying mathematics and a bit of programming and plan on starting to study more in depth topics in computer science. My plan is to go to a community college for a year or two then transfer to Rutgers to get an M.A. in mathematics while self-studying computer science in particular machine learning and computer vision. My question is this. Is this at all practical. What are the chances of success? I don't want to put all my eggs in one basket and end up failing because of a questions that I could have asked now and have to end up working as a cashier at McDonalds for the rest of my life. If you can offer me any advice it would be greatly appreciated.


texts:
I found the subject at here like this "Does clipping noise colour the spectrum"
When I researching for clipping noise.
But I can't understand because typically something has clipped means something has removed.
But he has some different point of view about this.
so I want to know what is the clipping noise and how to undertand the posing about "Does clipping noise colour the spectrum"?
update
Especially, I want to know the meanning  about clipping gaussian noise.
Especially this part
IV. CLIPPING (CENSORING)
A. Clipped observations model


texts: Is a DC signal 0 frequency or extremely high?

texts: If I pass a signal with DC component through a Low Pass Filter will the output be without the DC component?


texts:
I am interested in tracking how the phase of a signal at a particular frequency changes over time.

The method I am using calculates a series of STFTs and takes the arctangent of the imaginary and real components of the desired bin for each FFT, however, due to noise in the system I am having issues with phase unwrapping.

Are there any alternate and perhaps more robust methods of extracting phase from a signal in this manner?

Thank you


texts: Inverted values - digital resolution issue?

texts:
first of all, I am not a technician, but I would really appreciate your helping with one (I hope simple or trivial) issue. I recorded a signal (skin conductance level - SCL, uS unit) with my device - 16 bit, range of the measured SCL is 1-20 uS.

In a recording software I changed digital upper range - "digital maximum" - from 1024 to 65536 (minimum = 0).

The issue is that when I record the signal and the signal reaches about the half of the physical maximum (the range the device can measure SCL = 1-20uS), from the recorded signal I see something like "inverted-across-zero" values, they have negative values but as it is from oscilatory parts obvious, when the signal is lower than the bound about 10,5 uS then it is above zero value, when it exceeds 10,5 uS it become inverted and the values are (deposited) under zero axis.

Can this "phenomenon" be caused due to my stupid change of digital maximum to 65536?
Thank you for any help!

M.


texts: Should I filter before calculating power, if I'm looking for relative changes in power?

texts: I am building a "scanner" sort of program, which reads IQ samples from an rtl-sdr stick, and keeps track of the power on certain frequencies, in certain bands.  I am interested in detecting activity on frequencies, which I do by looking at changes in power.  Since I'm simply calculating changes over time, can I get away with not filtering the data before calculating power, or is there some reason I should filter?


texts: When using a sequential neural network to classify signals with their frequency spectrum, we would need to normalize the length of the signals to perform vectorization. The only method I'm aware at this point is zero padding. Does zero padding have any disadvantages? If so, are there any alternative methods to that?


texts: Gaussian noise generation for a given SNR ?

texts:
I am trying to add a Gaussian noise, normal distributed to a signal I have simulated (sig_noiseFree), to get a noisy signal (sig_noisy). lease see the code.

I wrote the function my self according to what I understood. Can please anyone confirm that I am doing this right ? especially the noise addition and SNR calculation ?

I have a second question : I understand that the variable "k" controls the noise level, how can I set the SNR and generate the suitable k so I get the noisy signal with the SNR wanted ?
Thank you in advance.

def SNR(sig, noise,dt):
    Signal = np.sum(np.abs(np.fft.fft(sig)*dt)**2)/len(np.fft.fft(sig))
    Noise = np.sum(np.abs(np.fft.fft(noise)*dt)**2)/len(np.fft.fft(noise))
    return (10 * np.log10(Signal/Noise))

def Gauss_noise(k,sig):
     return np.random.normal(scale=k*np.max(sig), size=len(sig))

def noisy_sig(sig,k, dt):
    return np.fft.ifft(np.fft.fft(sig)*dt+np.fft.fft(np.random.normal(scale= k*np.max(sig), size=len(sig)))*dt)/dt

def main(argv):
    k = 2e-2
    noise_g = Gauss_noise(k,sig_noiseFree)
    sig_noisy = noisy_sig(sig_noiseFree,k, dt)

if __name__ == "__main__":
main(sys.argv)


texts: What Is the Algorithm Behind Photoshop's "Black and White" Adjustment Layer?

texts:
Can someone explain the algorithm behind the "Black and White" adjustment layer in photoshop?

I have to reproduce it using C++ for an application that emphasizes non-red/magenta(ish) pixels from an image (with a percent-like configurable tolerance), and this resource showed the behavior I'm expecting.

Still couldn't reproduce it, but I found a clue:

Each pixel is defined by up to two controls, one additive (RGB) and one subtractive (CMY).


texts:
I'm trying to find some mathematical docs about the complex (analytic signal) band pass filtering in discrete time. I've read some text already but most of them describes the problem in real time only.

I would really appreciate some equations.

[EDIT:]

I found this coefficients' computation equation for real signals:

$$
w_{bp}(n) =
\begin{cases}
\displaystyle\frac{\sin\left[2\pi f_{t2}\left(n-\frac M2\right)\right]}{\pi\left(n-\frac M2\right)}-\frac{\sin\left[2\pi f_{t1}\left(n-\frac M2\right)\right]}{\pi\left(n-\frac M2\right)},  & \text{if } n \ne \frac M2 \\[2ex]
2\left(f_{t2} - f_{t1}\right), & \text{if } n = \frac M2
\end{cases}
$$

I know I have to specify the FIR filter order ($M$) which is approximately 4 / Normalised width of transition band. The application of the filer is a simple convolution of the coefficients computed by the equation above and real signal samples.

Now what I need to know is how to achieve this in complex plain. I also found a similar thread here, which describes the low pass filter design.

PS: I already have my complex $f_c = 5 \textrm{ kHz}$ signal sampled at $f_s = 32\textrm{ kHz}$ and I'm familiar with the complex plain problematics.


texts: Choosing inverse Z-transform equation, given that $|a|<1$

texts:
Given that $|a|<1$, then which of those inverse-Z-transform equations are we to use?

I am leaning towards the first because (as I understand it), $z$ is merely a complex number that is evaluated on the unit circle, and thus $|z|$ must always equal 1? I guess my question is, when is $|z|=1$? Always?


texts: Object for storing multiple trials of EEG MNE-python

texts:
I'm new to EEG and MNE.
I'm looking for an MNE object to store data from many trials (trails * channels * times). I've noticed that I can use Epochs for that, and it works ok, but I wasn't sure if that's what epoch is made for. If not, what is the purpose of Epochs? And is there another object for saving data of many trials?
Thanks in advance!


texts:
I am trying to understand the meaning of the term Stationary Process.
For example, I was told that $\sin(t)$ is a stationary process.

Could someone try to explain, in simple words, why is $\sin(t)$ (for example) is a stationary process?


texts: LPF - signal values unaffected at specific times

texts:
Is it possible to design an LPF that has an output identical to the input at specific points in time domain (the rest of the input waveform can get filtered/distorted)?
Is there a general name/technique for this kind of thing (assuming it is possible), so that I can search for more information on this topic?


texts: Proper way of representing Static, delta, delta delta in a plot

texts:
I am currently working on recreating the result of this
paper. The paper is about applying cnn in speech recognition,
in which cnn is used to for feature extraction, for which a proper way of representing the feature is needed such that it can it easily can detect them.

On page 3 section III subsection A : Organization of the Input Data to the CNN

Is it stated that the how the in paper are representing the input data,  they use there so-called MFSC features, which are MFCC features without the DCT performed.
It is then on next page stated that they make use of the static, delta and delta delta and plot
them next you each other for each frame as such [Static Delta Delta Delta], and create a spectogram of this.

  There exist several different alternatives to organizing these MFSC
  features into maps for the CNN. First, as shown in Fig. 1(b), they can
  be arranged as three 2-D feature maps, each of which represents MFSC
  features (static, delta and delta-delta) distributed along both
  frequency (using the frequency band index) and time (using the frame
  number within each context window). In this case, a two-dimensional
  convolution is performed (explained below) to normalize both frequency
  and temporal variations simultaneously. Alternatively, we may only
  consider normalizing frequency variations. In this case, the same MFSC
  features are organized as a number of one-dimensional (1-D) feature
  maps (along the frequency band index), as shown in Fig. 1(c). For
  example, if the context window contains 15 frames and 40 filter banks
  are used for each frame, we will construct 45 (i.e., 15 times 3) 1-D
  feature maps, with each map having 40 dimensions, as shown in Fig.
  1(c). As a result, a one-dimensional convolution will be applied along
  the frequency axis. In this paper, we will only focus on this latter
  arrangement found in Fig. 1(c), a one-dimensional convolution along
  frequency

I tried doing this but seem to get a pretty weird spectogram..

Here is only the static:

and Here is [static delta delta delta]

I would expect it be a bit different, but not this much.. it looks like the data is placed incorrectly, or is it supposed to be like this?


texts:
If x(t) is the curve shown in the image

how can I find (x(2t)+x(2t+2))?

I know how to find the individual terms but don't know how to add them!

And how can I express my answer in terms of the unit step function?


texts: how gabor filter is used on image texture edge detection

texts:
as I searched gabor filter is most used tool on texture analysis and edge detection in digital image. its said that it searches a certain frequency as a texure around a pixel or point to find the texture. I cant really understand it well. as I know frequency in digital image is sign of change in grayscale change. high frequency has high change in grayscale so a highpass filter finds the edges but I cant understand a filter like gabor can find a special texture.

thank you for helping


texts:
I know the snr after  μ-law compression is
$\text{SNR}\approx\frac{3L^2}{[\ln(1+ \mu)]^2}$
when  $\mu \gg \frac{\max_t m(t)}{\text{rms}(m(t))}$,
where $m(t)$ is the message signal, and
$L$ the number of levels.
Can anyone give the idea how it came or the proof?


texts: Are ACF plots sufficient to detect white noise assuming probable existence of non linear associations?

texts: ACF plots use autocorrelations tests to determine associations in time series. Autocorrelations, however, only measure linear associations. To my understanding, certain non-linear associations can exhibit zero autocorrelations. Therefore, can there be a scenario where an ACF plot that is considered to reflect white noise be actually representative of non-linear associations? In other words, are ACF plots sufficient for determining whether a signal is a white noise?


texts: what is in intuitive explanation of local derivative pattern (LDP)?

texts:
Zhang et al. proposed the LDPs for face recognition . They considered the LBP as the nondirectional first-order local pattern operator and extended it to higher orders ( th-order) called the LDP.

is there an intuitive explanation of this definition? i need your help.


texts: For a random signal $x(n)$, why is  $E(x(n)^2)$  called signal power? Is it really power? Any proof?


texts:
If I have a signal x(t) as follow

x(t)=$\sum\limits_{k=-∞}^∞ R_{T}(t-2kT)$

$R_{T}(t) = \begin{cases}1 ;&[\dfrac{-T}{2},\dfrac{T}{2}] \\ 0; & \text{otherwise} \end{cases}$

$\mathfrak{F}\{R_{T}(t)\}=Tsinc(\pi fT)$

$H(f)= \begin{cases}1 ;&|f| \le \dfrac{3}{4T} \\ 0; & |f| \ge \dfrac{3}{4T} \end{cases} $

$Y(f)=\dfrac{1}{2}\delta(t) + \dfrac{1}{\pi}\delta(f-\dfrac{1}{2T}) +\dfrac{1}{\pi}\delta(f-\dfrac{1}{2T})$

Can Some one Please Help me in how X(f) will Look Like graphically . I am just Poor in the graphical representation of how X(f) multiplied With H(f) to obtain Y(f).
Please this is not a home work question but i really need to know to move forward.i tried a lot but i just don't get graphical representation in frequency domain.
thank You.


texts:
Are transmit diversity signal and the multi-path signal same? Multi-path contains LOS+delayed and attenuated/distorted versions of it and transmit diversity signal contains LOS1+delayed LOS2+ +delayed and attenuated/distorted versions of the two.

Kindly, elucidate in terms of the impact of each type of signal on the equalization used at the receiver.

Thanks, JK


texts:
I am studying wavelet transform. In the matlab in the "wavemenu" package, I use "SWT denoising 1-D". I loaded my signal, performed a Haar 5 wavelet squelch. I got a good result.

I can't figure out how should I use Haar wavelet squelch on a microcontroller? I have not found an example of translating matlab code into c code. Can anyone explain how I can implement wavelet noise reduction in simple formulas?
For example, I use fdatool in matlab to implement digital filters. With fdatool I can get a, b and gain. And then I use them to implement the digital filter I need:

C code:
x[2]=x[1];
x[1]=x[0];
x[0]=sig*gain;
y[0]=(b[0]*x[0] + b[1]*x[1] + b[2]*x[2] - a[1]*y[1] - a[2]*y[2]);
y[2]=y[1];
y[1]=y[0];

Can someone provide an example of how to implement Haar wavelet noise reduction using simple formulas or from c code?


texts: Classifying motor imagery from EEG data: Feature selection

texts:
I am an undergraduate student who is trying to classify motor imagery from EEG data!

I have no experience working with EEG or any neuroscience background, I only have a very basic knowledge of how EEG, ERD/ERS and frequency domain work from the papers I've tried to read but don't understand and the basic idea of what they are doing. I also have a reasonably basic knowledge of supervised Machine Learning.

I plan to use ERD/ERS to classify Left foot, Right hand and rest to classify motor imagery in real time!

What is the easiest way to do feature selection on EEG data for ERD/ERS?

So far I have bandpassed the data between 7-30 Hz for Mu and Beta wavelengths as they are the ones related to the motor imagery as well as removing the baseline and just plotted the Power Spectral Density. I passed this data through a basic SVM; linear and gaussian, optimised parameters with poor results (60% accuracy on average). From this graph, I'm not sure how I can extract the features that define each catergory.

I don't know how to do feature extraction and where to start learning the basics.

If someone could guide me and provide the steps on how to proceed I would extremely grateful!

I want to work in the field of Brain Computer Interfaces as I find it fascinating, this is my first step :)

Here is the link to the dataset and its details BCI competition: IVc


texts:
I'm trying to wrap my mind about what happens in Matlab/Octave when you compute the fft of a sine function. Theoretically, the Fourier Transform of a sine is given by two delta functions multiplied by the imaginary unit (one placed at the frequency of the sine and another at minus the frequency). I can see that in the modulus of the FFT (not exactly a delta because of the frequency leakage due to the windowing), but when I check the phase I get a signal that is non-zero over all the support (from 0 to the sampling frequency). I'm playing with this toy example in Octave:

fs = 200,t=-10:(1/fs):10;
x = sin(2*pi*30*t);
f = linspace(0,1,length(x))*fs;
fourierTrans = fft(x);
figure,plot(f,abs(fourierTrans))
figure,plot(f,angle(fourierTrans))

And the picture I get for the phase is:

Why is it that I don't see two deltas in the picture for phase of amplitude pi/2 and -pi/2?

Cheers


texts: Count the number of times the phone rings before its answered

texts:
I have a dataset of phone recordings that I'd like to do some characteristic-level analysis on.  The audio is sampled at 44khz stereo, with each channel containing the signal from one party in a conversation.

I would like to start by counting the number of time the call rings before the phone is picked up.  I believe this to be simple, but am a little lost, so any pointers in the right direction would be much appreciated.  I believe I need some sort of a matched filter, or maybe a bandwidth filter.  The signal is generally clean -- I have attached a couple of graphs of the signal.

General solutions are appreciated, but I will be doing this in python so anything specific to that would be extra appreciated.

Additionally, if you have other ideas for extracting features using signal characteristics, I'm all ears (eyes).


texts: Problem using pitch shifting with TD-PSOLA and formant preservation

texts:
I tried out this implementation of TD-PSOLA (https://github.com/sannawag/TD-PSOLA) and even though I know how the algorithm works, I can't understand why I get NO audible differences in the output when using f_ratio = 0.5, given that f_ratio = f_new/f_orig.

I've tried printing the length of 'peaks' (that would be the total number of peaks) arrays from both, the original signal and the new signal, by using find_peaks() again after shift_pitch() returns the output. I got these results:

f_ratio                            #orig_peaks                    #new_peaks
1                                    417                            416
0.9                                  417                            389
0.8                                  417                            403
0.7                                  417                            396
0.6                                  417                            324
0.5                                  417                            404

This looks completely nonsense to me.

I've already tried using another windows (numpy's Hamming, Hanning). Of course, it has to have something to do with the overlap-and-add process...right?

Any help would be greatly appreciated.


texts:
for the (7,4) Hamming code, I know how to decode a codeword using the syndrome decoding method, by just using the 3 parity bits, and it is correctable if there is just 1 error.

However, for the (8,4) extended Hamming code, I know how to decode the codewords correctly when there is no error or 1 error respectively. However, can we do that for the case of 2 errors?


texts:
I'm trying to simulate a multipath channel to see how it would affect my signal. So considering my channel is LTI, I can model it as an FIR filter. I've been reading Telecommunication Breakdown and looking at some examples and there's one thing I don't quite understand in page 183 (Chapter 9: Stuff happens, Section 9.4: Other Impairments: "More What Ifs")

if cdi < 0.5, % channel ISI
    mc=[1 0 0 ] ; % distortion−free channel
elseif cdi<1.5 , % mild multipath channel
    mc=[1 zeros (1 ,M) 0.28 zeros (1, 2.3*M) 0.11 ] ;
el se % harsh multipath channel
    mc=[1 zeros (1, M) 0.28 zeros (1, 1.8*M) 0.44 ] ;
end

So cdi is a parameter to choose between distortion-free, mild or harsh multipath channel and mc is the resulting FIR filter. What I don't understand is:

What's the point on inserting zeros in between?
How does that make it mild or harsh?

Would you mind explaining that to me? Thanks


texts: Effect of sign change on ROC & z transform?

texts:
When we take ztransform of unit step it is z/[z-1]
And our ROC is |z|>1
But if some how the minus sign between z and 1 changes to +, will our ROC still be same as old ( |z| >1 ) or will it be opposite?

Secondly the ztransform and ROC of u(-n) and u(n) are same or not?


texts:
I am trying to demodulate a captured 5g signal using matlab.
But it is likely that the 0-phase time point for each symbol lays between two samples,
which results in a minor phase shift, and such phase shift changes linearly across the spectrum.
How should I eliminate this phase shift?
I cannot find a clear answer on the web how phase alignment is done in the standard.
Is it done using the PSS & SSS?
How often the alignment is done? Once per frame/slot/symbol?


texts: Is spectral density sometimes normalized by sampling rate rather than bin size?

texts:
I'm a scientist conducting an experiment that requires some signal processing. My expertise is not in signal processing, thus here I am. We've basically re-created an experiment conducted by other scientists, attempting to check their results. Here is a link to their paper: Ultrasensitive Inverse Weak-Value Tilt Meter
In short, a laser bounces off of some mirrors, one of which is oscillating at a controlled sinusoidal frequency, onto a quadrant detector, which outputs an electrical signal to an oscilloscope where we record it. So, you end up with a noisy record that has a tiny, known sine wave hiding in it.
Everything I've read indicates that to calculate spectral density, you must:

Get the spectrum by performing an FFT* on the record
Normalize the spectrum by the bin size, which is sampling rate divided by number of samples (Fs/N)

*For clarification, when I refer to an FFT, I'm referring to the single sided, absolute value, of the FFT, normalized by the number of sample points, N. So, we took the FFT of the signal, threw away the negative frequencies, doubled the positive frequency values (except DC and Nyquist), and divided by N. I checked this method by feeding signals directly from a function generator to the oscilloscope and verifying that the resulting peaks matched the frequency and amplitude of the inputs.
But, in the paper linked above, they seem to have normalized their spectrum by sampling rate only. I say this because at the top of the first column on page 3, they point out that the sampling rate is 1 kHz, and in the footnote on page 3, they point out that the peak in their spectral density plot (Figure 4) is 1.6 nrad / sqrt(1kHz). They make no mention of bin size or number of samples (N). Since I'm trying to directly compare my numbers to theirs, I need to know definitively what is going on here. Are there two definitions for spectral density? Thanks in advance.


texts: How to calculate step and impulse response at multiple sampling rates

texts:
I'm struggling with a basic concept.  Suppose I have a system $y(t)=e^{-at}u(t)\ast x(t)$ and I want to plot impulse response and step response using Matlab conv() function at various sampling rates.  I'm having trouble understanding what gain I should apply and why.  I tried:

a = 0.05;
cutoffTime = 250;
T = 1/samplingRates(i);  %assume this is defined somewhere [1, 10, 20]
timeRange = 0:T:cutoffTime;
step = ones(1, length(timeRange));
impulse = zeros(1, length(timeRange));
impulse(1) = 1;
exponential = exp(-a*timeRange);
stepResponse = conv(exponential, step, 'full');
impulseResponse = conv(exponential, step, 'full');

I understand that mathematically sampling is modeled as multiplication by a pulse train, which introduces gain of $1/T$ to the discrete system.  So the reconstruction filter needs gain of T.  In the above code, for different sampling rates (say 1, 10, 20 samples/second) if I don't apply the gain of T to step response, I get different sized step response.  However if I apply the gain T to impulse response, I don't get the impulse response I expect for all 3 sampling rates.  Can anyone clarify where I'm going wrong in my implementation?

Thank you.


texts: maximum contrast using linear gery-level trasformation

texts:
this was a question i found online.

given an image with values between [0,1].
how can I get the maximum contrast using linear gray-level transformation?
something like I(x,y)=A*I(x,y)+B , where I is a histogram.
we are also given MAX(I) and MIN(I).

as far as i can understand.
MAX(I) and MIN(I) will give you the values you have now and you wan to stretch the values into 0 and 1.

but how will this give me a linear equation?


texts: Proof for determining Fourier coefficients

texts:
While determining Fourier coefficients we have this equation
$$\int^{T}_{0} x(t) e^{-jn\omega_0t} dt = \sum^{+\infty}_{k\ =\ -\infty} a_k [\int^{T}_{0} e^{j(k-n)\omega_0t}dt]$$

I want to ask that how can we get final equation of $a_n$ as:
$$a_n= 1/T \int^{T}_{0} x(t)e^{-jn\omega_0t}dt$$  from the above equation.
please any one help to explain this


texts: Group delay plot of a Moving average filter

texts:
I am implementing the moving average filter in Matlab. Using fvtool on this filter, gave the following output curve, is this group delay curve correct?

Edit:

My confusion is regarding the values of the delay output as well as the constant nature of the curve.

I implemented the filter using 'FilterDesigner' tool in matlab
(In which, filter dimensions can be specified in the GUI, which then handles the code itself) Attaching a screenshot of the tool window with filter parameters.

After which I exported this filter as an object called 'Hd'

To plot the filter, I did -
fvtool(Hd)

Which resulted in the curve above (figure 1)


texts: Removing Noise from time across signal data

texts:
I am new to the field of signal processing. I have sensor data (Impedance across time), that output is like this.

On the right side, I have a noisy signal portion in my data, marked by the red block. I want to remove this noise, its a hand movement artifact noise.

How can I remove this noise?

I have tried to find the frequency of the noise by applying FFT on the data file attached below but I got this result

Data file


texts: How can I change the frequency band ($\tt Fb$ parameter) using $\tt cwtft$?

texts:
MATLAB's implementation of cwt uses the complex morlet wavelet as:

psi(x) = (pi*Fb)^(-0.5)*exp(2*1j*pi*Fc*x)*exp(-(x^2)/Fb);

However, it is possible to implement the cwt in the Fourier domain (cwtft). In this case, MATLAB uses a slightly different version of the Morlet wavelet:

psi = (pi^(1/4)).*exp(2*pi*1j*t)*exp(-(t.^2)/2);

The question is: how can I change (or insert) the frequency band parameter in the cwtft version?

Would be something like:

psi2 = (Fb*pi.^(1/4)).*exp(2*pi*Fc*1j*t).*exp(-(t.^2)/(Fb*2));

if yes, how is the Fourier version of psi2 (because the implementation takes the fourier transform of psi2)?


texts: Relation Between Compressed Sensing and Incoherence

texts:
I am working on CS. I know that as coherence decreases (or incoherence increases) compressed sensing results improve. I know how to calculate the coherence, but I can't find an exact equation between incoherence and compressed sensing. I would like to know the equation relating coherence and CS with lower and higher limits.

Thanks in advance.


texts: When is a discrete time transfer function unrealizable?

texts:
I don't understand why the following makes sense:

Given a second-order mass damper system in continuous time:

$H(s) = \frac{1}{ms^{2}+cs}$

Its inverse $H^{-1}(s)$ is unrealizable as a transfer function $G(s) = \frac{Y(s)}{U(s)}$ has a state space realization if and only if the degree of $Y(s)$ is less than or equal to the degree of $U(s)$.

However, the zero-order hold (ZOH) equivalent of $H(s)$ given by:

$H(z^{-1}) = \frac{z^{-1}(b_{0}+b_{1}z^{-1})}{1+a_{1}z^{-1}+a_{2}z^{-2}}$

has a realizable inverse $H^{-1}(z^{-1})$ as its degree in the denominator and numerator is equal.

How does this make sense?

I have read that when designing a disturbance observer, we need a $Q(z)$ filter such that $Q(z)G^{-1}(z)$ is realizable as $G^{-1}(z)$ will not be.


texts:
I am working on lane detection system and I would like some suggestions from you as to how to detect lanes from a filtered image which I got after performing certain operations. Firstly, I should mention a few things:

The lane detection would be in a real road environment unlike here.
As of now, I am running it in real-time (O(n)) to be precise, which I would like to maintain.

The following image shows the original image and my filtered image.

As you can see, there are false positives which I want to remove and that is my main problem. Now, these are the few approaches I have thought of:

Check the intensity on the left and right hand side for desired areas. It should be high for desired area and low on both sides.
**Problem: I am finding it difficult to define 'high' and 'low' since the method has to be independent of time of the day.
One approach I thought was to check shapes but I can't think of any algorithm since those are not rectangles, those are essentially distorted parallelograms(?).

One more, I have seen people generate lines on these type of images using hough, this same question does that. If I run hough, I am not getting lines. Is the intensity of the image a problem or should I run Hough on binary mask image? I am currently doing this with MATLAB but I will be finally implementing with OpenCV to keep it real-time.


texts: Solution verification for this Fourier series problem

texts:
We have a signal with period $T = 2$

We want to find the continuous time fourier series for this signal.
Since $T = 2$, $\omega = \pi$. All we have to do know is find the frequency domain.
$$x(t) = \sum_{k = -\infty}^{\infty}X[k]e^{-i \omega tk}$$
$$X[k] = \frac{1}{T}\int _{T}x(t)e^{i \pi tk}$$
$$X[k] = \frac{1}{2}\int _{2}x(t)e^{-i \pi tk} = \frac{1}{2} \left( \int _{0}^{1}\frac{3}{2}e^{-i \pi tk}dt  + \int _{1}^{2}\frac{-3}{2}e^{-i \pi tk}  dt \right)$$
$$X[k] = \frac{3}{4} \left( \int _{0}^{1}e^{-i \pi tk}dt  - \int _{1}^{2}e^{-i \pi tk}  dt \right) = \frac{3}{4} \left( \frac{-1}{i \pi k} \right)\left( e^{-i \pi k} - 1  - e^{-2i \pi k} + e^{-i \pi k}
\right)$$
$$X[k] = \frac{3}{4} \left( \frac{-1}{i \pi k} \right)\left( (-1)^k - 2\right) \text{(Because k can only be an integer)}$$
This to me is correct... however the answer is actually
$$X[k] = \frac{e^{-j\frac{k\pi}{2}}3\sin(\frac{k\pi}{2})}{k\pi}$$


texts: Predicting account balance based on historical data

texts:
Given the values of a bank account balance over time (see figure below as an example), how can one predict the account balance at a given date in the future ?

Should I just fit one linear regression model to the values of the i'th day of each month, in order to predict the value at the i'th date of future months ?


texts: Line tracing folowing a path of an almost connected components

texts:
say we have a binary image like the one in below

i would like to extract each black line, even if it's not almost connected

i have marked here in red, example of lines that correspond to those to be extracted

**the purpose here is to extract lines a handwritten text ! **

any suggestions !! Thanks


texts: Questionable Eb/N0 results for different modulations - measurements for 8-PSK do not match the theory

texts:
I would like to warn you that this post will be long, so thank you in advance to everyone who reads it and is able to help.
I am running a certain simulation. I created a measurement environment (transmitter and receiver project) where I send 1000 packets from the transmitter that the receiver should, well, receive. I run the simulation using three modulations: BPSK, QPSK and 8-PSK. Now the measuring thing - the transmitter stands still, and the receiver is systematically moved away from the transmitter by 2, 3.5, 5, 7, 10, 13, and 15 meters (I had to choose such distances because I run the simulations at home, I did not have any better environment [below I will post a picture of my environment]). Simulations are run in what is called "free space".
I always set the same parameters on the transmitter and receiver (only the antennas power are d) - in this case:

the carrier is set to: 2.4375 GHz
bandwidth (IQ sampling rate): 1MHz

On the transmitter and receiver side. Only the Tx gain is set to 10 and Rx gain to 23. The symbol rate on transmiter depends on bandwidth and is calculated as 125k symbols/sec if set to 1MHz.
I ran simulations for three different bands 1Mhz, 500kHz and 250kHz. As can be inferred, the 8-PSK modulation performs best with throughput, and this is also confirmed by the results of the measurements (example results for 1MHz band):

As we can see, 8-PSK performs slightly better than the other modulations, and BPSK is the most inefficient in this case.
The problem begins when comparing $E_b/N_0$ values for these modulations. In this case, shouldn't the $E_b/N_0$ for 8-PSK be lower? Meanwhile, it continues to perform the best:

And it's not the case of band, because for 250kHz and 500kHz 8-PSK has still highest $E_b/N_0$ ratio. From what I have found out, at constant bandwidth (and power) my receiver divides the transmit power on three times as many bits as BPSK and $E_b/N_0$ should be reduced. In my case it doesn't. 8-PSK has still the best $E_b/N_0$ and I wonder what is the reason for that and where's the problem.
Below is a picture of my measurement environment (simplified), a part of my house (of course, when simulating measurements in the free space, all doors were open and the transmitter and receiver could "see" each other)

The measurements were in a straight line (red line) at the distances given above. Site 1 Antenna is the transmitter.


texts: Calculate Collision force using Audio Signal

texts:
I am having an audio sample hitting an aluminium object (a small piece of hard ball 200g) at varying speed.

I am trying to calculate the amount of force the object is hitting with using the audio signal to find the amount of damage its causing to the aluminium

I am able to find any direct or indirect method to calculate that. I am not sure if its easy do it.

Any leads/directions?


texts: Help regarding property of unit impulse function

texts:
We know that using properties of unit impulse function it can be shown that

$$\int_{t_1}^{t_2} x(t) \delta^{(n)}(t-t_0) dt=(-1)^nx^{(n)}(t_0),\quad t_1<t_0<t_2$$ (source: Continuous and Discrete Signals and Systems- Soliman)

But what would be the case for the problems like these
$$\int_{-1}^{2}(3t^3+9)\delta''(t+1) dt$$

I've tried in this way:

$$\int_{-1}^{2}x(t)\delta''(t+1) dt=\\ \big[x(-1)\delta'(t+1)-x'(-1)\delta(t+1)\big]_{-1}^{2}-\int_{-1}^{2}x'(t)\delta'(t+1)dt$$

can't figure out the first part inside the third bracket.


texts:
I need to design a high pass FIR filter based on parameters given. However I'm stuck at which window i should select. How do I calculate the parameter M?

The guide I referred myself to was behind this link: https://www.allaboutcircuits.com/technical-articles/design-examples-of-fir-filters-using-window-method/


texts: what do we mean by frequency flat block fading channel model?

texts: I need to understood from MATLAB point of view about frequency-flat and block-fading channel model, where the channel hold unchanged within the channel coherence time but may vary in different coherence intervals independently. Thanks in advance..


texts: What is the relation between windowing and hopping in audio DSP

texts:
While using short-time Fourier transform (STFT), it is common to use window function, usually tapered.

Will this not alter the original signal $x[n]$ and the STFT may no more be the true STFT of $x[n]$?
Also, what is the concept for sliding the frames not by $100\%$ of its width but a fraction of that? i.e, why should frames hop in small steps (for $75\%$ overlap, frames hop by $25\%$). Is there a conceptual explanation with as little math as possible?


texts: What is the relationship between signal and its analytical version?

texts:
Hilbert transform is used to transfer signal into analytical signal. But why after the transform, the envelop and instant frequency (if the signal is monogenic) can be calculated. What is happened in the transform? What is the relationship between these two signals?

BTW, according to wiki page analytic signal is

  In mathematics and signal processing, a signal which has no
  negative-frequency components is called an analytic signal

why to use Hilbert transform, instead of Fourier transform to calculate analytical signal? Is there a special reason to do so?


texts: Phase of an image in the frequency domain

texts:
The following picture is amplitude and phase of an image filtered using Gabor filter in the frequency domain. I'm trying to reproduce the results, I'm getting valid results for the amplitude I think, but I'm struggling with the the phase, I'm just getting a noisy image that does not resemble the picture. I'm referencing this paper 2

My code looks roughly like this (Python + OpenCV):

# DFT of the source image
dft = cv2.dft(...)
# DFT of the Gabor filter
kernel_dft = cv2.dft(...)
filtered = dft * kernel_dft # using cv2.mulSpectrums()
image = cv2.idft(filtered)

image is then complex array so i use cv2.cartToPolar() to extract magnitude and phase.

But I'm struggling what the following paragraph exactly means (from the paper):

  The resulting spatial frequency band is localized in space, scale and orientation (see [Portilla and Simoncelli 2000] for filter design steps). The transfer functions of a complex steerable pyramid only contain the positive frequencies of the corresponding real steerable pyramid’s filter. That is, the response of 2 cos(!x) = e^(iwx) + e^(iwx) is e^(iwx) so that there is a notion of both amplitude and phase.

I'm not sure how to proceed, as I'm not an expert in this matter, so if anybody could offer some clarification I'd be very happy.


texts: Why does the high frequency component of an image contain more noise?

texts:
I am working with wavelet transforms. When we apply a discrete wavelet transform to an image, it decomposes into four components named the approximation component, thevertical component, the horizontal component, and the diagonal component.

These components are indicated as LL, HL, LH, HH respectively. I understand how an image is decomposed by using a wavelet transform, but I don't know why generally in an image high frequency component contain more noise.


texts: Understanding Parseval's Theorem with Discrete Wavelet Transform

texts:
I have difficulty to understand the results I get with implementing Parseval's Theorem in Python to DWT. I have the good results getting the Energy with Fourier transform and the time series in python:
# Parseval theorem energy
def ParsevalTheorem(data):
    energy_sum = 0
    for i in range(len(data)):
        energy_sum += abs(data[i])**2
    return energy_sum

# dwt_data[0] => approximation component at final level, dwt_data[1:] => detail components
def DWTParseval(dwt_data):
    details_sum = 0
    for i in range(len(dwt_data)-1):
        details_sum += ParsevalTheorem(dwt_data[i+1])
    approx_sum = ParsevalTheorem(dwt_data[0])
    final_sum = approx_sum + details_sum
    return final_sum

fourierTransform = np.fft.fft(short_signal)
print("fourier energy: ", ParsevalTheorem(np.abs(fourierTransform))/len(fourierTransform))
print("Org energy: ", ParsevalTheorem(short_signal))
print("DWT energy: ", DWTParseval(app1)) # app1 is haar discrete wavelet transform using pywt.wavedec(data, "haar", level = 3)

Results:
fourier energy:  1305035.7546624008
Org energy:  1305035.7546624022
DWT energy:  1309077.6827128115

I've gathered the information on using Parseval Theorem from equation: Equation Link1

I have also encountered another equation to get the Energy but if I divide the Approximation sum with it's length it's in whole different scope than the original signal energy: Equation Link2

I some what understand the Parseval theorem when dealing with fourier transform, but lost with these equations when dealing with DWT.
PS: I know there is more Pythonic way to do the code but I intend to apply it in a different language also.


texts:
I was just reading up on the Gaussian pyramid and the Laplacian pyramid, used in compression applications of image. The source is here - Carnegie Mellon 16-385 Computer Vision - Spring 2019, Lecture 3 - Image Pyramids and Frequency Domain.

The slide claims that during Laplacian Pyramid based compression, the original image can be reconstructed back perfectly, because of saving the residuals images.

My understanding of the process is as follows

Convolve original scale image with a Gaussian
Compute the residual image, and save it
Downsample the convolved image,
dropping alternate row and column to get to the next level (lower
size image).
Repeat process at this scale, till you reach lowest resolution desired.

Now, it says that given the lowest size image, and the residuals, we can reconstruct back the highest size image.

However, since we are dropping alternate  rows and columns while downsampling, isn't this information lost? How can the reconstruction be perfect?


texts: How to difference a loud sound (playing notes), from a soft noise in spectrum. (Pitch detection with bass)

texts:
I'm trying a program that outputs the bass line that you are playing.
I have some arrays from a big one with the sound in time domain, that are splited (Hann window).
Later, I do the FFT, then I get the peak of each array and apply the harmonic product spectrum algorithm.

Finally, I'm trying to filter all frequencies bellow 39hz and above 440hz, that include all frec. in the bass in E standart.
I've tried to eliminate the noise.

I want to distinguish my FFT output when I play my instrument, from when I don't, taking advantage of the frequency filter, I have made the program assume that when it plays a note that is less than 39hz, it automatically takes it as noise.
The problem appears when the noise is greater than 39hz (it can be from 0hz to 60hz even) and many of the notes I play on the bass are below 60hz, so with this system I cannot know when I make sound because I'am playing, and when the predominant sound is noise and I'm not playing.

So I need to know how to interpret the FFT output to know when I actually play and when I don't.

The FFT output is the energy (I think) of each frequency in the sound wave, and I have tried to eliminate all FFT outputs below 0.5 (The output is normalized from -1 as minimum value to 1 as maximum value of amplitude in the spectrogram), so I really don't know if this works.

Could anyone to tell me how to identify when I play and when I don't?


texts: Linear Systems, Sparse Solutions, and $4 \times 4$ Sudoku Algorithm

texts: I am unable to understand the paper Linear Systems, Sparse Solutions, and Sudoku. I have to form a $4 \times 4$ Sudoku using the algorithm in  this paper. Can somebody please provide me the algorithm for $4 \times 4$ Sudoku?


texts:
Learning DSP on my own time. Can't figure out the proof for DFT shift theorem which states the following:

Given, $x[n]$ to be a periodic with period $N$, $\text{DFT}\{x[n]\} = X[k]$, then
$$
DFT\{x[n-a]\} = e^{-j\frac{2\pi}{N}a}X[k]
$$

I found a proof here, but I can't figure out how did they leap from $$\sum_{m = -\Delta}^{N-1-\Delta}{e^{-j\frac{2\pi}{N}k(m+\Delta)}x[m]}$$
to
$$
\sum_{m = 0}^{N-1}{e^{-j\frac{2\pi}{N}km} e^{-j\frac{2\pi}{N}k\Delta} x[m]}
$$

Specifically how did they change the limits of the summation without changing the variable?


texts: How should calibration points be distributed?

texts:
I do camera calibration for a single camera with a chessboard pattern in opencv for the first time.
The focus is fixed.
I'm not sure how to do it, there seems to be many questions:

How many images should be used for calibration?
What pattern should be used? number of points, size of squares
What transformations should be applied to the calibration target? rotated, tilted, shifted...

I came to the conclusion that none of the questions above can be answered on their own, because they all depend on each other. Say for example taking a lot of images that are very similar to each other are intuitively not as good as having less images that are better distributed in the frame.

I took a step back and thought about what's going on. (I tried)
Basically, there's a mathematical model of the camera and its aberrations (focal length, distortion, etc...) and the calibration is the process of collecting data to fit the model (its values) to the hardware at hand. This appears to be mostly statistics. In order to fit the model to the entire image well, sample data should be collected from the entire image.

I conclude that all questions above boil down to how should the detectable points of the pattern be distributed in the 3D space.

I'd like to know if this thought makes any sense.

I'm tired of reading handwavy suggestions like "the more images, the better", "at least arbitrary number of images should be used", etc. that do not provide a quantifiable measure for the quality of a calibration. Sure, there's a reprojection error, that tells how good the calibration fits to the provided calibration data, but not how good that data is suited for calibration in the first place.

I came to the conclusion that it makes more sense to evaluate the quality of a calibration by the distribution of the sample data used to create it. Makes sense?

Questions 1 and 2 above are thus combined to : What should be the overall density (or density distribution) of detected calibration points among all calibration images?

Say I take all detected points from all calibration images and place them in one image, I could see how many calibration points there are per pixel area $\text{px}^{2}$.If I have a lot of images with the pattern in the center of the image, I get a higher density there.

What would be a good minimum (baseline) value for the density of calibration points per pixel area?
$0.1 \ \text{px}^{-2}$ ? $0.5 \ \text{px}^{-2}$ ?

Should the distribution of calibration points per pixel area be constant over the entire image? Or do I need a higher density (read: more sample values) at the edges for example?

Question 3 is asking for the distribution in the 3rd dimension. The calibration target with the pattern can be moved back and forth (along the optical axis) or tilted. Both transformations lead to calibration points in front or behind the plane that's in focus1. Depending on the depth of field, corner points can be detected up to some distance from the focal plane. This adds a 3rd dimension to the space in which calibration points can be detected.
How should calibration points be distributed with respect to distance from the plane of focus1? Should most points be around the plane of focus1 given that detection of points further away from it is not as good?

tl, dr;

In front of a camera, there's a 3D space enclosed by a frustum of a pyramid/cone in which calibration points can be detected. How should calibration points be distributed in that space in order to get a good calibration?

1 With that I mean the plane of points that will be "in focus" in the image.


texts:
I am new to Python and signal processsing, and I'm trying to create a spectrogram of EEG data taken during a course of general anesthesia. I would like to use MNE's tfr_multitaper function in order to compute the power and power.plot() to view the spectrogram.

Before I can do this, however, it seems I need to epoch the raw data. My problem is that I have only seen raw data epoched in MNE using events, and when I try to find events using mne.findevents on the pre-processed data (e.g. filtered and resampled) it fails to find any. I am wondering if there is a 'split' function in MNE like in brainstorm that allows aritficial epoch production without events.


texts:
I got a signal and I would like to remove a specific frequency range.

I am a frequency noob, so I will explain it by images:
I have a frequency filter (butter bandpass):

I have a signal and it's filtered signal:

The frequency spectrum of the signal looks something like this:

And the extracted frequencies like this:

So far everything is fine. But if I try to subtract the extracted signal from the original signal in time domain, then I get this frequency spectrum:

Instead, I would like to get the red marked spectrum.

What do I need to calculate in order to remove the specified frequencies from a signal?

I got the code from here and added FFT computations.

Kind regards,
Thomy800


texts:
I am building a speech recognition system using Hidden Markov Model in python. I referred to this and this question and its answers, which were very helpful.

In my approach, I split the continuous speech into separate words. I am thinking of using HMM to detect each word. So my states of HMM will be phones.

What I understood so far is that HMM estimates next state based on current state(phone). But I don't get how to estimate first state of HMM(i.e. the first phone of the word).

Can you suggest the best approach to use HMM to achieve this?

Also states of HMM will be phones, but I am not getting what can be observation in problem? There are multiple frame in a single phone and there is a feature vector corresponding to each frame. What should I use as observation?


texts: How to graph magnitude plots for basic 4-pole filters?

texts:
I have developed magnitude plots for basic one-pole and two-pole filters derived from various Physics PDF's and tutorials I have found online and calculated from:

https://www.desmos.com/calculator/mjudrnexbo

But I cannot figure out what the correct plots for any simple four-pole resonant LPF, HPF, BP, & BR filters would be in the same terms.

Any help on what equivalent simple four equations would be? Thanks.


texts: How to Filter Human Speech from an Audio clip?

texts: I'm looking for an open source library to detect Human speech from an audio clip, such as a wav file.


texts:
Given the real-valued functions $f_1$ and $f_2$ with $x\in\mathbb{R}$, then
$$ \frac{df_2(f_1(x))}{dx} = \frac{df_2(f_1(x))}{d f_1(x)}\frac{df_1(x)}{dx}$$

Is it then the case that if we also have a real-valued function $f_3$, then
$$ \frac{df_3(f_2(f_1(x)))}{dx} = \frac{df_3(f_2(f_1(x)))}{df_2(f_1(x))}\frac{df_2(f_1(x))}{df_1(x)}\frac{df_1(x)}{dx}$$

Is this correct?

If so, does the chain rule generalize to the following statement:
$$ \frac{df_{N}(f_{N-1}(...f_2(f_1(x))))}{dx} $$
$$= \frac{df_{N}(f_{N-1}(...f_2(f_1(x))))}{df_{N-1}(...f_2(f_1(x)))}    \frac{df_{N-1}(...f_2(f_1(x)))}{df_{N-2}(...f_2(f_1(x)))}...\frac{df_2(f_1(x))}{df_1(x)}\frac{df_1(x)}{dx}$$

My apologies about this looking like a straight calculus question. I am asking to figure out the backpropagation algorithm in its general form.


texts: Jigsaw puzzle: isolating the pieces (separating "stuck" blobs)

texts:
I'm new to image processing, and I'm trying to get my feet wet. I have taken a picture of some jigsaw puzzle pieces and I want to isolate the pieces.

I am using the Python SimpleCV library to do this, and so far I've managed to get pretty decent results using findBlobs(), hueDistance(), and drawMinRect(). Here's what I've got so far

Pretty good, honestly. The only place it's wrong is with those two pieces touching slightly to the right of center.

I tried dilating the image, but that seems to exacerbate the problem. How can I "shrink" these blobs to eliminate the overlap?