texts: Does the convergence rate never increase of a Stationary Ergodic Random Processes under downsampling?

texts:
Summarize the problem
Given A Stationary Random Processes (strict sense) $X_i$ I define two Stationary Ergodic Random Processes by
$$
\bar{X}_n = \frac{1}{n} \sum_{i=0}^{n-1} X_i \ \ \text{and} \ \ \bar{Y}_n = \frac{1}{n/\delta} \sum_{i=0}^{n/\delta-1} X_{i \cdot \delta} \\
$$
where the second one is sub-sampling the data with $\delta$. Does it always hold that
$$
\text{Var} \left ( \bar{X}_n \right ) \leq \text{Var} \left ( \bar{Y}_n \right )
$$
for any $n>\delta>1$ and how so?
Provide details and any research
If required you can assume that $\lim_{\tau \rightarrow \infty}\text{Cov}(X_i,X_{i+\tau}) \rightarrow 0 $ and assume that $n \rightarrow \infty$ and that $n$ is a multiple of $\delta$ and $E[X_i] = 0$.
This lecture I found discusses something similar but it does not include sub-sampling; http://isl.stanford.edu/~abbas/ee278/lect07.pdf
Describe what you’ve tried
Writing it out gives
$$
\text{Var} \left ( \bar{X}_n \right ) \leq \text{Var} \left ( \bar{Y}_n \right )
$$
$$
\frac{1}{n^2} \sum_{i=0}^{n-1} \sum_{j=0}^{n-1} \text{Cov}(X_i,X_j) \leq \frac{\delta^2}{n^2} \sum_{i=0}^{n/\delta-1} \sum_{j=0}^{n/\delta-1} \text{Cov}(X_{i \cdot \delta},X_{j \cdot \delta})
$$
Using that $X_i$ is a Stationary Random Processes we can write it with the autocovariance function
$$
C_X(|i-j|) = \text{Cov}(X_i,X_j)
$$
$$
\frac{1}{n^2} \sum_{i=0}^{n-1} \sum_{j=0}^{n-1} C_X(|i-j|) \leq \frac{\delta^2}{n^2} \sum_{i=0}^{n/\delta-1} \sum_{j=0}^{n/\delta-1} C_X(\delta |i-j|)
$$
$$
\frac{1}{n^2} \left ( C_X(0) n + 2 \sum_{i=1}^{n-1} (n-i) C_X(i) \right ) \leq
\frac{\delta^2}{n^2} \left ( C_X(0) n/\delta + 2 \sum_{i=1}^{n/\delta-1} (n/\delta-i) C_X(\delta i) \right )
$$
and with the autocorrolation
$$
R(i) = C_X(i)/C_X(0)
$$
it gives
$$
 n + 2 \sum_{i=1}^{n-1} (n-i) R(i) \leq
\delta^2 \left ( n/\delta + 2 \sum_{i=1}^{n/\delta-1} (n/\delta-i) R(\delta i) \right )
$$
This is obviously true of $R(i) = 0$ for $i>0$ and if $R(i)$ is an exponentially decaying function, but in the general case, I'm unable to prove this expression and hence that is why I'm asking the question.
I have been checking it numerically using Mathematica and I could not find any counterexamples (I did find quality examples).
Any kind of help would be very much appreciated.
note: I have also asked this question on stats but there was no response stats stack exchange


texts: Artifacts signal conversion from float to integer

texts:
I have a script where i want to change the noise floor to about 96 dB (visual purpose).
The script containing basically a sine wave with after wart do FFT over it.

The script is in python and as follows:

import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import get_window
from scipy.fftpack import fft

l = 128
f = 4
x = np.arange(l) / l
max_int = np.iinfo(np.int16).max
sine = np.sin(2 * np.pi * f * x)
sine_96 = (sine / sine.max() * max_int).astype(np.int16)

w = get_window('hann', l)
S = np.abs(fft(sine * w))
S_96 = np.abs(fft(sine_96 * w))

fig, ax = plt.subplots(2, 2, figsize=(8, 7))
ax[0, 0].plot(sine * w)
ax[0, 1].plot(sine_96 * w)

ax[1, 0].plot(10 * np.log10(S[:l // 2]))
ax[1, 1].plot(10 * np.log10(S_96[:l // 2]))

The weird thing is when i change the signal to 16 bit integer (or 16 bit integer and back to floats again) i get some artefacts what i don't understand. See also

left are the floating point functions where i get about an 150 dB noise floor. and on the right the version where the signal is changed to 16 bit integer. The result should be the same signal but with a noise floor around 96 dB.

As i can see it the noise floor is getting higher but so do the peak. I also get's repetitive peaks.
I have two question how can i avoid these peaks and what is the background of this?


texts: What kind of signal modulation is more resistant to jamming?

texts:
I've understood that spread-spectrum type of modulations are more resistant to narrow band jamming, for obvious reasons. What is less obvious is why someone would try to jam for example a cellular phone, GPS or ADS-B (Mode S) transmitter using a narrow-band jammer? (Whatever "narrow" or "wide" means in this context?)

What are the criteria and essential details for a jamming resistant modulation?

EDIT:

I have since understood quite a bit more about this topic. A wide-band jammer would spread all its energy over the entire spectrum of frequencies it tries to cover. This is extremely energy consuming and thus due to the inverse-square relation for radiation, you quickly loose energy with distance, so narrow-band beam formed jamming is preferred. However, narrow band jamming is weaker since certain frequency hopping methods can be applied to foil the jamming.


texts:
I'm processing audio data for voice input from a mic. The data arrives in 32 bit floats [-1 ~ +1].

My first filter is to remove DC:

// x = new input value, y = filtered output value
m_x += ( 0.01 * ( x - m_x ) );
y = ( x - m_x );

When I feed it audio that is close to clipping (but not actually hitting -1 or +1), I'll get values back that actually do go above the [-1 ~ +1] limit - sometimes way above. I find this behavior curious.

Can anyone explain why this happens?

Also, what's the best way to "fix" this? Do a simple clamp for the returned y value? Pre-scale the input down via (x * 0.7071) first?

Thanks!


texts:
An excellent answer to this post explains how to do $1/n$ octave energy smoothing and mentions complex smoothing can be done as well, but it's tricky business because of phase wrapping.

How is phase wrapping solved in $1/n$ complex smoothing?


texts: How Is Laplacian of Gaussian (LoG) Implemented as Four 1D Convolutions?

texts:
I am trying to understand the four 1D convolution operations involved in implementation of Laplacian of Gaussian(LoG). I have read this answer and I am also reading this pdf (See slide# 62 and 63). My current understanding is:

1) Pre-compute LoG and separate to 1D filters in x and y: gxx(x) and gyy(y).

2) Take Gaussian (g) and separate to: g(x) and g(y).

3) First apply g(y) and gyy(y) to the image. That makes two 1D convolutions.

4) Then apply g(x) to the result from gyy(y) and gxx(x) to the result from g(y). That adds two more 1D convolutions, making the total four.

Questions:

1) Is the above understanding correct?

2) How is this same as LoG?

3) Also, the diagram in slide #62 contradicts slide #63, in the pdf. Which one is correct?

Edit:

It's actually slide#61 and slide#62.

Edit2:

Please see the very last comment, posted Dec 19, 2018, on the first answer.


texts: How to find the time of beginning of the slope of the signal?

texts:
I have a time signal in MATLAB format. Sampling rate is 100k, so it is roughly 5 seconds of signal. See the link below

https://www.dropbox.com/sh/v7vev2j14i77mlk/AAA-X7JGMAzO6IyElYmFPFwra?dl=0

If you see the freq power vs time graph, you will see something below

Now I want to find the slope of the line on the freq power vs time graph (5k Hz to 15k Hz, 0.5s to 1.5s ) preciously by using the time signal. How should I handle this?


texts:
What is the bandwidth (i.e., the lowest possible bandwidth) and BER for FM0 encoding?

To be precise, this is my example of an FM0 encoded waveform:

