texts: Is there a difference what measurement units use in covariance matrix

texts: The R matrix in the Kalman filter contains measurement noise. Diagonal elements of the matrix is the power of standard deviation. Is there a difference what measurement unit to use for standard error representation? For instance is there difference between meters and kilometers or radians and milliradians? Should all elements have a similar scale?


texts: Circuit simulator with variable simulation time step. How to obtain FFT afterwards?

texts:
I know that I am not the first one with this problem, but I didn't manage to find the proper answer, so I hope you would like to help me.

From an electric circuit simulator, I simulated my circuit in time domain and saved a signal in a .txt file (which contains both time and signal values).
Based on that .txt file, I would like to produce a FFT to see the signal in the frequency domain.

Unfortunately, the circuit simulator has a variable time step, which gives me a headache to obtain the correct FFT values (two-sided or one-sided is second priority at this point)

I managed to get some FFT out of my data, but I am having difficulties verifying the correctness of it, and hence appreciate any help on this matter. My simulation files give me different values for Average and RMS values, hence the confusion. Thank you.
The link to my .txt file is given below (since I couldn't find a way to upload the txt file here directly):
https://file.io/PXuD9sWR

My Python code:

import numpy as np
from scipy.fftpack import fft
import matplotlib.pyplot as plt
import pandas as pd

buckstruct = pd.read_csv('buck.txt', sep = '\\t', engine='python')
bucktime = buckstruct.iloc[:,0]
bucktime = bucktime.values.tolist()
buckcurrent = buckstruct.iloc[:,1]
buckcurrent = buckcurrent.values.tolist()
bucktime_flt = []
buckcurrent_flt = []

# Filter out the start-up transient. Save only steady state values
for i in range(len(bucktime)):
    if bucktime[i] > 0.002:
        bucktime_flt.append(bucktime[i])
        buckcurrent_flt.append(buckcurrent[i])

plt.plot(bucktime_flt, buckcurrent_flt)
buckfft = fft(buckcurrent_flt)
buckfft_flt = []

# Double the amplitude for harmonics as a first step to converter from two-sided to single-sided FFT
for i in range(len(buckfft)):
    if i == 0:
        buckfft_flt.append(1.0/len(bucktime_flt)*abs(buckfft[i]))
    else:
        buckfft_flt.append(2.0/len(bucktime_flt)*abs(buckfft[i]))

plt.plot(buckfft_flt)


texts: Why is the term deconvolution used more for signals and not so much (or at all) for systems?

texts:
Wikipedia defines mathematical deconvolution here, and with the examples given and my experience, what I've read over the years is that deconvolution is used to determine an input signal provided a measurement of a system's output signal, and the known frequency response or transfer function of the system.

But in the case where you know the input and output signals of a system, and rather chose to determine the frequency response or transfer function of the system, I don't think I've ever seen that called deconvolution - but it is deconvolution nevertheless, right? Even though most call it "System Identification"

The examples given in wikipedia seem to suggest deconvolution is strictly involving derivation of a signal, but given the equivalence of signals and systems in a mathematical sense, is it wrong to call system identification deconvolution?


texts: Pose from Homography matrix - Zhang method

texts:
This post also contributes to the post at Step by Step Camera Pose Estimation for Visual Tracking and Planar Markers by Jav_Rock (since I cannot add any comment there and I don't know why)

It can be seen that the translation vector 1x3 and rotation matrix 3x3 can be derived from homography matrix.
However, the following question is:  Where are the camera coordinate system and object coordinate system and how are they attached to the camera (or object) ?
There is the relative transformation between the two but the computation from homography or transformation matrix implies nothing about these coordinate systems' location & direction

Then, how to solve the pose estimation problem ?


texts: Why doesn't the delay of an FIR filter equal the number of taps but half of them?

texts:
I have seen the mathematical proofs that show that the delay of an FIR filter is half the filter order, i.e N/2. Yet I am still confused:

When I look in the time domain, the output of the filter is:
\begin{align}
 y[n] &= b_0 x[n] + b_1 x[n-1] + \cdots + b_N x[n-N] \\
      &= \sum_{i=0}^{N} b_i\cdot x[n-i],
\end{align}
where N  is the filter order.
So clearly the output at a given index n depends on the input of N preceding input values, so why is the delay N/2 ?


texts: Reference Code for Positive Basis Pursuit Denoising

texts: I am trying to reconstruct a positive sparse signal using compressed sensing (friedlanders code), I cannot find a way to impose the positivity constraint for this implementation. I have seen some papers discussing positive signals case but cannot find any code implementations, can anyone please point out to any relevant code.


texts: Is filtering necessary if I'm not downsampling?

texts:
My data is sampled at $f_s$, and I'm interested in analyzing certain frequencies $0<f_1<\ldots<f_N<\frac{f_s}{4}$. I then take $T$ samples of data, $\{x_1,\ldots\,x_T\}$ where $T\gg \frac{1}{f_s}$, FFT it after padding to the next power of 2 after $T$ and then pick the FFT bins closest to my $f_i$ of interest to proceed with the next step.

My question is: Is it necessary to (or is there any advantage if I) bandpass filter (BPF) my data between $f_1$ and $f_N$? I figured that since there was no downsampling involved, there won't be any aliasing and I needn't BPF it. Besides, a well designed filter should not modify the frequencies of interest, so it makes no difference. Am I missing something or is filtering a necessary step before FFT?

Note: I won't be inverting it back to the time domain. I'm just interested in the specific bins (but several that FFT is much faster than Goertzel).


texts: What is the value of last sample of a discrete sinewave

texts: I have a simple question. If I compute N sample values of a single cycle of a discrete sinewave (whose initial phase is zero radians), will the value of the last sample be equal to zero?


texts: Relationship between Discrete Deconvolution and Toeplitz Matrices

texts:
I have 2 vectors, $a$ & $c$, both of length M. I know they are related by $a*b=c$. My goal is to recover $b$. Obviously $b=$deconv$(c,a)$. I am only interested in the first M elements of the convolution (ie discarding the last M-1 elements). I have two methods of doing this deconvolution in MATLAB and I get different answers. I want to know why:

Method1: using MATLABs default algorithm: b= deconv([c;zeros(M-1,1)],a);

Method2: Using toeplitz matrices:

  A=toeplitz(a,[a(1);zeros(M-1,1)]);
  b=A^-1*c

where A is the toeplitz matrix form of the vector a with 0s on upper triangle.

I believe in theory these methods should give me identical answers, but the answers are somewhat different (but still close). Why is this?

Thanks!


texts: Weighted Nuclear Norm Minimization for Image Denoising

texts:
Recently, I saw new published papers like

Shuhang Gu, Lei Zhang, Wangmeng Zuo, Xiangchu Feng, Weighted Nuclear Norm Minimization with Application to Image Demonising [pdf].

about denoising images using Weighted Nuclear Norm Minimization (WNNM) approach and I am wondering what the physical intuition behind it is.

The main idea is to subdivide the image into patches $Y_j$ then estimate the free-noise patch as the solution of

$$\min\limits_{X_j}{\frac{1}{\sigma_n^2}\|X_j-Y_j\|_F + \sum_i|w_i\sigma_i(X_j)|}$$

where $\sigma_n^2$ is the variance of the noise, $X_j$ is the $j^{th}$ denoised patch to estimate, $\sigma_i(X_j)$ is $i^{th}$ singular value of the matrix $X_j$ and the weights $w_i$'s are non-negative values and chosen in a non-ascending order to satisfy the convexity property.

More specifically, I would like to understand what that means if an image has the singular values of its patches (or regions) constrained to be sparse (according to the expression of the objective function) and I am wondering also if this optimization problem would yield characteristic patterns that are the same in all the images.


texts:
This plot represents the magnitude of the frequency response of certain DFT sub-band filters

I have some difficulties in understanding correctly the DFT. How can i know, only by observing the plot , the number of filters and the lenght of the DFT?

Also several times the DFT was presented to me like a parallel bank of sub-band filters and i cannot understand the full meaning of that phrase.

Thanks by the help.


texts: Multi-input Single-output communication system

texts:
In case of communication in MISO system, if we have a system of 4 x 1,  which means 4 transmitter with 1 receiver. Will the received signal be a vector of dimension 4 x 1 ? Or it will be 1 x 1 since the transmitter are sending to the same receiver?
Thank you


texts: Using a Butterworth high-pass filter together with Fast Fourier transform

texts:
I have a signal and I'm interested in identifying the dominant frequencies greater than 1/3600 Hz. To do this, I use Fast Fourier Transforms and examine the locations of the peaks in the frequency domain, which reveals that the largest peaks are below this frequency. As a noob, it seems like there are two potential options:

Simply ignore the FFT results outside my desired range and focus on my region of interest.
Filter the signal (e.g., with a Butterworth high-pass filter) before I perform the FFT.

What are the pros and cons of these approaches? Is there a third (or fourth, fifth, sixth...) option that is better than both of these methods at achieving my goal?

Edit:


texts:
I want to learn computer vision and so I downloaded image processing slides from my university archive. I'm on histogram equalization. Learning about local histogram equalization points me out to this procedure:

  The procedure is to define a square or rectangular window (m*n, n,m
  odds) and move the center of the window from pixel to pixel. At each
  location, the histogram of the points inside the window is computed
  and a histogram equalization transformation function is obtained. This
  function is finally used to map the intensity level of the pixel
  centered in the window to create a corresponding (processed) pixel in
  the output image. The center of the neighborhood region is then moved
  to an adjacent pixel location and the procedure is repeated.

(It is from a slide of my image processing course at university I don't think I can publish the link because it requires university credential)

I was wondering what kind of practical image this procedure can enhance. I have tried with this example image but it does nothing then increment noise signal (global histogram equalization is much better) and it is super slow (no real-time usage can be even thought).

Can you advice me some test image in which this equalization procedure can be effective? When can I use it for real enhancement? What kind of image? With low contrast and big dark zone? In general, when does a local equalization is better then global equalization? Is it really usefull?

In particular I'm interested in when local histogram equalization increment noise signal or when it doesn't.

And what about this particular procedure? I know that there are more specific tecniques (like Contrast limited adaptive histogram equalization). Is this a good tecnique?


texts: So is there such a thing as a DSP engineer nowadays?

texts:
I just read the article linked to below:

http://www.eetimes.com/document.asp?doc_id=1275520

Now, I'm planning on doing a Masters in Signal Processing. I'd like to know what the career prospects are for someone graduating in this specialization. Note that I live in the high-tech capital of India, so I should be in about the best place in this part of the world for any tech related positions.

I really like the idea of applying mathematics to solve practical problems, so that's why I picked DSP. Am I too late to the party, as this article seems to imply?


texts:
I'm looking for the correct temperature compensation equation to use on our project.
We are measuring the output of a detector who's signal is very sensitive to temperature drift.
Any external Temperature drift is reflected in the output.
A cycle due Day/night variation is typically what we see.
So, we apply a formula to the detector's output to try to compensate for the changes in temperature.
The formula we use is:
RITC = ((RT-AT)*TC)+I
Where:
RITC = temperature corrected output
RT = Reference Temperature
AT = Actual Temperature as Read on Instrument
TC = Temperature Coefficient
I = Input (Actual reading from the detector)
This equation works if the temperature variation is constant say (+/- 5 C) from day to day.
However, if the variation isn't constant and it changes from day to day the equation doesn't work well.
Also if there is sudden changes due to maybe air conditioning or Fans turning On/Off again the equation does not hold up.
So what is the solution?
How can the affects of temperature be removed from the detector signal?
What is the correct method to deal with sudden dynamic changes and also to deal with the slower variations?
I feel a better equation is needed.. just not sure what it is!
Best regards
Conor


texts:
Check the equation 4.8-1 $H(u,v)=1$ if $D(u,v)\le D_0$

my question is the high frequency is at center.

$D(u,v)$ is smaller if it is close to center.

why $H(u,v)=1$ in that case.
Thanks


texts:
So i'm trying to figure how how to do the encoding and decoding of an M-array Differential Phase Shift Keying (DPSK) signal. I understand how to do it for binary DPSK, but on higher ordered signals I'm missing something. Here's how I would do it for binary DPSK (M=2).

The steps should be as follows: get Data sequence -> Differential encoding -> assign phase for Tx -> (on the receiver side) do Differential decoding - assign bits from phase. The following assumes an initial bit of 1, where 1 corresponds to a phase of $\pi$

$\;\;\;\;$Data Sequence $b$ =   | 1 0 1 1 0 0 1 0 1 0

$\;\;\;\;$Diff Encoding $a$ = 1 | 0 0 1 0 0 0 1 1 0 0  -> this opperation should be $a_k = a_{k-1}\oplus b_k$

$\;\;\;\;$Assign phase $\phi$= $\pi$ | 0 0 $\pi$ 0 0 0 $\pi$ $\pi$ 0 0

$\;\;\;\;$Diff Decoding $\rho$= $\ $$\ $$\ $| $\pi$ 0 $\pi$ $\pi$ 0 0 $\pi$ 0 $\pi$ 0 -> where $\rho = \phi_n - \phi_{n-1}$

$\;\;\;\;$Phase to bit = $\;\;\;\;\;\;\;$| 1 0 1 1 0 0 1 0 1 0

So I end up with my original sequence. but if I try to do this with M=4, I don't end up with the same sequence. Lets assume for M = 4 that 00 = 0, 01 = $\frac{\pi}{2}$, 11 = $\pi$ , and 10 = $\frac{3\pi}{2}$, and that we start with initial data 11

$\;\;\;\;$Data Sequence $b$ = $\ $  | 10 11 00 10 10

$\;\;\;\;$Diff Encoding $a$ = 11 | 00 11 11 01 11  -> this opperation should be $a_k = a_{k-1}\oplus b_k$ = ($a_{k-1} + b_k$) mod M

$\;\;\;\;$Assign phase $\phi$= $\ $ $\pi$ | 0 $\pi$ $\pi$ $\frac{\pi}{2}$ $\pi$

$\;\;\;\;$Diff Decoding $\rho$=$\ $$\ $$\ $$\ $$\ $ | $\pi$ $\pi$ 0 $\frac{3\pi}{2}$ $\frac{\pi}{2}$ ->  where $\rho = \phi_n - \phi_{n-1}$

$\;\;\;\;$Phase to bit =$\, $ $\, $$\, $$\, $$\, $$\, $$\, $$\, $$\, $$\, $ | 11 11 00 10 01

So here I don't end up with the same sequence. I'm not quite sure where I'm messing up there. If feel like if I can do this for M=4 I can do this for any size M. Can someone help me see where I'm going wrong? Thanks for your time!


texts: Channel capacity with additive Gaussian noise with changing variance

texts:
As we all know the capacity for a AWGN channel with constant noise variance is just given by $$\frac{1}{2}\log(1+SNR)$$

What if the variance of the noise changes with the type (assuming the variance is known for any time index)? Consider the following discrete channel:
$$
y[n] = x[n] + w[n], \quad n=1,\dots,N
$$
where $w[n]$ is the noise during the $n$-th symbol distributed as $\mathcal{N}(0,\sigma^2_n)$, with known $\{\sigma_n^2\}_{n=1}^N$.

What is the capacity defined in such case?
It should be related to some dynamic rate control, right?
Could anyone give me some reference on related topic?


texts:
I am trying to solve a class exercise in which I am given the following, in Laplace domain:

$$G(s)=\dfrac{e^{-Ts}}{s+3}$$
$$H(s)=\dfrac{1}{s}$$

And I need to calculate $\dfrac{C(z)}{R(z)}$, which is defined as:
$$\dfrac{C(z)}{R(z)}=\dfrac{G(z)}{1+H(z)G(z)}$$

In order to do so, I have to transform $G(s)$ and $H(s)$ into the $Z$ domain and operate to compute $\dfrac{C(z)}{R(z)}$.

I have tried to compute $G(z)$ and $H(z)$, and I think I have failed in calculating $G(z)$, because I am not getting the right result.

I obtained that $H(z)=\dfrac{1}{1-z^{-1}}$ (that I think is correct).

Therefore, my question is how to obtain $G(z)$, I know that $\boxed{e^{sT}=z}$, but I don't know how to relate it with it, because initially I obtained: $G(z)=\dfrac{z^{-1}}{1-e^{-3}z^{-1}}$ but apparently is not correct. What am I doing wrong?

Note: in the statement of the exercise I am told to consider the period of one second (T=1s).

Solution: $$\dfrac{C(z)}{R(z)}=\dfrac{(1-z^{-1})z^{-1}}{1-(1+e^{-3})z^{-1}+(\dfrac{2}{3}e^{-3}+\dfrac{1}{3})z^{-2}}$$


texts: Discrepancy in stability conditions when calculating via RH criterion and Nyquist criteria

texts:
I have the following open loop transfer function for a unity feedback system.

$$G(s)=\frac{K(s+20)^2}{s^3}$$

1.When using RH criterion it can be easily proved that the closed loop transfer function is valid for $K>10$.

2.Trying with Nyquist criteria for stability :
$$|G(jw)_{w=w_{pc}}| \leq 1$$

Here $w_{pc}$ is the phase cross over frequency ($\angle G(jw)_{w=w_{pc}}=-180^\circ$). First solving for $w_pc$, I get the value as $20$ rad/sec and  $|G(jw)_{w=20}|=\frac {K}{10}$ thus, using it with the nyquist criteria gives me $K<10$.

I don't understand why there is a difference. What am I missing?


texts: half-band fixed-point decimate-by-2 fir filter with matlab

texts:
I would like to apply a half-band fixed-point decimate-by-2 symmetrical coefficients fir filter to a stream of 15 bit ADC output with matlab and see its effect done to the data.
I already have coefficients which are 11 tap 18-bit fixed-point. I wonder if the following implementation is correct. I see there is firdecimate seems the best way to do it, but it doesn't take coefficients as inputs and I don't know if it can do fixed point arithmetic. x is the adc output and coeff_fir is the 11-tap coefficients of the filter.
   h=dfilt.dffir(coeff_fir)
   h.Arithmetic = 'fixed';
   h.CoeffWordLength = 18;
   h.InputWordLength = 15;
   h.InputFracLength = 0;
   firrc = dsp.FIRRateConverter('DecimationFactor',2);
   y =filter(x,h);
   y_dec = firrc(y)


texts: Fitting an IIR filter to a complex transfer function

texts: anybody knows of better ways to fit an IIR filter to a complex transfer function than Matlab's invfreqz.m? I'm implementing a little transfer function fitting toolbox for myself. I started with re-implementing the methods used in Matlab's invfreqz.m. Invfreqz.m is using Levy's complex curve fitting algorithm to compute starting coefficients for a iterative Gauss-Newton algorithm. Since Levy's paper is not documenting the algorithm very well and it's quite old, I'm looking for easier implementations and maybe even better algorithms to do the same job. Literature recherche turns out to be a real pain - so any hints from experienced people regarding literature, starting points or examples for implementations would be very appreciated.


texts: Index frequecy offset estimation by Schmidl and Donald C. Cox

texts:
while working OFDM scheme I am unable to understand the purpose of differentially-modulated
PN sequence on the even frequencies of the second training
symbol vk. I will be thankful if someone can guide me.
Robust Frequency and Timing
Synchronization for OFDM by Index frequency offset estimation by Schmidl and Donald C. Cox


texts:
I was learning on power of signal and i went through different formula in internet .

I get different results when i go through internet .

But in other site average power is  written as

I dont know if both are different formula for different condition .

Thanks in advance


texts: As you know, a nonlinear phase filter (in passband), distorts the frequency contents of passband region of signal. In general, Why do we use such filters in the case they cause distortion in the frequency contents of signals?


texts:
I'm trying to design a sample signal that has two "components". I want the signal to look like the upper left figure, with the two components shown on the right. The time frequency spectrum is shown in the bottom left.

I'm using MATLAB to generate this signal, as I am running MATLAB code that uses these signals. I have been trying my heart out with a combination of chirps, sincs and cos functions, but I just can't for the life of me reproduce this sort of a spectrogram. What I have produced looks like this:

It's quite close I feel, but there is something missing. Can someone point me to a way to approach this?

EDIT:

This is the code I use:

fs = 5000;
x0 = 1;
t = -x0:1/fs:x0;
yi = cos(t).*sinc(t).*chirp(t,150,0.2,250,'quadratic');
yj = cos(t).*sinc(t).*chirp(t,50,0.4,150,'quadratic');
subplot(2,2,1)
plot(t,yi+yj)
subplot(2,2,2)
plot(t,yj)
subplot(2,2,3)
spectrogram(yi+yj,512,511,256,fs,'yaxis')
subplot(2,2,4)
plot(t,yi)


texts: Unable to understand the derivation of the update equation for LMS

texts:
I am trying to follow the derivation of the Least Mean Square https://en.wikipedia.org/wiki/Least_mean_squares_filter#Proof
 but I cannot get the update rule. I am stuck in the following steps and shall appreciate help where I am going wrong.
The transmitter generates a sequence of random input data $\{s_n\}$, each element of which belongs to an alphabet $\mathcal{A}$. The data sequence is sent through the channel whose output $y_n$ is observed by the receiver. The input/ output relationship of the channel can be written as:
\begin{align}
y_n &= \sum_{k=1}^L h_k s_{n-k} + v_n,\nonumber\\
&= \mathbf{h}^H \mathbf{s}_n + v_n. \tag{1}
\end{align}
where the additive noise $v_n$ is assumed to be stationary, Gaussian, and independent of the
channel input $s_n$. We also assume that the channel is stationary, moving-average and has finite length. The output of the equalizer is:
\begin{align}
z_n &= \sum_{k=1}^L {w}_k y_{n-k},\nonumber\\
&=\mathbf{{w}}^H \mathbf{y}_n = \hat{s}_n \tag{2}
\end{align}
where the superscript $H$ denotes conjugate transpose, $\mathbf{y}_n =[y_n,y_{n-1},\ldots,y_{n-L+1}]^T$ is the signal to be equalized, $z_n$ is the output of the equalizer and $\mathbf{{w}} = [{w}_1,{w}_2,\ldots,{w}_L]^T$ is the vector of equalizer coefficients.

The cost function for LMS is $J = E[|e_n|^2]$ which is minimized.
\begin{align}
e_n &= s_n - \hat{s}_n,\\
&=s_n - \mathbf{{w}}^H \mathbf{y}_n \tag{3}
\end{align}
We need to take the gradient of the cost function and then equate it to zero to yield the equation for the equalizer coefficients. The gradient is
\begin{align}
\nabla J(\mathbf{w}) &= \nabla E[e_ne^*_n],\\
&=2E[\nabla(e_n)e^*_n]
\tag{4}
\end{align}
Now, $\nabla(e_n) = \nabla(s_n - \mathbf{{w}}^H \mathbf{y}_n) = -\mathbf{y}_n$. Substituting this into Eq(5) and equating to zero we get,
\begin{align}
\nabla J(\mathbf{w}) &= \nabla E[e_ne^*_n],\\
&=2E[-\mathbf{y}_ne^*_n]
\tag{5}
\end{align}
Using Eq(3),
\begin{align}
\nabla J(\mathbf{w}) =0,\\
2E[-\mathbf{y}_ne^*_n] =0,\\
\mathbf{y}_ne^*_n = 0,\\
\mathbf{y}_n(s_n^* - \mathbf{{w}} \mathbf{y}_n^*) =0,\\
\mathbf{{w}} = {(\mathbf{y}_n \mathbf{y}_n^*)}^{-1}(\mathbf{y}_n s_n^*)
\tag{6}
\end{align}

I cannot understand how to plug in the $\mu$, the step size. This Eq(5) is completely different from the update equation :$\mathbf{{w}}_{n+1}=\mathbf{{w}}_n + \mu e_ns_{n}^*$


texts: Strange noises when filtering audio signal

texts:
I am using Naudio open source library and I am trying to do some simple filtering. The problem is that I hear some "clicks", not too loud. The library offers me the possibility to use at least two buffers, so the computing time doesn't introduce a delay between them.  Because in the most of the time I am dealing with a stereo signal, I have split it in two arrays and I compute each other independently. I would like to know if is there something special that I have to do with a filter when I used it on a buffer. I have first used a low pass biquad filter like the one below:

       //generate coeff
       //sincerely, I don't know what's up with q
       //I have taken into consideration some values
       //to see if the noise disappears
       double w0 = 2 * Math.PI * cutoffFrequency / _sampleRate;
       double cosw0 = Math.Cos(w0);
       double alpha = Math.Sin(w0) / (2 * q);
       _b0 = (1 - cosw0) / 2;
       _b1 = 1 - cosw0;
       _b2 = (1 - cosw0) / 2;
       _a0 = 1 + alpha;
       _a1 = -2 * cosw0;
       _a2 = 1 - alpha;
       for (int i = 2; i < length; i++)
       {
            output[i] = (float)((_b0 / _a0) * input[i] + (_b1 / _a0) * input[i - 1] + (_b2 / _a0) * input[i - 2]- (_a1 / _a0) * output[i - 1] - (_a2 / _a0) * output[i - 2]);
       }
       output[1] = (float)(
                (_b0 / _a0) * input[1] + (_b1 / _a0) * input[0] + (_b2 / _a0) * input[0]
                - (_a1 / _a0) * output[0] - (_a2 / _a0) * output[0]);
        output[0] = (float)(
                (_b0 / _a0) * input[0] + (_b1 / _a0) * 0 + (_b2 / _a0) * 0
                - (_a1 / _a0) * 0 - (_a2 / _a0) * 0);

I thought that  all my problems came from the first two samples (output 0:1), I've tried all combinations: output[-1]=0,output[-1]=output[0], but nothing worked. What values output[i-1], output[i-2] should have when "i" is 0 or 1?

I have encountered the same noise (clicks) when I used a LowPass Windowed-Sinc Filter, just like this:

//calculate coeff

        int i;

        int m = length;
        double PI = Math.PI;
        length=101;
        for (i = 0; i < length; i++)
        {
            if (i - m / 2 == 0)
            {
                _h[i] = 2 * PI * _cutOffFrecv;
            }
            else
            {
                //!=0
                _h[i] = Math.Sin(2 * PI * _cutOffFrecv * (i - m / 2)) / (i - m / 2);
            }
            _h[i] = _h[i] * (0.54 - 0.46 * Math.Cos(2 * PI * i / m));
        }
        //normalize the low-pass filter kernel for unity gain at DC
        double s = 0;
        for (i = 0; i < m; i++)
        {
            s = s + _h[i];
        }
        for (i = 0; i < m; i++)
        {
            _h[i] = _h[i] / s;
        }
        //convolve the input & kernel
        //_kernelSize=101
        //most often length is 6615 or 6614 for each channel
        //in these examples I compute only one channel
        for (j = 0; j < length; j++)
        {
            output[j]=0;
            for (i = 0; i < _kernelSize; i++)
            {
                if (j >= i)
                {
                    output[j] =(float)(output[j]+ _h[i] * input[j - i]);
                }
            }
        }

The problem surely is not from splitting the signal, or from combining channels, because I have tested this without any filter and everything is ok. I have also tried to simulate some delays created by a processing algorithm (but without changing the signal) and nothing went wrong. I am very sure that the problem comes from filtering.
Everything  I wrote is used on a buffer.


texts:
I'm reading a book about dsp and doing some exercises.
Here is question that confused me:

A peak appears at index number 19  when a 256 point DFT is taken of a signal

1) What is the frequency of the peak expressed as a fraction of the sampling rate? Do we need to know the actual sampling rate to answer this question?

2) What is the sampling rate if the peak corresponds to 21.5 kHz in analog signal?

My answers:

1) 19/256; no we don't need to know actual sampling rate

2) I think that we can't answer this question without additional info. Or maybe it is  ((21.5/19)*256)*2 kHz?

Thanks in advance


texts: Why is mutual information symmetric but conditional entropy isn't?

texts:
Conditional entropy $H(X|Y)$ tells us how much the average uncertainty about a channel input $X$ is after observing channel output $Y$, and mutual information $I(X,Y)$ measures how much information about channel input $X$ can be obtained observing channel output $Y$.

Doesn't this mean that $H(X|Y)$ and $I(X,Y)$ complement each other or tell us the same thing? If so, then since mutual information is symmetric $I(X,Y)=I(Y,X)$, shouldn't conditional entropy be symmetric as well?


texts: I am having trouble in understanding the concept of image-priors. What is it exactly? What is the advantage of using them? Where are they used?


texts: Simulating Rayleigh channel - Problem with adding channel coefficents

texts:
I am currently trying to simulate a Rayleigh channel using python (numpy).
Full Jupyter Notebook on GitHub: Jupyter Notebook
I assume that the channel changes with each new symbol. So I create myself as many Rayleigh distributed channel components as I transfer symbols. Finally, the channel components are normalized to avoid amplification.
def radio_fading_channel(n_samples: np.ndarray) -> np.ndarray:
    """
    Genergate n_samples of gaussian distributetd channel koefficents.
    Kanalkoeffizient je symbol, da sich der Kanal pro Symbol ändert.

    n_samples:
    :return:
    """
    mean_noise: float = 0.0
    std_dev: float = 1.0
    samples = np.random.normal(mean_noise, std_dev, size=(n_samples, 2))
    samples = np.squeeze(samples.view(np.complex), axis=1)
    # RMS
    samples_rms = np.sqrt(np.mean(np.square(np.abs(samples))))
    samples /= samples_rms  # Normierung, da der Kanal weder versärkt noch schwächt
    return samples