There is always a transition between each bit. For a zero there is an additional transition in the middle. For a one there is no transition (that's similar to differential Manchester code).

From the plot above I would assume that the minimum required bandwidth is 80kHz (if the waveform would be interpreted as NRZ waveform the bandwidth would be 80kHz). In my experiments I am surprised that 40kHz seems sufficient. I had expected that FM0 would just be an inefficient encoding.

Regarding the BER, I found the article "Some Interesting Observations for Certain Line Codes With Application to RFID" which derives the BER. However, from this article it is not clear if E/N0 relates to the symbol or to the bit. Actually, for this encoding it is unclear to me what exactly is the bit and what the symbol (for me, the bit is equivalent with the symbol).

I simulated the BER in MATLAB and found a deterministic discrepancy between simulation and the formula reported in the paper. The way I decode it in my simulations: I look at each halfsymbol. If two consecutive samples are the same, the output bit is a one; otherwise zero.

Due to this observation, I wonder if I can only get the proper BER if I employ a more sophisticated decoding scheme.


texts: Measured signal from tachometer has ripples, why and how to minimize?

texts: I don't know if it would be straightforward enough to chalk it up to this being a real system. Thus there's friction and physical mechanics of gears and teeth pulling.


texts: Combination of accelation signals from two devices

texts:
I have $x_A$, $y_A$, and $z_A$ acceleration signals collected from a smartphone and I call it: set $A$ and I also  have $x_B$, $y_B$, and $z_B$ same acceleration signals from smartwatch: let's call this set $B$. I need to combine them together to obtain set $C$, but since I don't have good knowledge in signal processing I am not sure if it is this logically correct to combine them and take the average of them, or any other way should I follow to have one set of signals instead of having two separate sets?

How to select the set if it is possible? The signals are raw data.


texts:
Is a Kalman Filter still a Kalman filter if there are no inputs that explicitly predict the next state of the system?
For instance, if I have a signal where I know it has characteristics of a first order dynamic system and I have a filter configuration that can in effect discount or ignore changes it considers unlikely is this essentially a Kalman filter without explicit state estimation?

I have tried to follow the derivation for the Kalman filter and I understand that you use some prior knowledge or knowledge of how other system elements may effect your output and so you predict the next state.

Is a sufficient prior to be able to say

  this signal is from a 1st order dynamic system with a time constant of $\tau_x$?


texts: What f() for unscented kalman filter for stock trading?

texts:
I am trying to estimate to "next" price of a stock, based on a group of 5 other correlated stocks.

I believe this is a 6 state unscented Kalman problem. However, I do not know how to describe f(). I am measuring the "price" of the stock at end of day. i.e. I get one price per stock per day, and I have a set of 6 stocks.

Here f() is the deterministic part of the state update equation in the unscented Kalman filter :

x_k+1 = f(x_k) + w_k

which is implemented here.

I wish to estimate tomorrow's EOD price for stock A, based on an UKF that considers stocks B-F as well. But I don't not need to estimate stocks B-F.

What might f() look like?


texts:
My question is about the use of many filters on a sound signal.
I found the following transfer functions for the high cut, the low cut and the pass band filter :

H = K / (1 - x^2 + j.x/Q)
H = K / (1 - x^2 + j.x/Q) * x^2 * (-1)
H = K / (1 - x^2 + j.x/Q) * j.x/Q

with K = gain, Q = quality factor (set to 1.0 for the bandpass and 1/2^0.5 for the high and low cut), x = f/f0 (= signal frequency / filter frequency), H = multiplier (and it's a complex)

To "see" the effect of each filter, I draw the chart |H| = f(frequency), with |H| = modulus(H), and "play" with the values of K and Q.
In a first time, when I draw individually the chart for each single filter, the result is as expected : 0. to 0.99 for the low cut filter, 0.99 to 0. for the high cut filter, and some "bell" charts from 0 to 1 to 0 for each pass band filter.

But now, my problem is about the result when I "combine" all those filters.
My first idea was, for each frequency,  to make the average of all the real parts and the average of all the imaginary parts of the filters filter at this frequency.

For exemple, if my spectral precision is 21.xxx Hz with 2048 samples (0 < k <2048) in my signal to analyze, I calculate the H for each filter with k = 1 => f = 21.xxx Hz and make the average of the reals and the average of the imaginary parts and consider the "global filtering result" at 21.xxx Hz is this average.Then, I make the same computing for k = 2, k=3 (...).

So I finally get an array[number of filters][k] of complex, and I compute the average of each colum as the "global multiplier" for each k.

But the result is not the one expected. The chart of the global |H| starts at 0, with a fast growing until 20Hz to a maximum around 0.3, then a "tray" slowly decreasing and a strong decreasing slope for the frequencies above 10 000 Hz.

I would have expected a signal with a "tray value" around 1 and not 0.3. Of course, if Q <<< 1, the "tray value" grows up, but it means my filters are not selective at all.
So, what's wrong ? What's the rule to combine the effects of my filters ?

Thank you for all your answers.


texts: Match (OCR?) a digital image of a product label to similar

texts:
Excuse my ignorance...

Given a digital image of a label I'd like to

Requirement: Match it to the closest pre-existing image in a datastore
Optional: OCR it, if possible (only necessary if step 1 fails)

I'm a programmer but not an engineer. I have no idea where to begin or where to look into solving this problem. I don't even know the right terminology; "Image Processing" is best I could come up with.

Starting here, on DSP (beta); apologies in advance to the forum police if this type of inquiry is not considered to be 'in scope'. Before you vote me off the 'island' hopefully someone can comment with a better site/forum for my education.


texts: Implementation of IIR Filter in dsPIC 33EP - Scaling

texts:
I have to implement an IIR controller in dsPIC 33EP (16-bit, fixed-point, two's complement, wrap-around, 40-bit accumulator, 32-bit multiply, 12-bit ADC) and I am using cascaded, Direct Form I second order sections (ordering up).

Now, I am having trouble with the scaling procedure, since I'read a lot about $L^2$-norm, but can't quite figure out how to apply it properly.

When I get the sos matrix and gain using MATLAB (by either using tf2sos, fdatool, or filterbuilder) using $L^2$ norm, the gain values are always 1 for all of the intermediate sections.

Is this correct?
Or do I need to scale the input for each section?

(I have no experience implementing IIR systems and your help would mean a lot.)

Ben


texts: Filtering White Noise to Generate Harmonic Signal

texts:
I have studied convolutions and filters a long time ago. Today, I am trying to review the basics using some notes of mine, but I am finding difficult to solve easy problems. Since I don't have solutions for these problems, I believe that it could be helpful for me if you could show me how to solve one of them.

Let's say that I want to define a filter $b_\alpha(L)$ (where $L$ is the lag operator) that applied to a white noise $x(t)$ approximates a $\cos(\alpha t)$ function (where $\alpha$ is given). How should I proceed to estimate this filter?


texts: Why is it that reflecting any poles or zeros of a rational function across the unit circle gives a minimum phase system? Here's an example, it seems reflecting any poles or zeros would result in the zeros being outside the circle?


texts: I have a sound signal, recorded by a hydrophone, which units are counts. I would like to convert the counts into dB re uPa (Decibels relative to microPascals), is that possible?


texts: Comparing the performance of a digital communication sim against a reference

texts:
I have a complex baseband simulation of binary FSK modulation and demodulation. The modulated signal $s[k]$ is computed as

$$
s[k] = e^{-j2\pi f_ik/f_s} , i \in [0,1]
$$

where the sampling rate is $f_s = 1$ MSPS, the two frequency shifts are $f_0 = 35 kHz$ and $f_1 = 90kHz$. Each FSK symbol has $N$ samples per symbol, and let's say $N=1000$, therefore the symbol (bit rate also in this case) is $R_b = (1e6)/(1000) = 1000$ bits per second. To be clear, that means to send a "0" then $s$ would look like the following:
$$
s[k] = e^{-j2\pi (35e3)k/(1e6)}, k \in [0,1000)
$$

I add complex gaussian noise white noise to form the received signal:

$$
y[k] = s[k] + w[k]
$$

where $w[k]$ is drawn from a zero mean complex normal distribution $\mathcal{CN}(0, \sigma^2) $. The noisy signal $y[k]$ is then fed to a demodulation chain to extract the estimates of the transmitted bits and a BER is computed.

I would like to compare the performance of my system with the optimal coherent and non-coherent binary FSK BER curves - however to do so I need to understand how to compute and adjust the $E_b/N_0$ of my system. This is where I get lost a bit, I thought the following equation relating carrier to noise ratio would help here:

$$
CNR_{db} = \frac{E_b}{{N_{0}}_{db}} + 10\log_{10}(\frac{R_b}{B})
$$

Plugging in $R_b = 1000$ bps and $B=1e6$ (complex bandwidth) indicates that the second term is -30 dB. Using this equation along with the fact that my signal power is 1 (due to the magnitude of the complex exponential), I computed a variance to generate the AWGN samples at a Eb/N0 of 13 dB but the noise level is much higher than I'd expect.

Pretty sure I'm missing something major here and it'd be great if someone could lay out how this should actually work.


texts: What phase rotation occurs when you take the derivative of an audio signal?

texts:
If you take the derivative of an audio signal, it provides a 6 dB/oct upward sloping filter (increasing high frequencies / cutting low frequencies) all the way across the spectrum.
What is the result in terms of the phase? Is there phase rotation? Is it uniform across the spectrum or does it vary with frequency? What would the plot of this phase rotation look like?
Thanks


texts: Relationship between wide sense cyclostationary process and jointly wide sense stationary processes

texts:
https://faculty.engineering.ucdavis.edu/gardner/wp-content/uploads/sites/146/2014/05/Cyclostationarity_Half_a_century_of_research.pdf
According to the paper above (page 654~655), a CT wide sense cyclostationary signal can be expressed in terms of jointly wide-sense stationary signals with non-overlapping spectral bands.
At the first glance, this statement intuitively makes sense, but as I think about the definition of the jointly wide-sense stationary signals, it starts falling off.
For instance, the definition of jointly wide-sense stationary signal is that its second-order statistics are only a function of time difference between two wide sense stationary processes.
However, I am confused if this statement imply that these two wide sense stationary processes must have the same frequency. If not, how can their statistics be only a function of time difference and not a function of their absolute time index?
it is very possible that I'm confused with deterministic signals and that is why I think their statistics must be a function of their absolute time index.
But if anyone can clarify my misconception and wrong arguments raised above and give me kind feedback, I would greatly appreciated.


texts: Remove a signal that is known to repeat every 4 samples at a known phase i.e. exactly 500 Hz signal in 2000 Hz data


texts: How to plot the discrete time signal $u[2k - 3]$?

texts: I am having a hard time plotting this graph. Do I express it as $u[2(k - 1.5)]$? But then still the step occurs for $k = 1.5$ which isn't possible for discrete time signals as they take integer values for $k$. So how to approach this?


texts: How can I "smooth" square wave/pulse data to remove/reduce harmonics?

texts:
First, I have reviewed close-match questions, but can't find something that seems to match what I'm looking for.  Also, it's been 30 years since college, so forgive me for forgetting stuff.. :)

I am analyzing IP Packet data.  I am creating bins (of varying window sizes.. The window seems not to be sufficient to remove/smooth the harmonics) to count the frequency of certain attributes/behaviors within the data.  From this, I am trying to determine fundamental frequencies that activities are occurring.  I believe that the artifacts that I am seeing are harmonics since the data tends to be pulse/bursty, resulting in what amounts to a square wave.  (see below) . In this sample data, as you can see, there is a strong signal occurring every hour, over the course of 47 hours, yet it is almost impossible to "see" because of the harmonics. (at least, that's my guess/intuition)

Is there something that I can do to smooth things out so that the harmonics are suppressed (or largely suppressed) and I only see the fundamental frequencies?  I feel as though I've forgotten something basic.


texts:
I am trying to implement speech recognition using backpropagation algorithm, and I have been following this paper.
I have followed it all the way, except that it tells me to zero-pad the coefficients when there is an empty slot, because the MFCC coefficients of two samples are not the same.

Now my question is, do I randomly distribute the zeros through the coefficients, or is there a  rule of some type?

P.S- I have perused this paper as well; however, the question does not relate to taking the MFCC coefficients an inputs.


texts: ADC sampling rate and signal bandwidth for FHSS

texts:
If i am correct; for a radio receiver the ADC sample rate will have to be higher than at least twice the BW of the data (disregarding sparse sampling techniques). So for frequency hopping spread spectrum (FHSS),when the receiver is unaware of the transmitter's hopping pattern, does that mean the ADC sample rate needs to be higher than twice the entire hopping bandwidth?
Let's say I use amplitude shift keying, data BW is 500kbps, and the entire hopping bandwidth is 24MHz. If I use a 2Msps (4x data BW) ADC it looks like I will still recover my data; sure it under-samples some of MHz modulated frequency but it does capture entirely my data
correct? if not do I miss something?


texts: Is it possible to Denormalize a matrix of complex numbers?

texts:
In this article, FFT and I-FFT are achieved as the following:

FFT steps

process starts with a Bitmap image.

Bitmap-image to Integer-image
Integer-image to Complex-image
Apply Forward-FFT to Complex-image (output: Complex-FFT)
Apply Shift to FFT (output: Shifted Complex-FFT)

I-FFT steps

process starts with the FFT (a complex matrix) of an image.

Apply Backward FFT to Complex-FFT (output: Complex-image)
Complex-image to Integer-image
Integer-image to Bitmap-image

Normalization

To display an FFT's Magnitude/Phase, FFT is Normalized and then that normalized matrix of complex numbers is converted to a Bitmap. Without Normalization, I see a complete 'Black' image output.

My Question

As I posted this question, I was thinking about applying an I-FFT in the following process:

Obtain the Bitmap-image of a magnitude plot of an FFT.
De-normalize the Bitmap-image to obtain the original FFT of the image.
Apply I-FFT to the complex matrix and obtain the Complex-image.
Convert the Complex-image to Integer-image.
Convert the Integer-image to the original Bitmap.

N.B. For some reason, they used,

(1) Bitmap $\Rightarrow $ Integer$\Rightarrow $Complex, and, (2) Complex$\Rightarrow $Integer$\Rightarrow $Bitmap

to obtain the conversion between a Bitmap and its Complex counterpart.


texts: Zoom an image with respect to a given image

texts:
I posted this question in stack overflow, but I think it is more appropriate here:

I have a reference image - 'image_01.png' of size 200x200 and resolution 72 px/in.

I have another image 'image_02.png' (with the same size and resolution) with several levels of zoom, of which, one is close to 'image_01.png', in the sense that the objects in that image are of "similar" size. They are NOT the same images, btw.

Here is an example with three levels of zoom, and clearly zoom_02 is "closer" to image_01 than zoom_01 and zoom_02. My question is, what mathematical metric (ratio, or any measure) do we choose to determine what zoom is appropriate to ensure such similarity? Let's say I even have a screen ruler to measure the distance in the images, in pixels.

 zoom_03  zoom_01

 zoom_02  image_01


texts: Why Do Most of The Papers Use the Frobenius Norm for Denoising?

texts:
I have an noisy image and I want to remove noise from it; suppose $y$ is noisy image and $A$ is linear mask which makes my image noisy and $x$ is original image, so we have
$$
Ax + \eta = y
$$
and $\eta$ is additive noise. I have read in many papers that the equation below is a good cost function for removing noise:
$$
x^* = \arg\min_{x} \lambda\|A(x) - y \|^2_\mathcal{F} + \|x\|_{TV}
$$
First term aims at minimizing additive noise but why do most of the papers use the Frobenius norm? And second term wants preserve edges and features of images.


texts: Mathematically Inclined Signal and Systems / Signal Processing Book Recommendations

texts:
I'm an electronics engineering student with high inclination to analysis and pure mathematics.  I was just wondering if there was any book ( or any resource ) that treats signal and systems and signal processing with a lot of mathematics rigour ( actually doing proper complex analysis, using functional analysis and linear algebra rigorously to explain convolution, fourier, laplace and z transforms for example ).

I'm very disapointed with the books i've read ( Oppenhein, Lathi and related ) because it actually throws a lot of the beauty of analysis and algebra away, focusing on the computational side.

Thanks a lot


texts: Weird note structure on guitar audio waveform

texts:
Why do some times notes take these weird structures (circled below). That is a guitar monophonic audio waveform by the way (3 note melody).

There are 3 notes played in this audio file. These are the beginning of the waveform (0), around sample 52000 and around sample 95000.

My two questions are:

Why did this weird looking negative amplitude peak get created (circled)?
Right after the final note (where the arrow is), why is there such a big change in amplitude (down, up, down again)?

The audio file is here.


texts: Discrete Fourier Transform by longhand using MATLAB - what is the lower limit for N?

texts:
I'm seeking some guidance/reassurance on my understanding so far of the DFT, as demonstrated by my MATLAB script below. I deliberately compute the DFT longhand.

My first question: Are my interpretations of the Nyquist-Shannon Sampling Theorum principles correct, as described here:

The DFT can provide perfect reconstruction of the original signal provided:

The highest frequency component of the signal cannot exceed the Nyquist frequency = (sampling frequency)/2,
the sampling frequency is at least twice the signal frequency. This lower limit is known as the Nyquist Rate = (signal frequency) * 2, and
does not equal the Nyquist Rate exactly (it must exceed it)

My second question: what determines the (practical) lower limit for the number of samples (N)? Is there a formula? For example the script below correctly reconstructs the signal even for N reduced to 20, but further reduction results in a signal spread across numerous frequency bins.

My last question: is it possible to achieve perfect reconstruction if only one cycle of the signal is sampled?

Here's my code and plots:

f0  = 3;                            % signal fequency (Hz)
w0  = 2*pi*f0;                      % rad/sec
T0 = 1/f0;                          % signal period

fs = 20;                            % sample frequency (Hz)
N  = 100;                           % sample count

T  = 1/fs;                          % sample period
st = N*T;                           % total sample time

f = transpose((0:N-1)*(fs/N));      % frequency sampling bins

nyquistRate = f0*2;
fNyquist    = fs/2;
fNyquistIdx = N/2;                  % frequency bin for the Nyquist frequency

t = transpose(0 : T : st-T);        % time vector, length N
A = 4.5;                            % amplitude
s = A*sin(w0*t);                    % generate N samples

X  = zeros(N,1);

% perform DFT
for k = 0:N-1
    for n = 0:N-1
        X(k+1,1) = X(k+1,1) + s(n+1)*exp(-1i*2*pi*k*n/N);
    end
end

I do get the same results if I use the MATLAB inbuilt FFT in place of above

X = fft(s);

To convert the resulting spectrum to a single-sided reconstruction:

1) Discard all components above the Nyquist Frequency in the 2-sided plot, and

2) Double the magnitudes of those below the Nyquist Frequency, and

3) Divide the result by the number of samples (N)

XX = X;
XX(1:fNyquistIdx) = XX(1:fNyquistIdx)*2/N;
XX(fNyquistIdx+1:N) = 0 + 0i;

Here are the resulting spectrums for X and XX:


texts: Spline-Based Adaptive Interpolation Filters?

texts:
My understanding of interpolation specific to resampling applications is limited to the concept of inserting zeros, then designing a filter to minimize distortion in the passband and reject the images the zero-insert creates (to desired performance levels), such as what is depicted in a simple interpolate by 4 zero-insert shown below (showing the resulting spectrum before filtering).

I am noting that in creating the filter, we are creating the high order polynomial used for interpolating the input samples. I then understand that with a Spline interpolation method (as a user, and perhaps naively as I haven't really dug deeply into the underlying mathematics) we are doing piecewise interpolations using limited polynomials (therefore low order filters) over a smaller span of the sequence, and in many cases due to decreased ripple this will provide better performance.

My question then is if such "adaptive" resampling filters have been designed either using Spline approaches directly, or otherwise piecewise similar in process to a spline, but in a fashion that is best suited for high rate FPGA processing with a FIR based interpolation filter (I say that to avoid the response "just do a spline", but perhaps that would actually result in the solution even in an FPGA FIR based interpolator...). Before digging into that further has anyone seen such an approach, is it common, or are there known pitfalls why this would be a BAD idea?  Thanks for the thoughts and input!


texts: Discrete Time Fourier Transform (DTFT) cross correlation property

texts:
I came across this property of the Discrete Time Fourier Transform (DTFT) and I am having a tough time proving it.

In general, consider two real signals $x[n] \: \& \: y[n]$. If
$$ x[n] \leftrightarrow X(e^{jw}) \\ y[n] \leftrightarrow Y(e^{jw}) $$
Then, $$\boxed{ \sum_{n=-\infty}^{\infty} x[n]y[n] = \frac{1}{2\pi} \int_{-\pi}^{\pi} X(e^{jw})Y(e^{jw})dw} $$

However, when I tried proving this, I am getting an extra conjugate:

$$ x[n]*y[-n] = \sum_{l=-\infty}^{\infty} x[l]y[n+l] \; $$ (Cross Correlation between $x[n]$ and $y[n]$)

$$Also, \; y[-n] \leftrightarrow Y(e^{-jw}).\: As \: x^{*}[n] = x[n], we \: have \; \; Y^{*}(e^{jw}) = Y(e^{-jw})$$

Thus from the convolution property of DTFT, we get:

$$x[n]*y[-n] =  \sum_{l=-\infty}^{\infty} x[l]y[n+l] = \frac{1}{2\pi} \int_{-\pi}^{\pi} X(e^{jw})Y(e^{-jw})e^{jwn}dw $$

Setting n = 0 and using the conjugation property as mentioned above (for real signals), we get:
$$\sum_{l=-\infty}^{\infty} x[l]y[l] = \frac{1}{2\pi} \int_{-\pi}^{\pi} X(e^{jw})Y^{*}(e^{jw})dw $$

Which is nothing but a result of the cross correlation property of DTFT.

Does the property (mentioned above in the box) hold only for special cases of $x[n]$ and/or $y[n]$ (like the signals being real and even etc.,), or am I making a mistake somewhere?

Thank you.


texts:
I am quite new to the idea of equalization. I have a few queries regarding the same.

In my application I require to equalize a channel whose impulse response is an IIR response. Is it possible to design an adaptive equalizer based on LMS algorithm to equalize it? I tried some MATLAB simulations and it worked well (the estimation error reduced with each step and converged) for FIR channels but not for IIR responses. So is there any restrictions on the channel characteristics (like FIR/IIR response) for the adaptive filter to function properly?
Also, from my simulations for FIR channels I observed that, in absence of noise, the adaptive filter after converging had a response that is inverse of the channel response which is the same as that of a Zero-Forcing equalizer. So is it always true that, LMS adaptive filter will tend to a Zero-forcing equalizing filter in the absence of noise? If yes, can someone refer me to the proof of this?

I have another doubt. Say I am measuring the channel output in presence of an additive zero mean noise,

$$Y(z)=X(z)H_c(z)+N(z),$$

Where $H_c(z)$ is the channel response, I still would like the equalizer to estimate the inverse response of the channel. I thought this should work, as if I try to derive the Weiner-Hopf filter, in presence of noise, I end up getting

$$R_{dx}(k) - R_xW -E\left[n(l)x^{*}(n-l]\right],$$

Where $R_{dx}$ is the cross correlation between the desired signal $d(n)$ and the filter output $x(n)$, and $R_x$ is the auto-correlation matrix, and $W$ is the filter weights. Since the noise is independent of $x$ and has zero mean, $E\left[n(l)x^{*}(n-l)\right]$ becomes 0 and I again get the same equation. So I thought that the same algorithm could potentially work.

Also in the LMS algorithm, instead of using $E\left[e(n)x^{*}(n)\right]$, directly as $e(n)x^{*}(n)$, I tried to take an $L$ point average of the product, with the intention that, since the error $e(n)$ will consist components both due to ISI as well as the additive noise, averaging it will remove the additive noise and retain the ISI, and so the filter coefficients will converge to give the inverse response of the channel.

But MATLAB simulations do not agree with my argument above. I want to know the mistake in my argument and also I would like to know if there is any means by which I could still estimate the inverse response of the channel to a good approximation even in presence of a zero mean noise.


texts: Why does $\mathrm{sinc}[k]= \delta[k]$ hold?

texts:
On page 5 of this document I read that

$$\mathrm{sinc}[k] = \delta[k]$$

Could anyone please explain why this is true?


texts: What do I lose when I set overlap rate to a really high value in STFT

texts: If I don't care about computational cost, is there any cons when I put overlap rate really high in STFT?


texts: I see in a paper mentioning ycbcr as well as ycbycr. I am wondering what is the difference between the two? In the figure, the first two lines show ycbycr but the two bottom lines show ycbycr?


texts: Minimum size for positive samples for HOG (Histogram of Gradient) detector training

texts:
I'm going to train a HOG detector for detect objects (pedestrian head) with SVMLight library. But my question is not about implementation.

I'm wondering how to collect samples. I have to use some videos, and they have 1624x1234px dimension. The pedestrian heads have more or less 20x20px bounding-boxes.

Is the 20x20 pixels too small for a correct HOG feature extraction? Or is suitable for training? The, it has to be power of 2 so.. 36 pixels?

And what about the detection? Can I scale down the videos? As far as I know the detection is done on the training sample and then maybe scaled down. So if I train the detector with 20x20px I can detect objects of 20x20 as minimum, then if I scale down the image as half of the size I can detect object 40x40, but not 10x10 (I should scale up but the noise will be a problem).

And then, what about the computation time?

Any hint will be appreciated..


texts:
I'm using a very simple signal to test some statistics. Let the period be $p = 2\pi$, I have two signal

$SW = sawtooth(3 p)$

and

$SQ = square(1.5 p)$

I do some manipulation in those two signal, the first manipulation is

$SW = (SW + 1)/2$

this put my sawtooth limited in $[0,1]$, and

$SQ = (-SQ + 1)/2$

This inverts the square wave and also "normalizes" it betweeen $[0, 1]$.

My final signal is

$SIGNAL = 20*(SQ*SW) + 10*SQ$

The final product is a single saw in middle of period, with amplitude 20 and translated up 10 , giving the limits $[10,30)$ in signal support and $0$ elsewhere. Something like

Then I add some heavy random noise (20% of signal amplitude)

$NOISE = RANDOM(MAX(SIGNAL)*.2)$

My final signal is the original signal plus the noise.

$FINALSIGNAL = SINAL + NOISE$

My questions are

How to matematically be more consistent with my signal notation (instead to use that computer science like description)?
Is there any signal operations that can be done instead those algebraic ones or those are valid in signals?


texts: Comparision between SSIM and MAD Image Quality Assessment Algorithms

texts:
I have been working with Most Apparent Distortion(MAD) tool to evaluate the quality of images. I have read a paper that compares SSIM, PSNR, FSIM, etc. with MAD. I am uncertain about some calculations done in the paper.

(https://arxiv.org/pdf/2005.01338.pdf)

The output of MAD gives the distance between two images between [0, infinity). How do you convert this value in the similarity of range [0,1], so that it can be compared with other metrics (ssim, ms-ssim)?


texts: Algorithm/Code for finding surface shape of an image?

texts:
Is it possible to find the surface shape of an image as mentioned in the reference question ?
If I find the unknowns of the equation , then what should be my next step in determining the shape of the surface/image.
Kindly mention the algorithm/Code or the procedure required for this purpose.

Thankyou.


texts:
I am new to phase analysis, recently I have been trying compare the phase between the input signal and output signal of a system. From the code below, I simulated a square wave and plotted the phase, from basic theory, I thought that since this is a simulated signal, I should get near zero values other than the values at each input frequency. So my questions are (based on the following code):

1) Why does Matlab give me pi/2 as phase response of actual input signals, I don't understand the calculation behind it (does it have to do with my signal being sine and not cosine?)

2) If I don't filter out low (near zero) values, the phase response is a sloping line that goes toward very large numbers, and seems to be proportional to the number of samples of FFT I have, is this due to how unwrap works?

3) If I am trying to compare an input signal vs output signal, both of which for the sake of argument looks similar to the square wave I simulated, how do I determine if the system is linear phased? (from theory, the phase delay should be the same therefore, after finding the phase response, should I check if the difference of phase for each input signal between output and input is constant?

4) Also, group delay is considered as the derivative of phase response, and phase delay is the normalization of phase with respect to its corresponding frequency, a perfect square wave should have constant values at each harmonic for group delay and phase delay shouldn't it?, if so can I somehow see this result in my simulation?

close all;

clear all;

fs = 16000;

end_time = 6-1/fs;

x = 0:1/fs:end_time;

x = x';

n=2000;

freq = 32;

wave = sin(2*pi* freq*x)/(4*pi);

for i = 3:2:n

    wave = wave + sin(i*2*pi*freq*x)/(4*i*pi);

end

wave = awgn(wave,55,'measured');

wave (1:10000) = 0;

NFFT = length(wave);

fft_result = fft(wave, NFFT);

for i = 1:NFFT

    if abs(fft_result(i)) < 10^-4

        fft_result(i) = 0;

    end

end

fft_mag = db(abs(fft_result));

fft_phase = unwrap(angle(fft_result));

fstep = fs/NFFT;

f_range = 0:fs/NFFT:fs-1/NFFT;

figure

plot(f_range, fft_phase);

Thank you for being patient enough to read all of this and giving me answers.
=)


texts: Deconvolution of sidelobes in a point spread function?

texts:
It seems that most deconvolution algorithms mainly handle the main lobe of a point spread function (PSF) and assume that sidelobes can be safely neglected.
For a direct algorithm trying to perform a division in frequency-domain, it seems difficult to deal with the zero crossings of the Fourier-transformed PSF.
For the Richardson-Lucy algorithm, there still seems to be a risk of division by a very small number for the small weights in-between the sidelobes, but I'm not sure. I suspect some kind of ad hoc thresholding can help with this.
Is there any general insight that's common knowledge for this problem?