When I plot the distribution it looks legitimate:

constellation = CONSTELLATION["qpsk"]
bit_errors, ber = simulation_rayleigh(
    n_bits=1000000, constellation=constellation, snr_b=20
)
print(f"Errors: {bit_errors}")
print(f"BER:    {ber}")

But in a simulation, BER always seems to end up at the worst case: 0.5
I suspect that I did something wrong when multiplying the channel components.
Thanks in advance.


texts: How to Improve Signal Processing Skills?

texts:
I've heard that signal processing is fundamental field that can be applied to many other fields (MRI, EEG, audio, speech recognition, communication even to economics)

So, I want to contribute myself to studying this field deeply.

I already took Signals and systems and DSP, and also in this semester, I'm taking Statistical Signal Processing.

This may be stupid question
But, I cannot form any idea of how I can improve and study signal processing.
Taking a theoretical theory is not enough to get the concept.
And even if I learned some basics, I still don't know what signal processing is in general.
Constructing a filter or classifier is main goal of signal processing?

Could you share the general insight and recommend the method I can follow?


texts: Creating a convolution kernel from filter description

texts:
I am not quite sure whether the question I am stating is right, or if I am trying to combine two not related topics but here it comes..

I am trying implement and apply a contra harmonic mean filter, but do not know how the kernel should look like, and why it should like that, or even if should do it with a convolutional kernel....

The contra harmonic mean filter is described here.

http://www.blackice.com/Help/Tools/Document%20Imaging%20SDK%20webhelp/WebHelp/Contra-Harmonic_Mean_Filter.htm

Sorry for being a noob within this area, but seems like this information isn't stated anywhere, and I kinda get the feeling that it is some form of knowledge everybody should have, but not me...

I am using filter2D to create my filter..


texts: Let $$\phi(t) = A\cos(\omega_c t + km(t)) \tag{1}$$ be an angle-modulated wave(FM or PM). What's the power of $\phi(t)$? Intuitively, it seems that the answer is $$P = \frac{A^2}{2} \tag{2}$$ since the amplitude $A$ remains constant but I couldn't prove that using the definition which gives $$\lim_{T \to +\infty} \frac{1}{T}\int_{-\frac{T}2}^{\frac{T}2} A^2\cos^2(\omega_ct + km(t))dt \tag{3}$$ It seems we can't evaluate $(3)$ in the general case $m(t)$.


texts: Bin sizes for non-uniform discrete Fourier transforms

texts:
For a non-uniform discrete Fourier transforms, do the specified frequencies – i.e., $f_k$ in

– refer to the midpoint of the bin or the lower bound? I read the answer here, but that stated that the frequency bins for NUFFT are always evenly spaced which is not always the case for NUDFT (e.g., NUDFT-I and NUDFT-III – see here).

If they are the lower bound, does that mean $f_k$ includes frequencies $[f_k, f_{k+1})$?


texts:
Assume the following operation on input $x$ with filter $w$ of size $2L+1$:

$y[i] = \frac{\sum_{k=-L}^{L} x[i+k] w[k]}{\sum_{k=-L}^{L} x[i+k]}$

In other words, my desired filter does a convolution and divides by the sum.
Does this operation has a name (or implemented in conventional software such as MATLAB or python's Scipy)?

In case you are wondering why I need that, this is my problem: I'm having a 1-D temporal signal in which some textures (say edges) are to be discovered. The noise has attenuated locally (in time) some of the textures by some scaling factor which is unknown to me. Now I want to discover the potential time locations where a certain texture happens by normalizing the output of usual filter to the sum of absolute values of my signal (I've dropped the abs() since my signal is positive always).


texts: Comparing two audio files of the same sentence and determining if the speaker is the same person

texts:
I have a library of audio files where different speakers say the exact same sentence multiple times and I am trying to compare the audio files with each other and determine if the speaker is the same person.
After researching and reading many of the questions here it seems MFCCs are one of the better ways to go about this. My current approach has been to use windows of 25ms length that are moved in steps of 10ms then find the MFCCs for each window. Then I only keep the MFCCs for voiced sections. Since even for the same speaker the length of the audio file changes I have come to conclusion I need to use DTW to compare the MFCCs of two audio files.
As an example audio file "A" resulted in a 12 by 50 MFCC matrix  and file "B" resulted in a 12 by 65 matrix. I made these into vectors of lengths (12x50) and (12x65) and then did a DTW on them in MATLAB. It seems something in my approach is wrong since even for the same speaker I am getting a Euclidean distance of over 3000.
Is there something in my approach that is incorrect? I would think if I compare two sentences from the same speaker that the resulting DTW distance would be small even if they say the words slightly differently.