texts:
I'm trying to create my own program for speaker identification (text-independent) and have used MFCC features for that. But result of recognition is very poor. My supervisor told me that using MFCC for such problem is not the best solution because we are loosing a lot of data about speaker and MFCC mostly used for speech recognition (what is said, not who).

Does anyone know which features can give better result for speaker recognition?

Thanks


texts: Real-time resampling pitch-shifting (without corrective time-stretching)?

texts:
Is real-time resampling pitch-shifting impossible (without corrective time-stretching, such as WSOLA)? I've been told that it is.

Real-time resampling pitch-shifting would mean applying resampling in real-time, but it's claimed that it's impossible to overlap differently resampled segments in real-time (since the total length of the "window" varies in every window and in connection to every frequency of resampling).


texts: White noise generation in frequency domain (stfft) produces a periodic pattern

texts:
I have created a set of spectral processing modules for SynthEdit next to be released, implenting short time fft, so I am now quite experienced with the matter, but recently encounteted an unexpected problem which looks more thorny than it seemed at first glance: noise generation in frequency domain. I had this idea of adding a module to generate white noise fft frames, so that when one needs to inject a noise source in the spectral.process chain, he can avoid to waste cpu with a noise generator plus dedicated FFT. Well things seemed simple: just generate spectral frames made of random bins (each bin containing random real and imaginary parts ranging -k / +k where k is a suitable scaling factor for having a more or less normalized output level after IFFT). Well I encountered an unexpected problem: the resulting white noise (after IFFT) has a clearly audible periodicity whose length is the lenght of the fft frame size chosen. After careful investigation I realized that this was unfortunately the obvious and expectable behaviour, and that generating white noise by ifft is likely going to be a much more challenging task than one could expect. I try to explain why (keep im mind that I am a skilled coder and quite experienced with maths but not to the point of treating the matter with too advanced maths as it is often the case here, so bear patience).
Simply said, by proceeding the way I just explained, you end up creating discontinuities between subsequent frames which are clearly audible. Mainly because a fft frame has a non null.lenght and therefore contains temporal information other than merely spectral information. Consider the extreme case of a white noise band-limited to a single bin frequency: the first frame will have that component with a random magnitude of say 1 and random phase of pi/2. In the next frame you may have a random magnitude of .2 and random phase of 4/5 pi. You have a discontinuity between frames, periods. And even if the global signal is composed of many frequencies of random magnitudes and phases, every single frequency will experience a discontinuity at the next frame, which will be globally audible as a white noise with periodic jumps. I searched for other threads here (very few) where the matter of generating white noise in frequency domain is addressed, but this big problem is never mentioned. I could not find an easy solution yet. If somebody may have one he is welcome and I thank him in advance. Thanks

Actually I discovered the reason for the periodic pattern is much simpler. When you operate STFT processing with overlapping windows on a time domain signal, the overlapping parts represent a same common portion of the input signal. But if I am synthesizing white noise by generating random spectral frames, the overlapping parts after inverse fft will contain DIFFERENT data, therefore some amount of phase cancellation occurs and the COLA windows will stop work as intended,.because things cannot sum up.linearly any longer. This is a hard to solve problem. One should be able to synthesize spectral frames in such a way that the first half after ifft contains the same signal of the second half of the previous frame, all done remaining inside frequency domain. The only way to achieve that would be splitting fft frames and recombining, all operations which to the best of my knowledge can only be achieved by framesize-long convolutions in frequency domain. Therefore I came to the conclusion that synthesizing white noise in a stft context using overlapping windows is a lost battle. It is very strange, I repeat, that this fact has never been addressed by any author AFAIK and I am also a bit disappointed for not receiving any feedback here.


texts: Modification of Accelerometer Data for Feature Extraction

texts:
I have accelerometer [x,y,z] data recorded from various activities.  I am not looking at any filtering techniques (which I have seen within this forum) because I want to be able to measure the amplitude of the noise for each activity sample set using a global time-domain feature average loudness.

I am curious to know if I can center the signal around 0g, similarly to the X Data Minus Mean vector plot, but without the x-axis orientation i.e. the signal shifting up and down?

I have the x-axis data from one of my activities below:

I was hoping that by subtracting the mean from the x-axis data would yield this, but all it has done is shifted the entire signal down to around 0g.

The reason I ask is because I am unsure if computing a time-domain feature such as average loudness will work with the signal shifting up and down?

Average Loudness/Energy:


texts: Phase difference measurement of a 100 kHz tone

texts:
I would like to measure the phase difference of a 100 kHz tone. The tone is transmitted and then received.

The received tone is sampled using an 1 MHz 12 bit ADC(IQ) and the SNR is at least 35 dB.

Our aim is to measure the phase difference in at least 360/500= 0.72 degree steps.

Is this possible?
Should I use a PLL or a FFT based approach?


texts: How to extract single side of signal spectrum in SIMULINK

texts:
Signal spectrum have two side, positive and negative. I want to make these separate in two signal, by MATALB SIMULINK.
But how? I can't find it's block on DSP or communication toolbox.
I found a block that interactively generate filter, but this filters response is conjugate symmetric and that's not my desire.
As replica of Fat32 :
Hilbert approach not worked?!!


texts:
I've recently read the following

  For our pixel labeling, consistent with [20], we report the
  number of pixels correctly classified (per-pixel rate) and the
  average of per-class rates. The per-pixel rate indicates how
  well the system is doing on the large common classes, while
  the average per-class rate is more affected by the smaller,
  less common classes.

Source: Scene Parsing with Object Instances and Occlusion Ordering by Joseph Tighe, Marc Niethammerm, Svetlana Lazebnik.

I know per-pixel rate:

$$ppr(image) = \frac{\text{pixels which were assigned the correct class}}{\text{total number of pixels of image}} \cdot 100$$

But I'm not sure how per-class rate is defined. I can imagine two ways. Let $C$ be the set of all classes.

$$pcr_A(image) = \frac{1}{|C|} \sum_{\text{class }c \in C}\frac{\text{pixels of class $c$ classified correctly}}{\text{total number of pixels of class } c} \cdot 100$$

$$pcr_B(image) = \frac{1}{|C|} \sum_{\text{class }c \in C}\frac{\text{Pixels classified as class }c}{|\{\text{Pixels classified as class }c\} \cup \{\text{Pixels of class }c\}|} \cdot 100$$

Which one is the one used in the work I've cited above? Is the other one used? Where? Is there a definition in literature?


texts: Extracting articles from epaper into individually cropped image

texts:
I want to segment the image below (click for bigger image) into columns based on the natural gaps that exist in the columns. The article columns should be perfectly vertical and need not be the same size, but should split each article column by itself.
I have tried Hough Line Transform, Scipy Label, convolution filters, specifying manual cuts, etc. all with very limited success and nothing I would consider a "solution".
What approach should I take to segment these types of images into columns? Preferably a solution that I can code myself or exists in OpenCV or Python.

My output should be a set of images which are cut from the input.
Here is a sample of my output.The set of images should be like this


texts: How to perform a phase recovery for higher order modulation schemes

texts:
My objective is to demodulate the signals with different modulation orders and schemes. In particular, I want to recover the phase first.
Let us say, my signal looks like in the constellation below
.
The idea is to position the constellation in such a way that the largest excursions are at 45 degrees angle. In other words, IQ diagram must be shifted by some angle. This angle is determined by the average shift of all points from the reference axis (real or imaginary). The idea itself is coming from this post, where BPSK phase recovery is described.
My problem is that I still do not understand, how do we perform the phase recovery for the higher order modulation schemes. The idea of simply mirroring the constellation to one quadrant (as it works in the case of BPSK) does not seem correct to me and also does not work well. So how we can do it?
Thanks!


texts: If the cosine function is periodic, why does it have a Fourier Transform?

texts:
As far as I understand Fourier Transforms are for non-periodic signals and Fourier Series for periodic signals.

So why is it we can take the Fourier Transform of a cosine when it is a periodic function, assuming the above paragraph is correct?


texts: How to change the shape of a function generator keeping the rate?

texts:
I'm making a sort of Envelope Function Generator. At the moment, I'm calculating only the the "rise" stage, which goes from 0 to 10 V; than, brutally, I back it to the beginning.

Here's the code I have, which emulate 10 cycles with a change of the shape (from linear to exp) at the 4° cycle and 120° sample:

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

const double sampleRate = 44100.0;

inline float interpolate(float a, float b, float frac) { return a + frac * (b - a); }

inline float shapeDelta(float delta, float length, float shape) {
    float lin = (copysignf(1.0f, delta) * 10.0) / length;

    float exp = (M_E * delta) / length;
    return interpolate(lin, exp, shape * 0.90f);
}

int main() {
    float in = 10.0;
    float out = 0.0;

    float shape = 0.0;
    float lengthInSeconds = 1e-2; // * powf(2.0, 1.0 * 10.0);

    int numCycles = 10;
    for(int cycle = 0; cycle < numCycles; cycle++) {
        int numSteps = 0;
        while (in - out > 1e-3) {
            // change shapes
            if(cycle == 4 && numSteps == 120) {
                shape = 1.0;
            }

            float delta = in - out;
            out += shapeDelta(delta, lengthInSeconds, shape) * (1.0 / sampleRate);

            numSteps++;
        }

        std::cout << "cycle: " << cycle << " | num steps: " << numSteps << " | value: " << out << std::endl;
        out -= 10.0;
    }
}

The problem is that changing the shape, change the "lenght" of the generated signal (i.e. change the rate; just looks at the number of samples used for each cycle).

How can I change it without change the rate? And keeping a "non steppy" signal (i.e. avoid brutal transient).


texts: What is the value of the standard deviation $\sigma$?

texts:
I am using the following formula to add the additive Gaussian noise.
noise= (x/255)*(randn(size(image))), where x is the variable and randn is random value generator. Intensity range is $0-255$. But, what is the value of the standard deviation $\sigma$ here? Is it x or (x/255)?


texts:
The wavelet transform has a problem as it gives poor time resolution for low frequencies and poor frequency resolution for high frequencies according to uncertainty conditions.

This appears well while using the window notation. But when using bank filters, I can't imagine this problem. So, do bank filters solve this problem?

In addition, if there is a signal with maximum frequency equal to 1000 hz, how are low and high pass filters designed to decompose the signal according to a certain mother wavelet?


texts: Which Machine or deep learning algorithm is appropriate of this issue?

texts:
Suppose I have $n$ features as $Y$ = ($y_1 , y_2 ...., y_n$), and a matrix of $J$ of dimension $M$x$N$, one feature of $Y$ is selected randomly to be convolved with one random column of $J$ resulting a new vector called, for example, $X$.

The question, if I have the matrix $J$ and the vector $X$, can I detect the selected feature from $Y$ and selected column from $J$ using any deep learning algorithm? such that CNN or DNN ...... etc.   What's about if I don't have the matrix $J$ am I still able to detect the selected feature $y$ and column of $J$ based on $X$ ?

For example, let's $Y = [1,2,3,4]$ and matrix $J$ is any random matrix of dimension $4$x$4$. Hence, one random number of $Y$ either 1 or 2 or 3 or 4 is going to be convolved  with one column of matrix $J$, let's say element 2  of vector $Y$ is convolved with with second column of matrix $J$, so the resulted vector is $X$. So the question can we estimate the element selected from $Y$ based on matrix $J$ and resultant vector $X$ using machine or deep learning algorithm? I think yes we can, but what's the most appropriate algorithm to do that?

thank you


texts:
This code was working fine when I asked about it in Filter is too large but when I tried it again on another PC it gives me this error:

 Warning: Direct access of structure fields returned by a function call (e.g.,
                  call to Untitled2) is not allowed. See MATLAB 7.10 Release Notes, "Subscripting      Into     Function Return Values" for details.
    ??? Attempt to reference field of non-structure array.

This forwarded me to help about "Subscripting Into Function Return Values", where if you have a function, such as the following, that returns a struct array:

function structOut = getStruct
structOut = struct('fieldA', 5, 'fieldB', 10);

It is no longer valid to access fields of the structure by directly dot indexing the function's return value, as shown here:

getStruct.fieldA

Instead, you should first assign the returned structure to a variable, and then dot index the variable:

s = getStruct;
s.fieldA
ans =
     5

But how can I apply it to multiply values?


texts: Minimal number of additions in convolution

texts: The Winnograd algorithm can be used to reduce the number of multiplications in convolution. Is there a known method of reducing the number of additions in convolution?


texts: Proving the upper bound of cross correlation

texts:
I am reading about cross-correlation from this document and equation (5) states that

The maximum value of the crosscorrelation is not always when the shift
equals zero; however, we can prove the following property revealing to
us what value the maximum cannot exceed
$$R_{xy}(\tau) \le \sqrt{R_{xx}(0)R_{yy}(0)}$$

However, I could not find any proof for this equation. Does anyone have a resource regarding this property?


texts: What is the third coordinate in "Projective Transformation" of an image and how to build the matrix of the inverse transform?

texts:
I am trying to understand the formalism of the projective transform of 2D image.
it has 9 parameters (a-i) which the 9th is redundant since we use houmogenous coordinates.
this transformation preserves only straight lines.