texts: What is the relation between kernel functions, kernels used in convolution and null spaces of a matrix?

texts:
I have recently started learning about machine learning and have come across kernels and null spaces. I understand that null space is the set of all vectors that satisfy the equation A.v = 0 (Where A is a matrix). I have been taught that null space is a set of vectors that are squished to 0 when transformation matrix A is applied. Then I came across SVM where kernel functions are used. I read that null spaces are also called kernels of a matrix. My questions are as follows.

Are both kernel functions and null spaces same? If they are related, how are they related?
What is the relation between kernel functions used in SVM and null
    space of matrix? If yes, how? Is this derived from the null space of
    transformations used in SVM?
What is the reasoning behind kernels used in kernel convolution? For
        example: Is the Gaussian kernel used a representation of the
        transformation? How are they related to null spaces? If they are related, how are they related?

Could you please answer these questions? I am very confused. Thank you in advance.


texts: How to find orthonormal basis function in the following digital communication problem?

texts: I'm trying to express the following set of signals on orthonormal basis functions. These signals are to be transmitted using a 4-ary modulation scheme.How do i write ψ1(t)and ψ2(t) for the same. Also how to find orthonormal function set for given set of signals.


texts: How to quantize filter coefficients to 10 bits

texts:
I am trying to learn digital filter design. One of the concept is quantization of filter coefficients. I used Designfilt to design an lowpass IIR filter and obtained coefficients. Now I want to quantise the filter coefficients to 10 bits. How can I do that.
filterObj = designfilt('lowpassiir', 'PassbandFrequency', .45, 'StopbandFrequency', .55, ...
'PassbandRipple', 1, 'StopbandAttenuation', 60);
fvtool(filterObj);

[b,a] = sos2tf(filterObj.Coefficients);;

This is the code that I used to get lowpass filter.
Here b, a are numerator and denominator coefficients.


texts:
I  am now studying image processing in my spare time. My understanding of convolution is about 'response to a specific filter':

When we have a raw image, or raw signal; and a filter, aka kernel; we apply a 'moving dot product' between the image and the filter.

The filter/kernel represents our domain-knowledge about the raw signal, which is usually some kind of features or patterns. For image processing, such features are often edge, corner, SIFT, etc.

When we apply the "moving dot product", we practically divide the image into "patches" and ask each patch of the image: "Do you look like the feature I am looking for?", high response value means "yes, I am the feature (edge) you are looking for"; while low response value means "no, I am not"

My first question is : is my understanding correct?

My second question is: If my understanding is correct, then we should be able to design much more fancy kernels which represents some very specific features: such as eye (dark in the middle, surrounded by white areas), or nose (triangular shape). But I haven't found a lot of literatures in the area of defining your own kernel.

Can anyone provide any insight here?

Thanks!


texts: Bandpass butterworth filter frequencies in scipy

texts:
I'm designing a bandpass filter in scipy following the cookbook. However, if I decrecrease the filtering frequencies too much I end up with garbage at high order filters. What am I doing wrong?

from scipy.signal import butter, lfilter

def butter_bandpass(lowcut, highcut, fs, order=5):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

if __name__ == "__main__":
    import numpy as np
    import matplotlib.pyplot as plt
    from scipy.signal import freqz
    # Sample rate and desired cutoff frequencies (in Hz).
    fs = 25
    # Plot the frequency response for a few different orders.
    plt.figure(1)
    plt.clf()
    for order in [1, 3, 5, 6, 9]:
        b, a = butter_bandpass(0.5, 4, fs, order=order)
        w, h = freqz(b, a, worN=2000)#np.logspace(-4, 3, 2000))
        plt.semilogx((fs * 0.5 / np.pi) * w, abs(h), label="order = %d" % order)
    plt.xlabel('Frequency (Hz)')
    plt.ylabel('Gain')
    plt.grid(True)
    plt.legend(loc='best')

    plt.figure(2)
    plt.clf()
    for order in [1, 3, 5, 6, 9]:
        b, a = butter_bandpass(0.05, 0.4, fs, order=order)
        w, h = freqz(b, a, worN=2000)#np.logspace(-4, 3, 2000))
        plt.semilogx((fs * 0.5 / np.pi) * w, abs(h), label="order = %d" % order)
    plt.xlabel('Frequency (Hz)')
    plt.ylabel('Gain')
    plt.grid(True)
    plt.legend(loc='best')

    plt.show()


texts: Decimating Non-Uniform large time-series data

texts:
I'm working with accelerometer data that is sampled at a non-uniform rate.  There are major gaps in the data. Below is a scatter plot of the data

I can also give a sense of the frquencies at which the data is sampled.
 Below is a plot of the frequency distribution.

As can be seen, the majority of the data comes in at 128Hz, with some at 100Hz, and then a range of other values.  Below I show a histogram that is created by collecting the time difference between samples.  The x-axis shows the different time steps, and the y-axis shows the incident number.

What I want to do is to decimate this data down to 1Hz.  What is best practice for this?  My understanding is that I would:

1) Interpolate up to say 128Hz first using cubic splines.
2) Apply a Hemming or Butterworth low pass filter.
3) Downsample by keeping every 128th point.

Issues: When I interpolate using cubicsplines, I get enormous values during the stretches in which there is a major gap in the data.  I could potentially mask for these gaps.

I'm working in python and have been looking at the scipy library to handle this.  I know Pandas has .resample().interpolate(), but it seems too memory intensive and slow.  The data takes up about 40gigs of memory.  Any insight or thoughts would be super appreciated.  Thanks friends!!


texts: DFT and FFT application in signal processing

texts: Can anyone give me some hints to solve this problem


texts: Unsure if my unit step function is correct in relation to a diagram

texts:
Here is my function:

$$3(t)(u(t)-1)) + (u(t-1)+3) - (u(t-3)+3) - 2(t)(u(t-3)+3) + u(t-4) -2(t)(u(t-6))$$

Is my function correct? If not, could you please tell me where I am wrong.

Thank you in advance.


texts:
We know that for a signal $x(t)$, it is related to $R_x(\tau)$ as,  $$R_x(\tau) = \int_{-\infty}^{\infty}x(t)x(t-\tau)dt$$.
$\\$We also know that $$R_x(\tau) \rightleftharpoons S_x(f)$$
$\\$How do we mathematically relate $X(f)$ with $S_x(f)$, where $X(f) \leftrightharpoons x(t) $?


texts: How to set a Carrier Wave for DBPSK Modulators in gnuradio?

texts:
for a Project I need to build an Audio Modem in GNU Radio.

I decided, that it would be the best to use DBPSK Modulation, because that is fast and relatively noise resistant.

But as it seems, the DBSK Modulators are just modulating the Signal on the Baseband.

That's not what  I want. Would it be enough, to just multiply the signal with a signal source? And when I do that, do I have to meet any preconditions so that the demodulator doesnt expect a Baseband?

PS: If you have any recommendations what would be a good filter, to get the best out of it, I would like to hear that to.


texts: What is the effective alpha of 2 cascaded EWMA IIR filters?

texts:
Considering simple 1st order exponentially weighed moving average (EWMA) filters of form

$$y[n] = \alpha x[n] + (1-\alpha) y[n-1]$$

what is the effective alpha of 2 cascaded EWMA IIR filters?

Maybe I'm asking the wrong question, but not having a lot of luck Googling for the answer


texts: Rendering a spectrogram of audio data - resulting magnitudes are all too close together

texts:
I'm working on creating an application which will render a spectrogram of the audio in an MP3 file. I'm having some trouble, though - after running the audio samples through my program, the resulting magnitudes are all very close together, and don't seem to be very patterned like one would expect. I'm coloring my spectrogram using a pretty typical black/blue/purple/red/yellow/white gradient. The current result I get is this:

The steps I'm performing to get this are:

Decode the MP3 file using libmad, getting raw signed 16-bit PCM samples back. The samples are stereo, but at this point (for debugging, mostly) I'm just ignoring the right channel. I've verified that this step works by writing the raw samples back out to a file, importing them into Audacity, and then playing the audio - and it sounds correct.
Compute the STFT of these samples (each sample is converted to a complex number of sample + 0i - I realize this isn't the most efficient, but it's very simple and my understanding is that it should produce the same result). I'm not scaling the samples, or converting them from signed to unsigned, or anything else. I'm using a window size of 8192 samples, which is about 185ms of audio data (sampled at 44.1KHz). I'm also applying the Hann function to each of these windows, and overlapping them by about 800 samples. I'm using my own implementation of the FFT, however I've verified it by comparing its outputs to those from Numpy over a very large list of inputs.
Plot the result. Each column in the graph is a DFT from list of STFT results (time), and each row is a particular value in the DFT result (a frequency). I'm only plotting the results in DFT bins [1, N/2 - 1], since I'm using real inputs. I'm computing the magnitude as log10(sqrt(r*r + i*i)).

The color range is from [minimum magnitude, maximum magnitude]. I've tried shrinking the range, thinking that outliers may be screwing it up, but even with a range of [5.6, 5.8] the data is still not a real spectrogram. The magnitudes seem to be more or less randomly distributed in that [5.6, 5.8] range.

What issue might be causing this type of output?

I'd love to post code or go into more detail, but as I'm not sure what area the problem might lie in I'm not sure what to expand upon. For what it's worth (although obviously I don't expect anyone to look at all of my code and fix my bug), this project is on GitHub here.

EDIT: I generated a wave file with a single 1000Hz sine wave as suggested, and for the first time ever my application actually produces some (maybe?) useful output. Here's what I get:

Perhaps this provides some more insight as to what's going wrong?


texts: Time derivative of signal - effect on noise distribution

texts:
I have an angular velocity measurement that has a certain amount of ripple that yields an histogram shaped like a gaussian curve. I quantify that ripple using a standard deviation. I am interested in knowing more about the angle ripple.

What would be the relationship between the two ripples?

My guess would be that the derivative (from angle to angular velocity) push noises at higher frequency and that the gaussian curve will get a little wider (bigger standard deviation). How can I validate that and what mathematics are involved here?


texts: Comparison of size of an entity in different images with different resolutions?

texts: Can we compare the size of two objects appearing in different images with different resolutions?


texts:
I am interested in understanding the proper terminology for the topic of Space Time Adaptive Processing (STAP) that extends beyond the example in all the text books and papers I could find that reference the Uniform Line Array.  In the case of the ULA, the steering vector is easy for me to understand and is

\begin{equation*}
\mathbf{a}(\phi) = A[e^{i \theta_1}, ...,e^{i \theta_n}]^T
\end{equation*}

where $\theta_i$ is the phase response in the direction $\phi$.  The optimal matched filter is thus:

\begin{equation*}
\mathbf{h}(\phi) = \alpha\mathbf{R}_s^{-1} \mathbf{a}(\phi)
\end{equation*}

where $\alpha$ grabs all of the constant terms and lumps them together

However, my expectation for the more generic case is that the array response on all channels is not equal (more like an array manifold) and is thus:

\begin{equation*}
\mathbf{a}^\prime(\phi) = [A_1e^{i \theta_1}, ...,A_ne^{i \theta_n}]^T
\end{equation*}

and now $A_i$ is the amplitude response in the direction $\phi$.

This leads me to my question.  Is $\mathbf{a}^{\prime}(\phi)$ also a steering vector or is this something different (i.e. elements of the steering vector be other than unity)?  And if the steering vector is still $\mathbf{a}(\phi)$, what is the convention for treating the amplitude response of the array.  I am leaning towards the former.


texts: Why is CWT implemented with FFT convolution?

texts:
Instead of padding $x_1[n]$ and $x_2[n]$ then taking
$$
\text{iDFT}(\text{DFT}(x_1[n])\cdot\text{DFT}(x_2[n])), \tag{1}
$$
assuming we know $x_1(t)$ and $x_2(t)$, and their FT's, what if we do
$$
\text{iDFT}(\mathcal{F}(x_1)[n]\cdot\mathcal{F}(x_2)[n])) ,\tag{2}
$$
where $n$ is longer and result is then trimmed?

It's what's used in Synchrosqueezing Wavelet Transform (pg 11-A) to implement CWT, which I'm porting to Python from an open-sourced MATLAB repo.
The clear advantage is, we're directly sampling the continuous, "exact" FT instead of working with DFT's, so we start off a "step closer" to finish in convolution theorem. The problem is, what about aliasing? Zero-padding is there because it's circular convolution. Instead it uses extension padding, then trims whatever it pads post-iDFT.
Comparing it against direct convolution, it seems to fare same, better, or worse in CWT, depending on signal. But I have no idea what it's doing or why it works; what's going on? Is this some alternative convolution theorem?

Update: This seems to be a discretized convolution theorem relying on an analytic wavelet with tight frequency-domain support and entirely zero for half its spectrum. In fact, zero-padding on both sides (not just right) does work. Though I'm still not exactly sure how time-domain aliasing is eliminated or suppressed into negligibility.
Update 2: I have the complete answer, can share upon request.


texts: Matlab: Estimating power spectral density of an experimental data?

texts:
How do I estimate PSD in matlab ? There are lots of methods to estimate, depending on application.

I am using an experimental data to identify faults ( e.g. interturn fault of electric motor), which gives periodic/regular waveforms (pre-fault) but erratically different (or could have some periodicity) waveforms (post-fault).
In this application, my voltage signal, v(t) is sampled and collected using DAQ systems.

Questions:

Can v(t) be considered a wide-sense-stationary random process (WSS-RP) ?

I understand that there are multiple ways to get PSD.
 What is the best suggestion ? Is it ...

By fourier transform the autocorrelation, if only v(t) is WSS-RP. [as described by Wiener-Khintichine Theorem]
By

splitting the signal,v(t) into multiple frames( or segments)
applying window function : multiply each segment by a hamming window (i.e. convolution in freq. domain )
FFT each of the windowed signal
either multiply its conjugate or absolute square, to get the spectral density of the segment
resulting spectra are averaged to get the ultimate averaged spectrum
Just like the explanation here Fig 9.1, Sect.11: Averaging Periodograms, pg14

What is the difference in the mathworks' application note in (www.mathworks.com/help/signal/ref/spectrum.html)

Can someone please guide in the codings ?

Feel grateful in the midst of dsp gurus !
kit


texts: What am I doing wrong?-Bode plots to get transfer function

texts:
I've noticed a couple of similar questions which haven't been answered such as:

https://dsp.stackexchange.com/questions/24381/derivation-of-transfer-function-from-bode-plot