$\pmatrix{x'\\ y' \\ w'}$  = $\pmatrix{ a& b& c\\\ d& e& f \\\ g& h& i}$  $\pmatrix{x\\ y \\ w}$

I have three questions according this formalism:

Since the redundancy (from 8 to 9) of degrees of freedom is $i=1$ ?
what is the $w$ and $w'$ ? are they parameters? how do i calculate them?
How can I find the parameters so I can transform the image to its original(from the black background image to the square one).

what I want to do is build the matrix to transform this image:

and find matrix $M$

so I get back this image:

All the images  above taken from here

What I want finally do is to find the

M = [a  b c;
     d  e f;
     g  h i];

t_proj = maketform('projective',T);
I_projective = imtransform(I,t_proj,'FillValues',.3);
imshow(I_projective)
title('unprojective - rectangular carpet')

taken from here


texts: Using beamforming, we can steer the radiated beam in a specific direction. This can be done in analog way (simple but not accurate) or digital way ( accurate but needs complicated design and processing). If we want to steer the beam in the LOS direction of a moving receiver, in real time, to keep the maximum radiated power in the LoS direction, what is the speed limit of the mobile for this? For example, is this possible for a receiver moving at 500km/h ?


texts: Autocorrelation Function and Power Spectrum

texts:
My aim is to determine the power spectrum of a signal of finite duration using

Its autocorrelation function
Performing FFT directly on the time-domain data

The function is defined as follows in the finite time interval from 0 to 10:
$$ \cos(10t) + \sin(20t) $$
I am using the library FFTW 3.3.4 in C source code and pretty confused about all the normalization constants involved. After some work I managed to get the purely real FFT of the real and even autocorrelation function but the FFT of the autocorrelation function has negative parts in it. My concern is that if this is the power spectrum by Wiener-Khinchin  theorem why it has negative parts in it. Furthermore, how can I normalize the output so that the power spectrum from the direct FFT of the time-domain data and the power spectrum from the autocorrelation functions are exactly the same. I am very confused about this subject and would like to be nudged in the right direction, any help and/or comment is appreciated.

Thanks in advance


texts: Time domain to frequency domain conversion of audio signals to extract 1/3 octave frequencies

texts:
I am writing first time in this forum and I am not expert in programming and FFT. We have developed an android app (Noise Tracker) for noise measurement using smartphones. It displays noise levels in Leq sound pressure levels.I want to implement A & C weighting. As per my knowledge it is desired to convert received signals from time domain to frequency domain and extract the noise levels for each 1/3 octave frequency band.it looks
Can anyone suggest me how to proceed or there is a ready available program that can be used as such.
your help can solve the problem

Thanks in Advance


texts: How do I know what is causing the noise in my signal

texts:
I have a noisy audio file, available here (It is safe to download if you wish to)
https://ufile.io/pstrt

Now, I inspect it in matlab:

And then i plot it on normalised frequency:

Now I need to filter this signal to remove the noise. However, I have no idea what is causing the noise in the first place. Perhaps it is obvious even from the two figures I have shown but unfortunately not for me. I could play a guessing game and apply different configurations of lowpass, highpass and bandpass filters, but I have quite a few of such audio files to analyse. Thank you for any help.


texts: Recovering a signal after nonuniform sampling

texts:
Let $x(t)$ be a bandlimited signal such that $X(j\omega) =0 $ when $|\omega|>M$. Also $p(t) = p_1(t) - p_1(t-\Delta)$ is a nonuniformly spaced periodic pulse train where $$p_1(t) = \sum_{k = -\infty}^{+\infty}\delta\left(t - \frac{2\pi k}{M}\right), \quad \text{with}\quad \Delta= \frac{\pi}{2M}$$

Let $x_p(t) = x(t)p(t)$ and apply an ideal low-pass filter with cutoff frequency $\omega_c = M$ to $X_p(j\omega)$. The result is $z(t)$. Design a system which recovers $x(t)$ from $z(t)$.

My try:
It's easy to see that
$$P(j\omega) = \left(1 - e^{-j\Delta \omega}\right)\left(M\sum_{k = -\infty}^{+\infty}\delta(\omega - kM)\right) = M\sum_{k = -\infty}^{+\infty}\left(1 - e^{-j\Delta kM}\right)\delta(\omega - kM)
$$
Also we have
$$
X_p(j\omega) = \frac{1}{2\pi}X(j\omega)\star P(j\omega) = \frac{M}{2\pi}\sum_{k = -\infty}^{+\infty}\left(1 - e^{-j\Delta kM}\right)X\big(j(\omega - kM)\big)
$$
Since $\Delta= \frac{\pi}{2M}$ we have
$$
X_p(j\omega) = \frac{M}{2\pi}\sum_{k = -\infty}^{+\infty}\left(1 - e^{\frac{-jk\pi}{2}}\right)X\big(j(\omega - kM)\big)
$$
After low-pass filter we get
$$
Z(j\omega) = \begin{cases}
\frac{M}{2\pi}\bigg[(1+j)X\big(j(\omega - M)\big) + (1-j)X\big(j(\omega + M)\big)\bigg],  & \lvert \omega\rvert < M\\
0, & \text{O.W}
\end{cases}
$$
I've got stuck here. How can we recover $x(t)$? I tried to use phase shifter and $z(t)\cos(Mt)$ but it didn't work.


texts:
What kind of pros and cons does these method for identifying a system have?
I seem to have a hard time finding literature discussion in this issue.

I am operating on a linear system, or the linear area of the system. So non linearity isn't an issue here.


texts: Real time signal processing use cases for eigenvalues of symmetric matrices

texts:
I realize that this might be somewhat of an unusual and specific question.

I know that the eigenvalues of symmetric matrices are used in a number of ways in scientific computing, such as for finding numerical solutions to differential equations.

However, when considering real-time applications, I have only been able to find applications which also require the eigenvectors to be found. These include the MUSIC algorithm and principal component analysis.

Does anyone here know of any real-time applications/algorithms which only requires the eigenvalues of symmetric matrices?

EDIT:

The reason I am asking is that I have designed a hardware architecture for finding eigenvalues of symmetric matrices. I am looking for some kind of application where I can demonstrate its capabilities.


texts:
I am working on the burst qpsk transmit receive with data rate varying from 100 kbps to 1 mbps.
My modem works fine for continuous tx & rx with costas loop for carrier recovery and Gardner for timing recovery. But in the case of burst transmission will the same loop filter for timing and carrier recovery work as in continuous tx? My timing recovery blocks are polyphase filter -> Gardner -> loop filter -> interpolation control. My interpolation control (mu) is not constant after the header bits are over? Timing recovery should happen in the header bits and remain constant in the data bits.


texts:
I am using machine vision for industry task with opencv. I have images from a camera monitoring the process. The detailed look at the small part of the image follows:

Enlarged:

In the detail, it is possible to see pixel chessboard-like pixel structure. I can get rid of it in many ways (any kind of blur or averaging will do the trick). However, I would like to know where this structure origins. My ideas:

camera use colors by default - can the grayscale setting use the RGB sensors in the way that cause this?
could this be produced by compression or storing of the images? I have no information about how it is done - but the images are in PNG format when I get them.

As I said, I can homogenize the image, but I wonder, maybe there is something fundamentally wrong what we do and that should be fixed.


texts: How to understand the filter coefficients in FIR filter

texts:
Here it is the difference equation we have:

y(n) = -0.25x(n) - 0.15x(n − 1) + 0.78x(n − 2) − 0.15x(n − 3) - 0.25x(n - 4)

I understand that is FIR. The coefficients are selected in the way that certain input signal frequencies are removed by such convolution system. Take Matlab audio file gong.mat for example, we read the file then we have input signal x and sampling rate Fs, then through such system, we have output signal y. How do we understand the filter coefficients that make some input signal frequencies are filtered? Different coefficients lead to different filter type? Can we estimate what frequencies are removed?


texts:
With a signal x of length $2^{16}$,  the DWT (computed for example with pyWavelet's wavedec) has only 16 or 17 rows (the wavelet scale is dyadic).
Is there a DWT with more scales? (ex : 1024 rows instead of 16!)


texts:
While simulating a MISO system, I am trying to consider the effect of varying the distance between the transmitter and receiver on the BER.

My search for the effect of varying distance has pointed me to Log Distance Path Loss.

My query is where should I include this path loss during the Matlab implementation. Should the received signal be convoluted with the path loss?

I am completely clueless as to how this can be included. Any resources or pointers to theory would be appreciated.


texts: Binary and Quadrature Phase Shift Keying

texts:
I was learning Modulation Techniques and was on the topic Phase Shift Keying (PSK). As far as I have understood,

In Binary PSK we encode a single bit on a one signal element and we differentiate between two bits (or two signal elements) by their different phase.  And that it's favorable to keep the phase different maximum between the two different signal elements, so we use a phase difference of 180 degrees.

In Quadrature PSK, we want to transmit two bits per signal element. Since there are four different possible combinations of two bit numbers, we want four distinguishable signal element to distinguish between the four combinations. So we use signal elements with four different phases and with a difference between them of 90 degree (which is maximum possible).

Untill here, I seem to understand it. Correct me if anything from above is wrong.

I read from a source that in QPSK, the four different phases are 45°, 135°, 225°, and 315°. The excerpt from the said text is as under

  It makes sense to seek maximum separation between the four phase options, so that the receiver has less difficulty distinguishing one state from another. We have 360° of phase to work with and four phase states, and thus the separation should be 360°/4 = 90°. So our four QPSK phase shifts are 45°, 135°, 225°, and 315°

My first question is, aren't phases relative? What are these phase shift of 45°, 135°, 225°, and 315° relative to? My common understanding makes me wonder wouldn't just four sine waves, one not shifted at all, second sifted 90° relative to the first, third shifted 180° relative to the first, fourth shifted 270° relative to the first make more sense and be appropriate to represent different data elements?

The same text states that

  The term “quadrature modulation” refers to modulation that is based on the summation of two signals that are in quadrature. In other words, it is I/Q-signal-based modulation. QPSK is an example of I/Q-based modulation.

My second question is, how exactly is four different phases achieved by modulating the amplitude of just two- I & Q signals? At first, it seems to me that I/Q signaling can only be used to shift a signal 90° (i.e., 45° in each direction).

Also, Whether Binary PSK is also done using I/Q-based signals?

There's another question I and Q components and the difference between QPSK and 4QAM which (maybe) addresses my problem, but it's too complicated and mathemaical for a beginner like me.


texts: How to get started with fingerprint recognition?

texts: I have started with Matlab and Digital Image Processing. I am trying to do Fingerprint recognition. I found many research papers regarding this but I am unsure where to start. Concisely, what is the most basic approach/algorithm for doing fingerprint recognition ?


texts: I just started out in signal processing I am trying to make a low pass filter with a 0 - 10000Hz Passband and has a maximum attenuation of 3db. Is the passband attenuation the same as the passband ripple? If so why is it that even though I am using a Bessel filter I still have a passband ripple of -3db?


texts: What is an Intuitive Explanation of the Phase of a Signal

texts:
I understand that the meaning of the phase response of a system is simply how much the system delays a frequency component. However, I do not find an intuitive explanation for the phase of a signal. The representation the Fourier transform of a signal by polar coordinates, produces two components; the magnitude and the phase. The magnitude response is simply how much each frequency component is contributing to this signal. However, what is the meaning of the phase here? Can I know if a frequency component is "exist" in the signal by just looking into the phase of a signal?

I found an explanation here:

  determines how the sinusoids line up relative to one another to form a
  signal

But the did not help me.


texts:
I have one recorded signal (.wav) and the calibration signal (.wav - 94dB @ 1kHz).

I want to know how to calibrate the recorded signal using the calibration signal, for example, in Matlab.
My tasks are

estimating background noise level,
equivalent levels

Aeq,
Ceq,
Zeq,

max-values of

S and
F time

integrations

ASmax,
AFmax and

peak values

Apeak,
Cpeak,
Zpeak.


texts: How can I know the type of filter from its cutoff frequency?

texts:
So I have the following equation
$$
y[n]=0.9y[n-1]+0.1x[n]
$$

We can find easily find the transfer function, which is

$$
H(z)=\frac{0.1}{1-0.9z^{-1}}
$$

and from that, the frequency response, which is

$$
H(e^{j \omega})=\frac{0.1}{1-0.9 e^{-j \omega}}
$$

To find the cutoff frequency we just make the magnitude of the above equal to $\frac{1}{\sqrt{2}}$. Then, $\omega_0 = 0.0675\Rightarrow f_0 = 0.0107$.

Okay, so how can we say that given  $f_0 = f_c$ the filter is a LPF or HPF?


texts: Exam Question - end-to-end delay from video capture to video playout

texts:
Hi I'm preparing for my exam tomorrow and I've come across a 17 Mark question which seems trivially easy, so I think I'm missing a key point giving the rest of this exam is fairly difficult.  The question is below and my attempt is below that.
Question

The frame sizes are below:

My attempt:
I looked up video capture on wikipedia and it defined it as the process of converting an analog signal to digital - so I took the point at which frames were captured as being after they were digitised.  We are told to ignore the time taken for compression and decompression, so the next part is just to send the data.  The total amount of data in the frame sequence is 54KB (I'm not sure why the frame sequence starts and ends with an I-frame to be honest - doesn't seem to make sense).  So to transfer 1s of video will take 0.27s.
To be play a second of frames smoothly the the playout buffer must contain 25 frames minimum.  The sequence of frames is IBBPBBI which has a total size of 54 KB.  In one second the playout is 54 x 25 = 0.432 MB/s.
I'm pretty sure that we would need to make some estimations to solve the rest of this.
As always I'm open to any suggestions!  Thanks for reading :D


texts:
What exactly is one looking for in audio data to find different instruments or energy sources?

So the FFT can extract frequencies, but how can e.g. percussion be detected alongside e.g. a bass line?

Would the frequency bins be checked into a frequency mapping of instruments? This would lead to collisions in possible instruments.

Are the frequencies of a FFT output directly mappable to pitch frequency charts or should there be a conversion first?


texts: I'm implementing high resolution DOA algorithms including ESPRIT for radar systems. The word ESPRIT is obviously an acronym but, even so, how is it pronounced? Is the second i long like "ESPREEE" as the French would pronounce it or is it a short second i?


texts: Mulitplication in Frequency Domain as a Similarity Measure of Audio Clips

texts:
I have an audio clip and I copy a 256-point part satarting at 10th second. Then I create a 256-point frame on the original clip. At every itreation, I calculate the DFT of the frame, multiply it with the DFT of the interval I copied, take the mean of the result and append it to a list and shift the frame 1 point right. When I graph the means, I know I should get the maximum value of convolution when the copied interval's DFT is multiplied with itself. And this is supposed to show that convolution can be used as a similarity metric. However, when I apply the explained procedure, I can't get a peak that is distinguishable from any other value. What I have done is as follows:
    import numpy as np
    import scipy.io.wavfile
    import matplotlib.pyplot as plt

    rate1, data1 = scipy.io.wavfile.read('Africa.wav')

    data1 = np.array(data1, dtype=np.float64)

    interval_1 = data1[rate1 * 10: rate1 * 10 + 256]

    dft_1 = np.fft.fft(interval_1)

    cv = []

    for i in range(data1.size - 256):
        dft = np.fft.fft(data1[i: i + 256])
        Y = np.multiply(dft, dft_1)
        Y = np.abs(Y)
        Y = np.mean(Y)
        cv.append(Y)

    cv = np.array(cv)

    plt.figure()
    plt.title("Convolution with 256 point sample at 10th second")
    plt.xlabel("Samples")
    plt.ylabel("Amplitude")
    plt.plot(cv)
    plt.show()

I get the following graph:


texts:
I'm struggling to validate that my C++ implementation of a filter I designed in Matlab is correct.

My first issue is to make sure I'm implementing the sections in the right order. This is the output of the SOS matrix from fdatool:

0.5961   -1.1815    0.5961    1.0000   -1.9792    0.9884
0.5793   -1.1475    0.5793    1.0000   -1.9555    0.9649
0.6200   -1.2266    0.6200    1.0000   -1.9300    0.9398
0.5658   -1.1167    0.5658    1.0000   -1.9013    0.9119
0.4348   -0.8542    0.4348    1.0000   -1.8689    0.8806
0.3066   -0.5967    0.3066    1.0000   -1.8330    0.8459
0.1814   -0.3451    0.1814    1.0000   -1.7960    0.8104
0.0735   -0.1285    0.0735    1.0000   -1.7637    0.7794
0.0168   -0.0087    0.0168    1.0000   -1.7443    0.7609

I'm assuming that the sections should be processed from top to bottom, is that correct?

My second question is to do with scaling. I was scaling my filters using scale(Hd) directly, but I'm noticing that I get inconsistent results in my program. I have generated multiple filters that should output roughly the same data but the peak values are quite different. I noticed there is a ScaleValues property on the filter object, after scaling the values are mostly 1.0:

0.1047
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000

I was all ready to assume these are applied to the output of each section, then I noticed there is 1 more scaling value than section. How are these values used?

Final question, given the options to scale, not to scale, various ways to scale, if I'm targeting a 64-bit CPU or maybe GPU doing my math in double-precision floats, is there an optimal way to configure scaling?


texts: Calculate Phase angle between two signals i.e. digital Phase meter

texts:
I want to calculate the phase difference between the two channels(signals) of a stereo audio file.(uncompressed data i.e. PCM samples).

I want to determine whether whether two signals are in phase or not i.e. kind of digital phase meter ?
Not the exact phase difference.

Can you please suggest a algorithm to calculate the phase difference.

Added--

What I'm expected to identify is Phase difference between signals (due to noises , disturbances) recorded separately then feed to left and right channel.


texts: What's the difference between SISO and SIMO in using matched Filters

texts:
Suppose we are transmitting a signal $x$ in $OFDM$ with $N$ subcarriers, After performing Parallel/Serial conversion and then N-points
 FFT, we suppose to have signal $s = IFFT^Hx$, Then adding the Cyclic prefix $P$ will create the transmitted signal $M$ such that:
$M = s +  P$. Before transmitting that signal, let's use Passband with matched filter (Or rrcpulse filter) whose sampling frequency is
$Fs$ and period $Ts = 1/Fs$, and carrier frequency $Fc$.

In SISO (Singl input singl output) system, it's clear that we should use matched filters with same parameters of that matched Filter
which was used in transmitter side.

My question, suppose that we are using SIMO (Singl input Multi output) system, four copies of signal should be recieved with
total length 4-times the transmitted signal.
My question, In that case, Should we use same matched Filter parameters for the received signal of SIMO system? How should we deal
with received SIMO signal? Or I think the period Ts should equal to $Ts/4$  ??  What's paramters should be changed?..

thank you


texts:
I have a bunch of data that went through a hardware filter before being digitized. The data has been taken this way for quite some time, and everyone is fine with that. Now, there is a new application in development that requires unfiltered data. Rather than wait a year to collect new data, we would like to "unfilter" this old data. The transfer function of the hardware filter is: $$H(s)=\dfrac{24.2s+1}{2.2s+1}$$

My first throught was to take the inverse of this transfer function, and go straight to the z domain by applying the Eurler approximation. $$f_s=30Hz$$

$$H(z)=\dfrac{67-66z^{-1}}{727-726z^{-1}}$$

Converted to the difference equation:

$$V_{in}[n]=10.8507V_{out}[n]-10.8538V_{out}[n-1]+0.9851V_{in}[n-1]$$

I've run data through that difference equation in Scilab, and got a result. I want to validate the difference equation by running the result through the difference equation of the original filter, but I haven't been able to get the original data out of the second difference equation.

Which leads me to question, is what I've done here even valid? Is what I'm trying to do even possible?


texts: What would the target matrix to train Neural Network?

texts:
I'm new at Artificial Neural Network and I'm using MATLAB developing Facial expression recognition and There are six expressions ; I'm not able to understand about How to create a target matrix? My Question is if I have SampleMatrix containing samples rows*columns. While rows are the features and 29 columns represents a single sample I meant to say 29 columns belongs to the same class and If SampleMatrix dimensions are 21007*174. 174 columns because I have 6 classes 6*29=179 What would the target matrix?

Kindly Help me out!
Thanks.


texts: Why should the last point be excluded when performing a least-squares fit of a periodic discrete time signal?

texts:
I fitted the function: f(t)=A_o+A_1 cos(wt)+B_1 sin(wt) to the following periodic discrete signal:
t=0:0.15:1.5;

y=[2.200 1.595 1.031 0.722 0.786 1.200 1.805 2.369 2.678 2.614 2.200];

Where w=2*pi / T, and T=1.5 seconds.
It happens that the fitted curve presents a phase shift with respect to the data. I consulted books on this topic and I found that I should exclude the last point of the series in order to get the right answer,...

I suspect that this matter is related with the exclusion of the last point in the calculation of the DFT, but do not find a mathematical argument that can prove this statement.
I would appreciate any mathematical explanation on this matter.


texts: How is the frequency vector being derived?

texts:
I am having a hard time understanding how the frequency vector is being derived in this code. I would appreciate any guidance from anyone.

 Frv = linspace(0, 1, fix(numel(FTSignal)/2)+1)*Fn;


texts: Calculating the SNR from the power spectrum. Is my suggestion relevant?

texts:
I have a signal that is sampled at $20 \mathrm{Hz}$. It has almost stationary behavior, with a main frequency around $1\ \mathrm{Hz}-1.5 \ \mathrm{Hz}$. This frequency range is to be expected and is of interest for further processing.  Unfortunately, I don't know the noise present at the signal in order to calculate the SNR of the signal as a way of assessing its quality.

I was thinking that since I know a priori the frequency range of the fundamental frequency of interest that should exist in the signal, I could calculate the SNR based on the power spectral density (PSD) of the signal. Moreover, after PSD calculation using Welch's method, I could integrate within a frequency range that corresponds to my main frequency (assuming that within this frequency range there is one main lobe) and divide that to the integration of the rest of the calculated spectrum as an SNR metric:

$$\mathrm{SNR}_\textrm{metric}=\frac{\int_{n_{f_1}}^{n_{f_2}}p_{xx}(n)*f(n)dn}{\int_{n_\textrm{f=0}}^{n_{f=f_1}}p_{xx}(n)*f(n)dn + \int_{n_{f=f2}}^{n_{f=\textrm{flast}}}p_{xx}(n)*f(n)dn}$$

where $p_{xx}$ the PSD, $f(n)$ the corresponding frequencies vector based on Welch's PSD calculation method, $n$ is the index of the frequencies and $f_1$, $f_2$ is the bandwidth at the PSD that surrounds the fundamental peak of the frequency of interest that should be around 1.0 to 1.5 Hz when the lobe attenuates completely.

Would you consider this approach valid and why?
If you have advice for a different method to calculate the SNR let me know!

I would like to thank everyone in advance.


texts:
I need to track an object in a video with MATLAB. There is an example frame from the video above. I need to track that car that carries the pendulum. But my problem is there is a bar behind the car that has similar color to the car. So I can not just apply img2bw with certain threshold to find the car.

What can I do to isolate it? Since it is my homework I am not asking for a complete code. I want your advice.


texts:
This code is taken from a pitch detection algorithm. It is called before pitch detection to remove low-frequency noises.

def highpass_filter(y, sr):
  filter_stop_freq = 70  # Hz
  filter_pass_freq = 100  # Hz
  filter_order = 1001

  # High-pass filter
  nyquist_rate = sr / 2.
  desired = (0, 0, 1, 1)
  bands = (0, filter_stop_freq, filter_pass_freq, nyquist_rate)
  filter_coefs = signal.firls(filter_order, bands, desired, nyq=nyquist_rate)

  # Apply high-pass filter
  filtered_audio = signal.filtfilt(filter_coefs, [1], y)
  return filtered_audio

I have trouble understanding what the parameters filter_stop_freq, filter_pass_freq and filter_order mean. I have read this but it did not help me.


texts: Applying a window function to a speech signal

texts:
I'm currently developing a speaker recognition system. I have two main problems:

What is the most suitable windowing function to apply to a speech signal prior to the STFT?
Is it necessary to apply more than one windowing function?


texts: Expression for Frequency-shifted Gaussian pulse

texts:
I am doing some research on UWB radars which transmit frequency-shifted Gaussian pulses. These pulses are given by:
$$
g(t)  = p(t)cos(2\pi f_{c}t) = V_{TX}exp(-\frac{t^{2}}{2\tau^2})cos(2\pi f_{c}t)
$$
where $f_{c}$ is the center or carrier frequency, $V_{TX}$ is the peak amplitude and $\tau$ determines the Bandwidth of the pulse (you can think of $\tau$ as the standard deviation of $p(t)$. This expression in some papers is equivalent to a higher order derivative of the Gaussian function $p(t)$, such that:
$$
g(t) = \frac{d^{n}}{dt^{n}} \left( V_{TX }exp(-\frac{t^{2}}{2\tau^2}) \right)
$$
where $n$ denotes the derivative order.
Does anyone know how these two expressions are related? Is there a way of obtaining one from the other?


texts:
This is my first time working with Mel-frequency cepstral coefficients and I have two questions....

Are some of the 13 coefficients strictly related to some sound properties like frequencies, amplitude, pitch or something ? For example if I'm interested only in sound pitch, are there some coefficients that carry that information and I can exclude the rest of the coefficients that carry other information to reduce the size of the vector ? Or those coefficients means nothing individually and they must be used all together as a whole ?
I'm trying to learn Chord recognition methods. I was thinking for calculating MFCC from a short Wave file where chord is played. (It is just a chord played on piano, there is no ambient noise or other instruments). And after I get the 13 MFCCs, cluster them to a centroid which describes the appropriate chord. (24 centroids, 12 for minor chords, 12 for major). I'm just wondering, are the MFCCs good descriptor for the present pitches in the sound ?

Thanks in advance


texts: How general are adaptive-filtering techniques?

texts:
How often do problems arise that let you use adaptive filters? Unless I am understanding something incorrectly it seems the requirement that the input signal be stationary(or even WSS) is too strong for most places I would want to use adaptive filters.

Am I wrong? How often do adaptive filters come up in communications and control?


texts: What are the most robust implementations of passive/self-localization assuming high noise and reverberation?

texts: I am doing research on a related subject that requires the use of TDOA estimation of two signals in an environment with a great deal of noise and reverberation. If anyone had any expertise on (or links to research regarding) robust passive localization/self-localization, it would be greatly appreciated - thanks!!


texts: Determining the resulting pixel value before creating a compressed JPEG image

texts:
Is it possible to determine the resulting pixel values and modify them before the compressed jpeg image is actually created?

For example, I'm at the stage where I already have the quantized DCT coefficients of the original image and I want to change all pixels of the resulting image with a (255, 255, 0) value to (255, 254, 0).

What I was thinking is, if this is possible I would need to:

Get the equivalent DCT coefficient of original image and do quantization
Determine the resulting pixel values and do desired changes
Obtain the new DCT coefficients that will result to it
Proceed to Huffman encoding

Can the following be done during Huffman encoding?

Get the equivalent DCT coefficient from YCbCr and do quantizations
Do Huffman encoding and modify the desired pixel


texts: What's the best criterion for determining a frequency peak?

texts:
I'm writing an algorithm that analyzes results of discrete Fourier transform (DFT). The algorithm should detect amplitude peaks in predefined ranges of frequencies. This is an example of such a peak:

Vertical red lines are range boundaries (left and right) and range center (middle).

What are the best criteria for determining the absence of this peak in a specified range?

For now I'm using standard deviation and comparing it to some calibration value. But it can be easily confused with some high amplitude noise like this:


texts:
Why are Fourier analysis and transform only applicable for LTI systems?
What if the system is not LTI, won't Fourier analysis or transform be possible?


texts: FIR Filter implementation vs Linear convolution implementation

texts:
I came across a C code for the FIR filter on one of the websites. It is as follows

 void fir(short * y, const short *x, const short *h, int n_out, int n_coefs)
 {
      int n;
      for (n = 0; n < n_out; n++)
      {
          int k, sum = 0;
          for(k = 0; k < n_coefs; k++)
          {
              sum += h[k] * x[n - n_coefs + 1 + k];
          }
          y[n] = sum;
      }
  }

I used the following input in my main function. Considered n_coeffs as 4 and n_out as 7 (4+4-1). And the coefficients are as follows (after padding)

x ={1,2,3,4,0,0,0};
h={1,2,3,4,0,0,0};

And then, I modified the above FIR code as follows and used it in my function

for (i = 0; i < 7; i++)
{
    y[i] = 0;

    for(j = 0; j < 4; j++)
    {
            y[i] = y[i] + h[j] * x[i - 4 + 1 + j];
    }
}

And the obtained output is {4,11,20,30,20,11,4}

But when I perform convolution operation,

 for(i=0;i<7;i++)
 {
    y[i] = 0;

    for(j=0;j<4;j++)
    {
        y[i] = y[i] + h[j] * x [i-j];
    }
  }

The obtained output is {1,4,10,20,25,24,16}.

Ideally, both convolution and FIR Filter should give the same output, right?

And one more thing I observed is the output will be {4,11,20,30,20,11,4} when the h coefficients are time-reversed before padding i.e. when h={4,3,2,1,0,0,0}.

I am confused a bit, where I am going wrong?


texts: How to account for multiple signals in the input to a Kalman filter

texts:
I am interested in using a Kalman filter to track an oscillating signal due to a physical oscillator in a signal which contains the signal from multiple such oscillators oscillating at different frequencies. The signal in this case is simply a voltage value changing with time.

I have thus-far been using sinusoidal Kalman filters for this, however they do not perform optimally as the oscillator is not a perfect sinusoid, it experiences amplitude changes, phase jumps and changes in frequency slowly over time, the first 2 it can correct for, but the last causes the Kalman filter to not be centred on the correct frequency anymore and perform poorly.

However it was suggested to me, that, as long as I use a high sample rate (~25 samples per oscillation) a simple kinematic filter (tracking position, velocity and acceleration) will track the signal, and then there is no problem if the frequency shifts as it is just tracking the position of the oscillator with no forced frequency assumed.

For this kinematic filter, would it require me to filter out the signal of the oscillator to be tracked from the other oscillators with a bandpass filter? Alternatively would tracking the motion of all the oscillators simultaneously work? Without some sort of technique I see no way that such a filter would know what the signal it was required to track was.


texts:
The following makes sense to me:

Decimation reduces the number of samples so it reduces the amount of data that is metered across networks and reduces the processing time for chips. That sounds great.

However, the following does not make sense to me:

I see decimation used in gnuradio-companion all the time.  Often the signal is decimated to reduce the sample rate, then later the sample rate is increased somehow.  What is the point of this?

Sorry for the vagueness of this question.


texts: MATLAB: Issue with passing data through AWGN Channel

texts:
I am trying to send QAM data through AWGN channel and I have 256 samples/symbol, I have the following code:

data = randi([0 3], 1, 2^12); % Generate data
dataMod = qammod(data, 4);  % Modulate data
dataMod_u = upsample(dataMod,256); % Upsample
b = rcosdesign(0.25,8,256,'sqrt');
dataMod_f = filter(b, 1, dataMod_u); % Tx Filter

channel2 = comm.AWGNChannel('EbNo',15,'BitsPerSymbol',2,'SamplesPerSymbol',256);
ch_out2 = step(channel2, dataMod_f); % Pass through channel
ch_out_f2 = filter(b,1,ch_out2);    % RX Filter
ch_out_f2 = downsample(ch_out_f2,256); % Downsample
scatterplot(ch_out_f2)

I get the following scatter plot after passing through channel:

Why I don't see the modulated output, what am I doing wrong?


texts:
I've read this signal from a radio remote that opens a gate. This signal is already after AM demodulation, read by using a Saleae logic analyzer:

I don't know much about signal processing, but I would like to emit the same signal with my own transmitter. To do this I would like to know what encoding this signal is using? Is it possible to determine the encoding type only by looking at the signal?

The spikes at the left is the beginning of the signal. I've truncated the rest of the signal because I guess there's no point in showing all of it.

Also could anyone guide me to some good resources about self-clocking signals, usage of low duty cycle clocks in signals, that would help me to decode the message in this signal?


texts: Is the Laplacian Filter an High Pass Filter (HPF)?

texts:
Is this kernel name as mean difference kernel or Laplacian filter?

Is mean difference just a method?


texts: Why Butterworth filter always starts my signal from from zero mark (amplitude)?

texts:
I am trying to filter my force signal using Butterworth low pass filter.

so this is the signal, I  have to filter (noise frequency is around 33 Hz). So when I use Butterworth filter with following command in MATLAB (with sixth order):

[B,A]=butter(6,5/100,'low');
forceS=filter(B,A,forceS);

the result I get is

So the problem is the filtered signal start from zero mark instead of around 1.5. How can i start the filtered signal from the same value as unfiltered signal has?

Thanks


texts: Extracting feature from audio track using DWT

texts:
Our teacher gave us an assignment: Write a program to transform an audio track to time - frequency domain, and create a vector include at least 4 features extracted from transformed output signal.

I think that i have to write a program that read an audio file, transform it into an vector of signals, which is the input of dwt algorithm, and i will get transformed output signal. After that, i use the output as an input of some functions to get extracted features.

I have some serious problems, due to lack of knowledge. I have very limited knowledge of physic, math, audio processing. Assume that what i'm thinking are right, then i don't know how many signal arrays should i get from the audio track and how to do it. I haven't figured how DWT work and the meaning of the DWT output, so that i don't know what to do with arrays of input signal. And the last are the extracted features, what features can be extracted using DWT (maybe i just needed the keyword, if i could understand DWT).

Thank you for your help!


texts: Dithering adds harmonic distortion after filtering and upsampling

texts:
I have an issue which I wasn't able to solve for a few days. I have implemented a polyphase FIR interpolation filter within an FPGA which does interpolate by a factor of 8 or 16 times. I do accept an audio word of up to 32 bits and coefficients are quantized on 35 bits resulting in MAC units of 32x35 and an accumulator with width of 67 bits.

The filter itself works flawlessy. There aren't any issues in general. However, I did add a dithering algorithm which uses LFSR to generate a random number two times in a row which is then added to the output from the filter (67 bits wide) in order to reduce bit-depth from 67 bits to lets say 18 bits. LFSR does generate a uniform distribution, so adding two pseudorandom numbers generated by it results in a triangular distribution (TPDF dithering).

For the sake of simplicity I did implement following equation within VHDL:

output_lch_sample_dithered_int <= std_logic_vector(signed(output_fifo_lch_sample_int) + signed('1' & dither_rnd1_int(47 downto 0)) + signed('0' & dither_rnd0_int(47 downto 0)));
output_rch_sample_dithered_int <= std_logic_vector(signed(output_fifo_rch_sample_int) + signed('1' & dither_rnd1_int(47 downto 0)) + signed('0' & dither_rnd0_int(47 downto 0)));

It has a forced sign, so hopefully the triangular distribution is around 0 (from -1 to 1 by simplifying the idea). Keep in mind that lch_int has 67 bits. Basically dither_rnd0_int is the first generated output from LFSR and dither_rnd1_int is a previous dither_rnd0_int which is replaced with a new value each tick (the same clock is used for both). I have tried different ways of summing random values (signed, unsigned, addition, subtraction) to match the generic requirement it all does result in the same issue.

As soon as I add those pseudorandom values generated by the LFSR to low leveled signal like -96 dBFS several harmonic distortion (mostly 2nd, 3rd, 4th and 5th) do show up. This is not happening with signal -60 dBFS and above. In fact, there are no changes at all within higher signals (no distortion changes and no more noise).

Following are two measurements of a -96 dBFS signal with and without dithering to visualize the issue:

Without dithering:

With dithering:

The most interesting part is that a signal of level -70 dBFS does in fact gain a bit from using the same dithering:

Without dithering:

With dithering:

Somewhere around -75 dBFS is where dithering changes nothing and the lower we go it gets worse with dithering since it does bring strange harmonic distortions.

It's an old R-2R 18-bit DAC from late 80 / early 90, so don't mind the generic THD, just the difference.

The question is where do those extra harmonic distortions come from? Are they hiding within LSBs which I'm truncating and I do not see them unless I enable dithering which simply reveals them? If so, why would there be there? How can FIR coefficients introduce harmonic distortions? Considering the fact that I do quantize them on 35 bits with rounding I would not expect any issues above -150 dBFS or so.

This issue happens only if dithering is done AFTER filtering. If I dither input signal (before filtering and upsampling) the results are correct and quantization error is transformed into random noise. I did try to implement different coefficients with different windowing methods and types (linear or minimum), but the result is always the same.
This issue happens only when I want to reduce bit depth of filter output (67 bits) to 18 bits and only at low leveled signals. If I add dither to an input word of 32 bits effectively reducing it to 18 bits I do get correct results.


texts: Relation between the DTFT and the spectrum of a sampled signal

texts:
In the $\rm DTFT$ (Discrete Time Fourier Transform) the spectrum is periodic with period of $2\pi$ . A continuous signal when sampled has a spectrum which is a repeated version of its original spectrum before sampling with a period of sampling frequency. Both have periodic spectrum and both are discrete in nature.When we sample continuous signal, its values at 'nTs' is multiplied by impulse fn.But in discrete aperiodic signal it is of finite height( where impulse has infinite height)

Question is:

Can both signals be considered similar because their spectra are having a kind of similarity?
Is there any application for the above observation?


texts: How can I detect if a filter is FIR or IIR according to impulse response graph?

texts:
I have the following two graphs but I don't know how to recognize from the graph if they are IIR or FIR! Can you please guide me through?

P.S.: Does MATLAB have a function to detect if an impulse response graph corresponds to IIR or FIR?