Anyway, I thought I would ask since it hasn't been answered.
So as I understand the s-variable in the s-domain can be thought of as $j\omega $.
I have a Bode plot so I have values of $$H(j\omega)=H(j\omega) \exp[j\arg(H(j\omega))]=\textsf{gain}\cdot\exp(j \cdot\textsf{phase})$$
(The graph I had was not a magnitude in terms of decibel but not gain)
Now I tried to do a regression on it(actually probably technically not a regression from a statisticians' point of view by trying to minimise the least square error of a rational function $$(as^2+bs+c)/(ds^2+es+f)$$ and the values of $H(j\omega)$ that we have from the Bode plot. (Tried higher order rational function as well like of degree 10). And I get absolutely rubbish results for $a$,$b$,$c$,$d$,$e$,$f$ with Bode plots which look nothing alike. What am I doing wrong?


texts: What do I with the sampling period when I inverse $\mathcal Z$-transform?

texts:
Given the input
  $$e(kT_s) = {0.4, 0.8,1.2, - 0.9}, \quad k = 0,1,2,3$$

  and transfer function
  $$T\left(z^{-1}\right)=\frac {z^{-1}-0.8z^{-2}}{1-1.1z^{-1}+0.3}$$
  Find the output $Y(kT_s),\quad k=0,1,2,3$

(I don't know why $0.3$ and $1$ haven't been added).

Starting with the inverse transform I found $$T(k)=\frac{1}{1.3}\left(\frac{1.1}{1.3}\right)^{k-1}u(k-1)-\frac{0.8}{1.3}\left(\frac{1.1}{1.3}\right)^{k-2}u(k-2)$$

I'm not sure if that is correct as I'm not so familiar with $\mathcal Z$-transform. Anyway, I don't have a sampling period in $T(k)$. Do I just put a $T_s$ next to $k$? Do I ignore $T_s$ and do the following?
$$Y(0)=T(0)E(0)$$

$T(0)=0$ so $Y(0)=0$, but why am I given $0.4$ for $E(0)$? This has to be wrong.
$$Y(1)=T(1)E(1)=\frac{1}{1.3}0.8=10.4 $$
etc etc.


texts: Why does alpha of 0.5 in detrended fluctuation analysis indicate randomness?

texts:
I'm trying to get an intuitive understanding of the different coefficients in detrended fluctuation analysis (DFA).
It is used to detect fractal patterns in time series and it yields a coefficient, Alpha, which, as I understand is a Hurst coefficient mapped for different scales — the slope of which is the alpha.

What I don't understand is if alpha shows a correlation between the frequency fluctuation and the scale (i.e. the bigger is the scale, the higher are the frequency fluctuations at that scale) — why is it that a time series is scale-free when alpha is around 1 or random when alpha is around 0.5?
We have a correlation in both cases, so where do these precise values come from? Why 0.5 and not 0.3? Why 1 and not 0.9?
Maybe somebody has an explanation for this as I haven't found anything precise in scientific literature.


texts: How do you find signal similarity when one signal has zero values? Correlation alternative?

texts:
I'm using cross-correlation to look for a Barker code in a BPSK signal.  It occurred to me that if I send out a zero DC valued signal proceeding the barker code, it won't affect the correlation because a zero DC signal has zero correlation with any other signal.

This made me wonder if there's an alternative to cross-correlation which would work properly for a zero valued signal.  As an example, it seems intuitive that a signal such as [0,0,0,0,0] is closer to [.5,.5,.5,.5,.5] than it is to [1,1,1,1,1]

More generally, it seems like correlation is throwing away information that would be useful for doing better matching and I'm wondering how to fix this.


texts: The concept of "increasing roll off rate with increasing filter order" applies only to butter worth or also chebyshev and other filter types?


texts: Impulse Response of a Moving Average System

texts:
According to Discrete Time Signal Processing by Al Oppenheim 3rd Edition,  the impulse response of a moving average filter is as below

My question is that shouldn't  h[n] be having the dirac delta function instead of the unit function u[n] (See Eq 2.9).
This is mentioned in example 2.3 of the same book


texts: why we use time step only in continuous convolution in MATLAB? But not in discrete convolution?

texts:
I am studying convolution from book of alex palamides but i am confused because he uses time step(in this case 0.01) in his code for continuous convolution as shown highlighted  in attached photo but he does not uses step when he perform discrete convolution

Here is his code from book for discrete convolution

% Discrete time convolution

%  x=[1,2,3,4,5],0<=n<=4
%  h=[1,2,1],-1<=n<=1

 n=-1:4;
 x=[0,1,2,3,4,5];
 h=[1,2,1,0,0,0];
 subplot(121);
 stem(n,x);
 axis([-1.1 4.1 -.1 5.1]);
 legend('x[n]')
 subplot(122);
 stem(n,h);
 axis([-1.1 4.1 -.1 5.1]);
 legend('h[n]')

 figure
 y=conv(x,h);
 stem(-2:8,y)
 axis([-2.5 8.5 -.5 16.5]);
 legend('y[n]')


texts: Disjoint ROCs of input and system function

texts:
I am trying to understand how the output behaves when the input and the system function do not have a common region of convergence (ROC) for an LSI system.
Consider an LSI system with $x[n]$, $h[n]$, $y[n]$ as input, impulse response, output signal respectively:
We know that
\begin{gather}
Y(z) = X(z)\cdot H(z)\\[5pt]
\text{with } \ ROC(Y) \supseteq ROC(X) \ \cap \ ROC(H)
\end{gather}
So what if $ROC(X) \ \cap \ ROC(H)=\phi$, what would be the output? Is it even properly defined?
I tried with some examples considering $x[n]$ and $h[n]$ with disjoint ROCs, the output is not defined,
here is one example:
\begin{gather}
x[n] = (1/4)^nu[-n-1] \\[5pt]
h[n] = (1/2)^nu[n]\\[5pt]
ROC(X): |z|<1/4\\[5pt]
ROC(H): |z|>1/2\\[10pt]
y[n] = \sum\limits_{k=-\infty}^{\infty} (1/4)^ku[-k-1](1/2)^{n-k}u[n-k]\\[5pt]
y[n]= (1/2)^n\sum\limits_{k=-\infty}^{-1} (1/2)^ku[n-k]\\[5pt]
y[n] = (1/2)^n\sum\limits_{k=1}^{\infty} 2^ku[n+k]\\[5pt]
\text{Clearly } y[n] \text{ is not defined}
\end{gather}
My question is whether this is true in every case that the output would not be defined or there are some special $x[n]$ and $h[n]$ with disjoint ROCs where $y[n]$ is properly defined.


texts: FSK: non-integer vs integer rmodulation index, peculiar peaks

texts:
I've been experimenting with frequency shift keying (FSK) and found a peculiar pattern I cannot explain.
I noticed that there is a significant change to the shape of the power spectral density of the fsk signals, only depending on their modulation index.

For readability I split the discussion into the two cases integer and non-integer modulation index:

Integer modulation index:

The two characteristical FSK flanks are symmetrical and they  show very strong peaks in their middle. The distance between those two peaks is exactly the shift of the FSK signal.  The image below nicely shows those peaks and the symmetrical FSK flanks in the PSD and STFT of one FSK signal.

Non-integer modulation index:

The two characteristical FSK peaks are not symmetrical, there is considerable skewness to be observed.The peaks found in integer modulation index, are not to be found. The image below shows a similar non-integer modulation index example:

I wonder how that difference in the PSD of the signals comes to pass?


texts:
I have data from accelerometer (time domain) and convert it to fft using Fourier Transform. However, I need to do the curve fit to the plot.
Can somebody share with me the coding.I don't know how to do it.

Thanks a lot.


texts: Is there a simpler way to calculate the amplitude response of the following filter

texts:
I would like to calculate the amplitude response $|H(z)|$, $z=e^{j\omega}$, of the following filter:
$$H(z)=\frac{\frac{b}{2}+z^{-2}}{2+bz^{-2}}$$
and I would like to avoid using Euler's formula and complex numbers cartesian form as much as possible.


texts: Hilbert Transform - C or C++ code implementation

texts:
For a minimum phase system relationship of magnitude response to phase response is:

In the search for C code implementation I have found a ht.c file on www.physionet.org. However, this code specifies time and x as input and then calculates Hilbert transform via convolution. But, the phase response is related to magnitude of frequency response, by definition, so I expected the input to Hilbert transform should be magnitude and frequency.

Is there a C code implementation of Hilbert transform that has for inputs log(|H(jw)|) and hence is function of frequency and not time?


texts: What types of distributions (except the Gaussian) that follow for random jitter in a correlated signal?

texts:
For the simple case, let's consider the correlated signal $s$ with jitter (without noise) as follows:
\begin{align}
s(t, \theta_i) = \cos(2\pi f (t + \epsilon_t) + \phi + \theta_i), ~~ i=0,1, ...
\end{align}
where the parameters $t$ is time, $\epsilon_t$ is a random variable for the random jitter in the signal $s$ with known $f$ and $\theta_i$ are frequency and $i$th-step angle which can be controlled. Need to obtain different models (e.g. histogram, PDF) for $\phi$ by assuming different distributions for the random variable $\epsilon_t$.
It is well-known the random variable follows the Gaussian distribution (with known mean & STD) and I need to know follows:
(1) what are the other distributions we can use for this modelling?
(2) what kind of distributions, we can use when the correlated signal has noise
as follows:
\begin{align}
s(t, \theta_i) = \cos(2\pi f (t + \epsilon_t) + \phi + \theta_i) + \epsilon_n,
\end{align}
where the parameter $\epsilon_n$ is a random variable for the random noise.


texts: Removing Bounded Noise from an Audio Signal

texts:
I'm currently trying to remove some noise from a "contaminated" audio file. From what's given, I know that the noise is isolated to a specific frequency band - that is, from ~1400 Hz - ~1800 Hz.

The most straightforward approach is to obviously implement a stop-band filter - which I've done successfully. However, I wanted to explore alternative options being that a band-pass filter also eliminates the desired signal.

Here's what I've done thus far:

In MATLAB, I explored some aspects of the signal, such as it's power spectrum, autocorrelation, etc:

It's clear that the noise is concentrated in the band I mentioned above, and it appears that the noise is Gaussian.

My initial thought was to apply a spectral subtraction method, such as the Ephraim-Malah Algorithm, but one of the assumptions made by this method is that the underlying noise is Gaussian White Noise. In the file I have, the noise is limited to only a particular band, not the entire signal. My concern is that if I were to apply the algorithm, I would unintentionally introduce minor distortions to potentially good portions of the signal.

At the moment, I'm considering splitting the signal into two portions: use a stop-band filter to extract the unaffected frequencies, and use a band-pass filter to capture the noisy region, apply the algorithm to the latter band, and recombine the signals.

Is this an appropriate approach, or is there a simpler and/or better method that I could use?

NOTE:

Being that I have an idea of what the noise is, I could potentially use a Weiner Filter.


texts:
I haven't recorded a precise impulse response, but I have carefully written the attenuation/boost of a recording chain for every third of octave:

20 Hz,   25 Hz, 32 Hz, 40 Hz, 50 Hz, 64 Hz, 80 Hz, ..., 640 Hz, 806 Hz, 1016 Hz, 1280 Hz, ...
-1 dB, -1.3 dB, -2 dB, ..., +2 dB, +2.5 dB, +1.5 dB, ...

How to inverse this frequency response? I can do it with an equalizer in any audio editor, but how would you do it with code? (e.g. Python)

How to make use of this list [-1, -1.3, -2, ..., 2, 2.5, 1.5, ...] ?


texts: Opencv color segmentation of traffic signs: HSV ranges

texts:
I am working on a project to detect and recognize signs in images from the LISA Traffic Sign Dataset. Since the images are very noisy (in regard to background) I am trying to segment the signs based  on their color using HSV and cv2.inRange().

The problem I am running into is my algorithm is segmenting far too much of the image. For example, when I try to segment the image based on different variations of yellow/orange for a "nice" image I get the following, without any false positives:

However, on images that are at a later point in the day, I receive the following:

I have played with the values for hours now, and cannot seem to find a happy medium that doesn't select both yellow and green in images. I was hoping the community could help provide some insight, since I've been scouring the web looking for examples of what I'm trying to accomplish for several days. I understand there are many examples of this being done in academic and scholarly paper/journals however I have no clue how to convert the complicated formulas they use into code.

Here is the relevant python code:

# the below is pairs of yellow and red respectively
hsv_color_pairs = (
    (np.array([21, 100, 75]), np.array([25, 255, 255])),
    (np.array([1, 75, 75]), np.array([9, 225, 225]))
)
...
# this code is in a for loop and loops over the above HSV color ranges
mask = cv2.inRange(hsv, colors[0], colors[1])
out = cv2.bitwise_and(im, im, mask=mask)
blur = cv2.blur(out, (5, 5), 0)
imgray = cv2.cvtColor(blur, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(imgray, 0, 255, cv2.THRESH_OTSU)

heir, contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

so to sum things up, my question is: what are some tips/tricks I can use to segment the images for the specific colors of the orange/yellow warning signs with regard to shadows/exposure without picking up other colors such as green.

Thanks all!


texts:
I'm currently trying to understand this paper on a Sparse Fourier Transform.

On page four, there is a section on a sub-sampled FFT. The purpose of this section is to show that you can compute a sub-sampled FFT using less computations than the original FFT. So if I have a signal of size N, I could compute a subsampled FFT of size B which would require O(N + B log B) operations.

However, I'm confused as to how you would obtain this subsampled FFT. The idea is that we want the original FFT spectrum to be sampled at B locations. Obviously we could miss coefficients by only sampling the spectrum at B locations, however, it seems like the bigger problem is that subsampling the signal would result in aliasing frequencies.

Essentially I'm not sold on the fact that the described algorithm would result in a sub sampled FFT of the original spectrum. Instead, I think the spectrum could be aliased resulting in incorrect coefficients.


texts:
I want to estimate sampling clock offset. I am currently referring this paper
" CRAMER-RAO BOUNDS FOR DATA-AIDED SAMPLING CLOCK OFFSET AND CHANNEL ESTIMATION ". Is there any other method to estimate? I also referred Lee's method, but it gives symbol timing. Is there a way to estimate sampling clock offset from timing error estimate?


texts: How to apply the window function when finding autocorrelation?

texts:
I want to get frequencies from amplitudes and I'm following Chap 5.1.1 from Speech Signal Processing by Praat

As the in pictures, I will multiply the signal $s(t)$ with the Hanning window $w(t)$, find its normalized autocorrelation $r_a(\tau)$, and divide by $r_w(\tau)$, which is the normalized autocorrelation of $w(t)$. In the end, I will get the corrected autocorrelations $r(\tau)$.
I understand that diving $r_w$ should somehow rescale $r_a$, but the $r_w$ I got takes negative value, and $r$ gets large where $r_w$ is close to zero. How can I get an $r_w$ as in the picture?
Below are my codes to get $r_w$:
def serial_cov(wave:List[int], lag:int)  -> int:
"""
Returns covariance of a signal with a lagged version of itself
"""
global WINDOW_LEN
n=len(wave)
y1=wave[lag:]
y2=wave[0:WINDOW_LEN - lag]
num = float(np.cov(y1,y2,bias=True)[0,1])
return num

hann = np.hanning(WINDOW_LEN)
plt.plot(hann)
plt.title("Hann window amplitude")
plt.show()
r0_hann = float(np.cov(hann, hann, bias = True)[0,0])
hann_autocorr = []
for i in range(MAX_LAG+1):
    ri_hann = serial_cov(hann,i)
    hann_autocorr.append(ri_hann/r0_hann)


texts:
Doppler frequency is calculated by the formula $f_{d} = 2*v_{r}/\lambda$, where $v_{r}$ is the radial velocity and $\lambda$ is the radar wavelength.

Normally FFT is used to detect the doppler frequency(A bank of FFT filters is used for Doppler frequency estimation).

Assume that sampling frequency is fixed as $4*f_{max}$, where $f_{max}$ is the maximum $f_{d}$ corresponding to the maximum radial velocity.

Now I have to determine the number of FFT points to be employed in the FFT calculation. How can I determine this.

In other words, which target parameter determines the Doppler frequency resolution.


texts: How to decide what platform is best to implement real-time audio processing on?

texts:
When developing products I do all of my algorithm design in Matlab. They are usually pretty basic, an IIR or FIR filter or two, a couple FFTs, etc. When it comes time to move it to an embedded environment I always have a hard time deciding what platform to run it on. I usually think of these (broad) platforms:

DSP core
FPGA
Microcontroller
ARM

What factors should I consider when trying to make this decision?


texts: Modeling multipath distortion and shifting by fractions of a sample

texts:
I am working on modelling some FM transmitted signals, and I'm trying to figure out how to model the effects of multipath channels.  The most obvious method is to delay the signal by some integral number of samples and then add it to itself (with some attenuation factor).  But, this is obviously not very realistic, since 1 sample's worth of time is a long time for a radio wave (at least at a reasonable sample rate).  It would be nice to be able to delay the signal by a fraction of a sample.  However, I don't know how to do this...  Can anyone enlighten me?  I am fairly new to the DSP field, I'm sure this isn't a particularly challenging task.

Also, is this actually a good method for modelling multipath effects?


texts: Doppler Shift and Wireless Access Points

texts:
I am trying to design and implement a system that would calculate the velocity of a hand motion in smartwatch.

The general idea is to calculate the Doppler Shift of each access point and find velocity. I have 4 wireless access points I can use. Please also assume I have a 5 seconds long downsampled and downconverted baseband signals received on smart watch from each of the 4 access points. My question is how can I calculate the doppler shift from the sampled signals and how can I then find the velocity of hand motion? I also know 3D coordinates of each access point and coordinates of my hand. Do I take the FFT of the sample and then analyze it in the frequency domain for an offset? If so, can anyone provide some more detail?


texts:
The frequency resolution of DFT is

$\Delta f = \frac{1}{T_{0}} = \frac{1}{NT} = \frac{f_{s}}{N}$

where $f_{s}$ is sampling frequency, $T_{0}$ is sampling time, $N$ is number samples, and $T$ is the sampling interval.

Where does this definition come from? Espescially the $1/T_{0}$, why this equality?


texts: How to keep phase response of IIR filter?

texts:
We know that IIR digital filter has nonlinear phase response in general.

How can I linearize the phase response of IIR filter without altering its magnitude response?


texts: How to make 2 finger rake receiver to counter intersymbol inferference?

texts:
I have to transmit Walsh sequence (spreading codes) modulated with 8 psk with a channel impaired by intersymbol interferences, fast fading .
Suppose i have a stream of data for instance 1 0 1 1, 0 0 0 1
With the 16 walsh spreading,
I get 1 0 1 1 ==> -1 1 -1 1 1 1 1 -1 -1 -1 1 1 1 1 1,
And
0 0 0 0 1  ==> -1 -1 -1 -1 1 1 1 1 -1-11 1 1 1 11 (just to illustrate).
The 32 symboles are then scrambled with 8 psk symbols and then sent to channel with ies ( mainly two taps, with a known delay).
To demodulate,

first I made synchronisation with known symbols(pilots),
I descramble to obtain symbols in {-1,1}
I use correlation for all the possible walsh codes, and I choose the maximum to determine the four bits.
I use correlation on a offset version of the walsh code for the second finger of the rake receiver.
I use Maximal Ratio Combiner to combine the results

What is wrong in my algorithm since i am not getting the good ber ?
Thanks experts


texts:
I'm trying to figure out how to use DSP techniques in order to both add artificial echoes to a sound file, but more importantly to be able to detect these echoes. I've been reading about it here:
http://www.snotmonkey.com/work/school/405/methods.html#echo

Can someone point me to possibly some example code using Apple's Accelerate framework for being able to detect hidden echoes in sound coming from the microphone?  Also, for detecting the echoes, it is important that the application doesn't need to have knowledge of the original sound, meaning it should be detectable in any sound that's being played that has these echoes.

Thank you for any information.


texts: Recommendation for good ressources on digital processing and D-QPSK

texts:
I've been a C++ developer for 10 years. Quite high level. And I am completely new to Digital Signal Processing.

I am trying to implement a Software Defined Radio. Specifically I am trying to receive FM broadcasts, and more importantly DAB+.

I'm on my way to buy a SDR dongle: Basically a box which links an antenna to a tuner and a ADC. The data is then transferred to the computer through a USB cable. Then it can be delivered to my program thank to a library provided by the SDR dongle vendor.

From there my program will need to demodulate the signal. Well I know from Wikipedia that FM encodes the signal using Frequency modulation. And DAB+ is actually using D-QPSK modulation.

I really don't know how can my program process those modulation in order to get the underlying data.

Do you know any good resources over the internet which could help me?

Any good books for newbies?

If those books contains example code, then that'd be a bonus point. But if the book you want to advise are quite "theoretical", then it's quite fine to list them: the goal of all these is for me to understand the whole machinery of Digital Signal Processing, and I do not want to sacrifice theory for practice.


texts: What are poles and zeroes (with respect to the inputs and outputs of a system)?

texts:
I get it, about poles and zeroes, when we talk in terms of the transfer function.

But, if the transfer function is the ratio of the output to the input, then if the input signal is zero, then the gain should go to infinity, right?

Am I missing something?


texts:
I know about Harris corner detector, and I understand the basic idea of its second moment matrix,
$$M = \left[ \begin{array}{cc}
I_x^2 & I_xI_y \\
I_xI_y & I_y^2
\end{array} \right]$$,
 edges and other unstable points can be removed via $M$.

But about Hessian detector, it uses Hessian matrix to detect key points and remove edges,
$$\mathcal{H} = \left[ \begin{array}{cc}
I_{xx} & I_{xy} \\
I_{xy} & I_{yy}
\end{array} \right]$$,
and I don't understand how could $\mathcal{H}$ remove edge and detect stable points? What's the intuitive basic idea behind it?


texts:
So, I've been dealing with a series of pressure decay curves from a pressure transducer. Each one has a waterhammer effect as a consequence of shutting down pumps. Here are examples of 3 curves:

I'm using the scipy's signal.irr to obtain the coefficients and signal.filtfilt for filtering. Here are my parameters:

#filter parameters
order = 1 (varied between 1 and 2)
wn_log_log = 0.045 (This value has been adjusted to fit most of the curves, mostly arbitrary)
rs = 0.05
rp=0.5
type = 'bessel' (between bessel and butterworth)

data points were sampled at 1 second.

I've had mixed results so far (in terms of the next calculation step).

Order 2 bessel wn= 0.065

Order 1 bessel wn= 0.045

Since I'm kind of unexperienced on signal processing I think my question will be how be able to intelligently choose a cut off frequency or adjust the filter parameters based on the nature of the signal which I assume is kind of similar.

But just a first pointer on an intelligent way of at least analyze this signal and have a better understanding of it (fourier analaysis, time domain-frequency domain methods, etc..) that would give me an idea of what would be a good cut-off frequency would be great.

Thanks

Update:

So my goal is to be able to calculate the pressure difference from the filtered pressure and the I'll calculate the first and second derivative. My goal is to get three zones using the second derivative change of sign. The filter will need to be able to get a filtered pressure signal to identify these three zones. Some "wigles" will be ok, as long as zone 1 and 2 are clearly defined (sometime using the same filter to different curves doesn't allow me to achieve that)


texts: Why does part of my image turn black when applying functions to a part of an image in Matlab?

texts:
When I select a part of an image and apply a negative function to it, it works 100%:

When trying to apply the same method using another function, the part of image becomes black:

What is the problem and how can I fix it?


texts: Deconvolution of 1D Signals Blurred by a Gaussian Kernel

texts:
I have convolved a random signal with a a Gaussian and added noise (Poisson noise in this case) to generate a noisy signal. Now I would like to deconvolve this noisy signal to extract the original signal using the same Gaussian.

The problem is that I need a code which does the job of deconvolution in 1D. (I have already found some in 2D but my main aim is 1D).

Can you please suggest me some packages or programs that are able to do so? (Preferably in MATLAB)

Thanks in advance for the help.


texts:
I've been learning about blind signal separation.

I have noticed that there are a number of algorithms for performing blind signal separation. (eg: Independent component analysis)

Which begs the question, are there any 'non-blind' signal separation algorithms?

I've been searching for a while and I haven't found anything. Nothing is listed on the wiki page and I've never noticed any in open libraries such as open CV.

I'm not even sure what search terms to look for.


texts: Delays and alignment issues: how to compute the an equalizer delay?

texts:
For example, if an equalizer model experiences a delay due to its processing, the equalizer may misinterpret the boundaries between the equalized symbols it outputs and, therefore, return meaningless results.

How to align the output data by finding the right delay?

Here a example of a simple equalizer implemented in matlab:

clc; clear all; N = 1e3; MQAM = 2;

d = randi([0 1],N,1);
x = qammod(d,MQAM,'gray','InputType','bit');
h = [0.1 0.5, 0.1 0.2];
r = awgn(complex(filter(h, 1, x), zeros(size(x))), 10, 'measured');

eq = comm.DecisionFeedbackEqualizer;
eq.Constellation = qammod(0:1, 2);
eq.StepSize = maxstep(eq,r);
eq.ReferenceTap = 2;

[y,e,w] = eq(r, x);

dec = qamdemod(y,MQAM,'gray','OutputType','bit');

errors = sum( dec~= d)

How to have dec and d align, in order word what is the delay ?


texts:
I am trying to calculate the poles of an analog Gaussian filter. Its characteristic function, $e^{-\log(2)x^2}$, can be expanded into MacLaurin series:

$$2^{-x^2} = e^{-\log(2)x^2} = \lim_{N \to \infty} \sum^N_{k=0}{\frac{(\log(2))^k}{k!}x^{2k}}$$.

This would go to the denominator of the transfer function, so the roots of the sum are the poles of the filter. The more terms, the better the approximation. So far, so good, classic theory.

But if I calculate the poles for, say $N$=13, I get some strange display (blue dots):

Just by looking at the graph, I thought to rotate them 90 degrees and keep only the left side (red points), while comparing them to the Bessel poles of the same order (green points). The circle is for reference, only, while the Bessel poles have been scaled down by $\sqrt{N}$, for comparison. Interesting enough, if I am to calculate the poles for the normalized transfer function (not the squared one), the series terms would have to be divided by an extra $2^k$, and the resulting transfer function would have to be compared with $\sqrt{|H(s)^2|}$, rather than $|H(s)|$.

I am aware that Bessel isn't Gaussian, or vice-versa, but they are two filters who deal with time-domain, rather than frequency, and their responses are quite similar, hence the comparison.

But now I am puzzled: the blue poles are symmetric on the $X$ axis, and if I were to keep the left hand side, I would end up having two extra, purely imaginary poles for odd orders (as is the case here). Rotating them by 90 degrees seems not only to solve this problem, but also to give the correct transfer function magnitude:

The blue trace is with the original poles, left-hand side poles. One note: keeping the extra, purely imaginary poles would result in a resonance peak (not surprisingly), so I removed those and added an extra, single, real pole on $X$ axis, of magnitude $-2|\max\left({s_k}\right)|$, resulting in the current plot. The red trace is with the rotated poles (also left-hand side), while the green one is the Mathematica expression $\sqrt{e^{-\log(2)*x^2}}$ with a 0.1 offset, for better comparison. $N$=13, as above.

All these seem confusing to me: when calculating the poles from the mathematical expression (the series expansion), do we keep them as they are, or do we rotate them 90 degrees (simple multiplication with $j$), and why?


texts:
Suppose I have an LTI system $$H(z)=\frac{z}{(z-2)(z-\frac{1}{2})}$$ and I want to know its response to the step function $u[n]$.

The LTI system $H(z)$ has three possible ROCs: $$|z|<\frac{1}{2}$$ $$\frac{1}{2}<|z|<2$$ $$|z|>2$$

The response to the step function can be expressed as $$S(z)=H(z)U(z)=\frac{z^{2}}{(z-2)(z-\frac{1}{2})(z-1)}$$

with the ROC of $U(z)$ being $$|z|>1$$

Now, my question is: what is the response to the step function in each case (i.e. for every different ROC of $H(z)$)? Is the ROC of $S(z)$ the intersection of the other two? And what happens when the intersection is empty (when the ROC of $H(z)$ is $|z|<\frac{1}{2}$)?

Thank you for your time


texts: Is MATLAB documentation wrong on when to use discrete versus continuous wavelet transform?

texts:
I was reading some of the MATLAB documentation and I get confused when reading the part about When is Continuous Analysis More Appropriate than Discrete Analysis?

My knowledge before reading the documentation:

I always thought that a signal that is non-differentiable everywhere requires an infinite number of terms to represent it.  This is true for the Fourier basis and a wavelet basis.

The documentation:

To answer this, consider the related questions: Do you need to know all values of a continuous decomposition to reconstruct the signal exactly? Can you perform nonredundant analysis? When the energy of the signal is finite, not all values of a decomposition are needed to exactly reconstruct the original signal, provided that you are using a wavelet that satisfies some admissibility condition.

What I find confusing:

The documentation seems to imply that if the “energy of the signal is finite”, then you don’t need all the terms in the basis expansion.  I don’t think this is true, because I can think of signals with finite energy, that are not differentiable everywhere.  And if they aren’t differentiable everywhere, then they will require an infinite number of terms to represent using the Fourier basis or the wavelet basis.     A perfect example of this is the boxcar function.

Is the documentation wrong?


texts: Neural Networks for rotated character (or shape) recognition

texts:
I have built a program that recognizes shapes and characters, using Neural Networks. Now, one of the main requirements of the task is that the program can recognize them regardless of rotation or mirroring. So far it has worked well.
To do this I used Fourier Descriptors as input data to the NN.

I am now implementing a similar program but in a embedded platform with limited resources (memory, speed,etc). I have just started.

I could try and implement the same thing I did (obviously the training part will have to be aided by a PC-I suppose) but thinking about the limited resources and not wanting to do things more complicated than required, (and plus I read a book where they recommend almost none image preprocessing- just input the pixels into the NN) I have the following question(pardon if it is naive or obvious)

If I train a NN with the inputs being a character or shape image pixels, would it be able to recognize later a rotated version of it?

What if I train rotated versions of the characters as well?

Or maybe it is necessary for me to use Fourier descriptors after all? Any recommendation to build a NN that recognize rotated versions of characters or shapes?


texts: How to differentiate a time domain signal in the complex transfer function?

texts:
I have an input-output data set where the input is current and the output velocity. I am interested in the transfer function from current to acceleration though. So suppose:
$H(s) = \frac{I(s)}{V(s)}$
where $V$ is velocity and $I$ is current.
I thought that the solution would be to
$H'(S) = \frac{I(s)}{sV(s)} = \frac{I(s)}{A(s)}$ where A is the laplace transform of acceleration resulting in the transfer function I'm after. Now to MATLAB: I use 'tfestimate' to obtain the first transfer function $Txy$. Now I would suppose that substituting $s$ by $j \omega$ and implementing that to obtain the magnitude as $|\frac{Txy}{j\omega}|$ would yield the correct results. But I only get the correct results by using $|Txy \cdot j\omega|$ and comparing this to the differentiated signal of $v$. What error am I making? Is it actually the complete transfer function I want to multiply with $j\omega$ to achieve the differentiation instead of the denominator? Any help would be much appreciated!


texts: The Difference Between Bilateral Filter and Gaussian Filter

texts:
I would like to know the basic differneces between Gaussian filter and Bilateral filter in digital image processing...
I just know that both are used to smooth out an image but I would really appreciate if somebody let me know what is the purpose and scenario of each of these filters.
Thanking in advance!


texts: Does Scrambling increase speed of signal transmission overall? And is Scrambling a redundant process?

texts:
Title is a badly worded question, on which I do not have enough knowledge on the subject to answer on my own.
Anyone to help out?


texts: Help with audio EQ cookbook BPF filters and Q

texts:
I am fairly new DSP, and am using maths that I have not used in 20-30 years.  I have been working with Cookbook formulae for audio EQ biquad filter coefficients by Robert Bristow-Johnson and am having a few problems.

I am trying to design a biquad band pass filter with a sampling rate of 48000 Hz, a center frequency of 20000 Hz, and a bandwidth of 500Hz.  Q = fc/delta f, so Q should = 20000/500 = 40.  I have run these numbers through a few different tools that use the Robert Bristow-Johnson formulas, and calculated them manually, and get the following coefficients:

a1 = 1.72129273
 a2 = 0.98757764
 b0 = 0.00621118
 b1 = 0.00000000e+0
 b2 = -0.00621118

I have plotted the frequency response with various tools (https://arachnoid.com/BiQuadDesigner/, source from http://www.earlevel.com/main/2016/12/01/evaluating-filter-frequency-response/ and others).  I expected to see a -3db roll off at about 19750Hz/20250Hz, but I see it at about 19950Hz/20050Hz.  Could anyone point out what I am doing wrong.

Thank you


texts:
How does SDR resolution translate to audio resolution when using FM demodulation?

For example: using a 8-bit/2.048 Mhz IQ stream, what is the maximum audio sample rate and bit depth that can be generated from a +/-75kHz mono WFM signal with 20kHz audio?

My understanding is that the SDR bit depth is irrelevant but for link quality purposes. But how does the SDR sample rate translate to sample rate and bit depth of the resulting audio signal?


texts: Autocorrelation function between received and training signal used for channel estimation

texts:
I have read a paper that performs Channel Estimation of Wireless Channel as follows.

A training sequence of length $N$, lets call it $a_N(i)$ for $i\in[0:N-1]$  is repeated twice then sent out over the channel.

Assume the transmit sequence formed of this two sequeses is denoted by $s_{CE}(t)$.

The received signal is given by (assuming channel of length $T_{CH}$) is
$$r_{CE}(t) = \sum_{t'=0}^{T_{CH}-1}h(t')s_{CE}(t-t')+n(t)$$

The authors claim that if one takes the autocorrelation between a sequence $a_N(i)$ and the received signal then we can mathematically write the autorcorrelation as

$$R(t)= \frac{1}{N}\sum_{d=0}^{N-1}r_{CE}(t+d\underbrace{-N+1}_{????}) a_{N}^*(d) $$

My question is why is there a need for the term I have underbrace $-N+1$. I thought that the autocorrelation is in general expressed as

$$R(t)= \frac{1}{N}\sum_{d=0}^{N-1}r_{CE}(t+d) a_{N}^*(d) $$

Thanks looking forward for your view!

Update: The following is the reference

http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4699819&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D4699819

I particular (25) and (26) are my main concerns.


texts: How to account for phase and shift when composing a new signal based upon 2 or more recordings?

texts:
I have 2 signals that were independently recorded, and want to produce a new signal that would represent what would be recorded if both signal sources were emitting at the same time together. Specifically my case is that I have a recording of dolphins, and a recording of beluga whales and although both recordings were produced independently I would like a sound file with both biologics in the signal.
This post on a MATLAB forum link recommends to multiply the time ordered values together $x_1(t) \times x_2(t)$ to produce a new signal as a result of 'mixing'. This blog post link describes the addition of noise as an additive process between the signals. A question on this forum relevant question asks about the composition from multiple signals where the addition is prescribed. But these approaches do not account for phase and I would assume that this would be necessary. It also does not account for the fact that the time of the recording for the onset of each signal greatly affects the alignment of the signals where there is irregular activity. There is quite a large amount of variation in the acoustic activity where the start time changes whether these animal sounds overlap or not.
The approach I currently use, is to take the FFT of each $x_i(t)$ separately and then generate signals using iFFT from each FFT output. This produces separate signals that I then add together their values at every time point.

Is there a better way to do this?

In order to create a more realistic environment would I have to segment the different states of the signals (biologic activity and non-active states) in order to simulate the randomness in their activity. Would that be an approach seen elsewhere? In general a more simulation like approach to account for the stochastic changes in the state of the system where phase then is taken into account?


texts:
I developed some complex chains of filters and crossovers. After that I have created IRs from the entire chains.
Applying these IRs in software works perfectly.
Now I wonder what is the easiest (and reasonably cheap) way of implementing this on a dsp. All the dsp would have to do, is to perform the multiplications and additions resulting from applying the IR to the incoming signal.

Thanks!


texts: How to apply an anti-aliasing filter before downsampling

texts:
I have an eeg signal with two channels (f3m2 and f4m1) which is divided into epochs. I want to augment the data by taking every 5th sample. I can re-use the discarded samples to create 5 versions of the data (take every 5th sample starting at sample 0, then take every 5th sample starting at sample 1, etc.). I have written my own code to downsample the data starting at sample 0, 1 etc. but I know that in order to avoid aliasing I need to first apply a low pass filter.
How do I decide what filter to use (FIR, IRR, etc.)? How do I decide which cutoff frequency to use? How would I implement this?
My code is in python and I have been considering using the scipy.signal library (but am open to any python libraries).


texts: Coherence vs. Magnitude Squared Coherence

texts:
currently I am writing my masther thesis. The theory part is about the turbulent wind field generation, where the coherence (not magnitude squared) is used:

$$\text{coh}(f) = \frac{|P_{xy}|}{\sqrt{P_{xx} P_{yy}}}$$

I am wondering what is the general advantage of using the magnitude squared coherence instead:

$$\text{coh}^2(f) = \frac{|P_{xy}|^2}{P_{xx} P_{yy}}$$

I think this relationship is similar to that of the correlation coefficient $R$ and coefficient of determination $R^2$. I tried to google the difference regarding the coherence, but unfortunately I don't find any (good) explanations.

Hopefully someone can help me. Thanks in advance!

Apollo3zehn


texts: Morphological transformations for images with discrete values

texts:
I have a series of images in which the pixels take integer values corresponding to a classification. I'd like to try some morphological transformations (e.g. erosion, dilation) to remove noise and smooth across pixels that are classified differently than its neighbors.

However the only morphological transformation functions I know in Python operate on continuous values. This is obviously a problem for discrete values.

I'm sure other people have wanted to apply the techniques to images with classification values. Does anyone know of functions that exist for this sort of thing?


texts: Stolt interpolation and ifft in range migration algorithm

texts:
I am using range migration algorithm for focusing stripmap synthetic aperture radar data. I have successfully tested my algorithm using the following steps after range compression (similar to this link)

2D FFT the data,
Multiply data with exp(1i.*Krange*reference range)
Interpolate omega to Krange,
Inverse 2D FFT

However, when applying the above mentioned steps to the real SAR data, the algorithm works only till step 2 but returns totally blurred image with steps 3 and 4 accomplished. I am not sure if the problem is with the interpolator or ifft (as it is being applied on a non-uniform grid). My questions are:

How to choose the right interpolator for complex data? I have tried interpolating real and imaginary parts separately with no success.
Does the ifft2 function in MATLAB operate properly on non-uniform data?

I will really appreciate any relevant answer. Thanks.


texts: How to apply the CA-CFAR methods in practice?

texts: Applying constant false alarm rate is a critical step for estimation of performance of all detectors. Has anybody experience on practical implementation of this estimator for energy detector? Can anybody explain and introduce a code to me?


texts: If the Fourier transform of an aperiodic continuous time signal has signal components between the minimum frequency w1 and the maximum frequency w2, but not all the frequencies between w1 and w2, is the bandwidth said to be w2-w1? Or does it require that there be signal components at every frequency in the bandwidth?


texts: Different state-space representations for Auto-Regression and Kalman filter

texts:
I see that there are different ways to write an AR model into a state-space representation, so that we can apply Kalman filter to estimate the signal. See Example 1, 2 and 3 here.

I wonder what differences are between the different state-space representations on the estimation by Kalman filter?

Thanks!


texts: How to generate a noise like Pioneers white noise?

texts:
I am making a music app and I want to put a noise generator in it. The problem is the usual white, pink noise is just too boring and not useful for the user. Pioneer mixers has an amazing noise generator. Check it here.
I want to generate something like this but obviously I have no idea how could such noise can be generated. I am new to DSP and all I need to know is what could be the magic behind this noise? Is it a High pass filtered white noise with some reverb? I need to get some guesses on the formula for this noise and I will do the research and implement it.


texts: Building periodic sequences from finite-support sequences

texts:
Given a discrete-time finite-support signal x[n]

$$x[n] = \left\{ {\begin{array}{*{20}{l}}
{{{( - 1)}^n}n}&{{\rm{ }}n = 1,2,3}\\
0&{{\rm{otherwise}}}
\end{array}} \right.$$

And consider also its periodic repetition is

$$y[n] = \sum\nolimits_{k =  - \infty }^\infty  {x[n + 7k]} $$

How we can generate the y[n] in Matlab or Python?

Here is piece of code to generate and plot x[n]. But for Y[n] I have no idea!

% finite support signal
n = -5:1:8;
x = zeros(size(n));
x( find(n==1 | n==2 | n==3) ) = [(-1)^1*1 (-1)^2*2 (-1)^3*3];
stem(n, x, 'filled')


texts: Inverse Fourier Transform Dirac impulse with scaled argument

texts:
Currently, I am dealing with the sampling problems and I don't understand how to calculate inverse Fourier transform of a scaling impulse function

$\textrm{IFT}\{\delta(\Omega T)\} = ?$, $T$ is sampling period but we can see it as a constant.

It comes from this equation since I have to find the $y(t)$ of reconstructing signal

$$Y_r(j\Omega) = j\omega_0\pi\delta(\Omega T - \omega_0) - j\omega_0\pi\delta (\Omega T + \omega_0) $$

The solution for $\textrm{IFT}\{\delta(\Omega T)\}$ is $\frac{1}{2\pi T}$, but I don't know how to get them.

I got stuck when trying to expand and calculate it by integral of inverse FT.


texts: What are Local and Global Inpainting Techniques in Image Processing?

texts:
Is Diffusion-based inpaiting Local or Global?
Is Pixel-based inpaiting Local or Global?
Is Patch-based inpaiting Local or Global?
Can Local-diffusion be used inside Patch-based in-painting problems of Image Processing?
Or, three of them can be applied separately to operate on the same type of problem?