texts:
I have multiple experiments and each of them produce several ($k$ for example) binary signals; some artificial example next:

I have a metric to compare experiment results but I need vectors of equal size to do it.

The problem is that signal length can differ from one experiment to another so I need to reduce the signal dimension somehow.

What I tried/ideas:

Calculate area under each signal. Result is vector of dimension $k$. The problem is that this method cannot differentiate signals with the same area.
Split signal on $m$ bins and calculate an area in each bin. Result is a vector of dimension $k \times m$.

Take Fourier series coefficients. Result is vector of dimension $(a+b)\times k$. The problem is that the spectrum is too large and Fourier cannot work nice (am I correct?)
Some wavelet transforms (like Haar for example). But I don't understand how to do it correctly.

I will be grateful for advices or any method that can help me.


texts: Why is the backprojection of the Middlesbury depth map "cone shaped"?

texts:
I wrote some come to backproject depth maps. Testing it with the Middlebury cone set, I get:

First of all it has noise, which I shouldn't get from the ground truth, but more importantly it seems like the points are going further from each other with the depth.

Can anybody explain this phenomenon?

My code:

  float baseline = 0.3;
  float focalLength = 303.0;
  float numerator = baseline * focalLength;

  for (int i=10; i<groundTruthDisparity.rows-10; ++i) {
    for (int j=10; j<groundTruthDisparity.cols-10; ++j) {
      float distance = groundTruthDisparity.at<uchar>(i,j) / 4.0;

      if (distance != 0 && !isnan(distance)) {
        depthMap.at<float>(i,j) = numerator / distance;
      }
    }
  }

  for(int y=1; y<height-1; y++) {
    for(int x=1; x<width-1; x++) {
      float depth = depthMap.at<float>(y,x);

      // backproject to world
      cv::Matx21d homogeneous = cv::normalize((cv::Matx21d(x,y) - principalPoint) * (1.0 / focalDistance));
      cv::Matx31d transformedPoint = cv::Matx21d(homogeneous(0), homogeneous(1), 1) * depth;

      cloudPoints.push_back(transformedPoint);
    }
  }

The depth map looks like this (colored in HSV):


texts: Quantifying goodness of amplitude estimation

texts:
Assume you have a single sinusoid in bandlimited Gaussian noise with unknown amplitude $A$, known frequency $f_0$, and known noise spectral density $S(f)$ in $\frac{\mathrm{units}^2}{\mathrm{Hz}}$:

$$x(t) = A\sin(2\pi f_0t) + n(t)$$

The signal is sampled for a known finite duration $T$ such that the frequency component of the sinusoid alone would have finite magnitude $$\bigg\lvert\mathscr{F}\left\{A\sin(2\pi f_0t)\cdot \mathrm{rect}\left(\frac{t}{T}\right)\right\}(f_0)\bigg\rvert = AT$$.

How would one then quantify the 'goodness' of amplitude estimation $\hat{A} = \frac{|X(f_0)|}{T}$?  I assume the SNR would be a distribution with the following shape?  (Since the signal amplitude would be divided by an integral of zero-mean noise, which is also zero-mean)

Edit: Actually, using the definition of SNR as $\frac{E_s}{\sigma^2}$, SNR is constant since we would know both $E_s (=\frac{A^2T}{2})$ and $\sigma^2 (= S(f) \cdot BW)$.  However, now I'm a bit confused.  This would make it seem that reducing the BW to an infinitesimal amount would make the SNR very high.  On the other hand, I thought the fourier transform was essentially applying a very selective BP filter at each frequency but still results in noise corrupting the frequency magnitude response because there is also a finite amount of energy per bandwidth in the 'smeared' (time-windowed) sinusoid.

Edit2: I believe the main sub-problem is Frequency magnitude distribution of noise


texts: State-Space Representation of Forward and Backward Filters

texts:
In [1], the author shows an efficient way of implementing the forward and backward filter using matrices. One can also implement this using filtfilt command in MATLAB. However, I am interested in implementing this using matrices.

Background

Any digital filter can be represented in its state-space format as follows:
\begin{align}
x(t+1) &= F x(t) + G u(t) \notag \\
y(t) &= H x(t) + D u(t) \notag
\end{align}

This filter can be expressed as
\begin{align}
\mathcal{Y} = \mathcal{H} U + \mathcal{O}x_0
\end{align}
where $\mathcal{Y} = [y_0, y_1,\ldots,y_{N-1}]^T$ is the vector of outputs, $U = [u_0,u_1,\ldots,u_{N-1}]^T$ is the vector of inputs, $x_0$ is the initial state,
\begin{align}
\mathcal{H} = \begin{bmatrix} D  & 0 & \ldots & 0 \\
                              HG & D & 0 & \vdots \\
                              \vdots & & \ddots & \\
                              HF^{N-2}G & \ldots & HG & D
\end{bmatrix},
\end{align}
and
\begin{align}
\mathcal{O} = \begin{bmatrix} H \\ HF \\ \vdots \\ HF^{N-1} \end{bmatrix}.
\end{align}

Problem Statement

In forward-backward filtering proposed in [1], the author mentions that the forward and backward filters are different (generally speaking). However, if we look at the implementation of the forward-backward filter derivation, the same filter is used, i.e., only the time-reversal of the input and outputs are performed but the filter transfer function does not change. What should be an efficient representation of the state-space filter while applying the forward filter and backward filter, i.e., determine $(F_f, G_f, H_f, D_f)$ and $(F_b, G_b, H_b, D_b)$.

Reference

[1] F. Gustafsson, "Determining the initial states in forward-backward filtering," in IEEE Transactions on Signal Processing, vol. 44, no. 4, pp. 988-992, Apr 1996. http://www.diva-portal.org/smash/get/diva2:315708/FULLTEXT02


texts: Efficient computation of inverse FFT of real sequence using half sized FFT or inverse FFT

texts:
The inverse FFT of a folded real sequence yields a real symmetric sequence. Are there any ways to exploit this symmetry to perform a smaller complex FFT or complex inverse FFT?

Background: it's possible to do this for a forward FFT of a real sequence (see: Real valued FFT in Matlab):

x = [1, 2, 3, 4, 5, 6, 7, 8];   % some real-valued signal
n = length(x);                  % must be even!
n2 = n/2;                       % assume n is even
z = x(1:2:n)+j*x(2:2:n);        % complex signal of length n/2
Z = fft(z);
Ze = .5*( Z + conj([Z(1),Z(n2:-1:2)]) );        % even part
Zo = -.5*j*( Z - conj([Z(1),Z(n2:-1:2)]) );     % odd part
X = [Ze,Ze(1)] + exp(-j*2*pi/n*(0:n2)).*[Zo,Zo(1)];  % combine
X2 = fft(x);

Then X and X2 yield the same values. With X we have avoided the calculation of the symmetric values as we can recover those easily.

For the ifft:

x = [1, 2, 3, 4, 3, 2];   % some folded/symmetric real-valued signal (of even length)

ifft(x)

This yields a real symmetric sequence.

Would it be possible to take [1, 2, 3, 4] and pack this into a complex FFT or inverse FFT to yield the same result?


texts: Linkwitz-Riley Crossover Sum as Allpass Filter

texts:
I was curious about crossover filter design, so I did some reading on Linkwitz-Riley filters.  Seems to me that the general idea is that if you add HP and LP filters and they are properly designed, you get an all-pass filter, which made sense on its face.  However, I cannot seem to work this out mathematically.  Using an LR 2, my understanding is that the filter transfer functions are simple biquads with a Q of 0.5.
$H_{LP}\left ( s \right )=\frac{\omega _{0}^{2}}{\omega _{0}^{2} + \frac{\omega _{0}}{Q}s + s^{2}} $
$H_{HP}\left ( s \right )=\frac{s^{2}}{\omega _{0}^{2} + \frac{\omega _{0}}{Q}s + s^{2}} $
And if they're summed you'd get:
$H_{LP+HP}\left ( s \right )=\frac{\omega _{0}^{2}+s^{2}}{\omega _{0}^{2} + \frac{\omega _{0}}{Q}s + s^{2}} $
Which is not an all pass filter unless Q is infinite.  Am I totally missing something here?


texts: How to fit Welch's window segments to a time series of variable length

texts:
I'm trying to write a small Welch's PSD method in R right now, but I've had trouble finding information on how exactly the window segments are fitted to a given time series.

For instance, when the end of the time series does not fall on the end of the last window segment, what are the common ways to deal with this?

I'm assuming the time series is either truncated to perfectly fit the window segments, or zero-padded at the end so another segment can be perfectly fit.  I'm interested in what the standard method is for this.

For example, lets say I have:

A time series of 32 samples
5 window segments, each of 10 samples and 50% overlap

I can either, zero-pad my timeseries until it reaches 35 samples and fit an extra window segment in, or I can truncate my timeseries to 30 samples, which would perfectly fit 5 windows.  Which is the proper course of action here?


texts:
I would like to extract the location of data jump (see figure below), the difficulty is that the data are noisy as you can see. I try with a median filter or a other regularization and it could move the location of my jump.

Perhaps i could compute differences between consecutive data and then extract the most important one. Nonetheless my data could contain two jumps... And for information I m working with Python


texts:
This is probably a bad question but I'll ask anyway because I'm often confused by it. Many textbooks explain how the movement of $z$ around the unit circle can be broken up into a sine wave along the horizontal axis axis and a cosine wave on the vertical axis. Both of these waves are termed sinusoidal.

So, if both of these are termed sinusoidal, then is the movement around the unit circle also termed "sinusoidal" or is it a combination of two sinusoids?


texts: Why do we express complex noise as Gaussian distributed while the channel is Rayleigh distributed?

texts:
I have a confusion regarding the distribution of noise and channel fading. As we know channel fading is usually modeled with Rayleigh fading since it has Gaussian distributed real and imaginary components. On the other hand, we express a complex noise as a Gaussian distributed signal (at least for AWGN channels) while it also has the same real and imaginary components.

Why do we express complex noise as Gaussian distributed while the channel is called Rayleigh distributed? Am I missing something here?

Thank you.


texts: Why correlation property of $\mathcal Z$-transform contains a time reversal operation

texts:
I'm reading through Digital Signal Processing, Proakis and Manolakis, third edition.  I've reached section 3.2: Properties of $\mathcal Z$-transform.

One property is the convolution:

$$x(n) = x_1(n)\star x_2(n) \longleftrightarrow X(z) = X_1(z)X_2(z)$$

Other property is correlation:

$$r_{x_1,\ x_2}(l) = \sum_{n=-\infty}^{\infty}x_1(n)x_2(n-l) \longleftrightarrow R_{x_1,\ x_2}(z)=X_1(z)X_2\left(z^{-1}\right)$$

I'm confused by the time reversal (folding) which appears in the correlation property at $X_2\left(z^{-1}\right)$. I know that the folding step occurs on convolution but not on cross/auto/correlation. Why is this and what am I missing?

To clarify the "time reversal" expression I'm referring to another property of $\mathcal Z$-transform taken from the same source:

If $$x(n) \longleftrightarrow X(z)$$
Then
$$x(-n) \longleftrightarrow X(z^{-1})$$

For the two answers: Matt's one clarifies the matter using a mathematical perspective while Peter's one shows in an intuitive way how the folding occures in polynomial multiplication. So thanks, I wish SE had a way to mark two answers as accepted.


texts:
Using a diffraction grating in front of my smartphone's camera, I can decompose light sources into their spectral components. The problem is that the background is not always dark and there might be interference between the spectral intensity and bright objects in the back ground.

Here is an example of an image taken with a diffraction grating of a fluorescent lamp:

In this case the background is not so bright but you can see that the dark and bright spots on the vacuum cleaner already change how the blue band looks like.
I thought about having a second camera next to the first camera and taking a similar picture without the diffraction grating:

How can I isolate this spectrum that overlaps on my first image and how precise can be this recovery of the original spectral signal? I will be using monochrome cameras.

What I tried until now is to put a black sheet in front of the right half of my lens to block background light landing on the right part of the sensor such that the spectrum can be visualized in a black background environment but I think this limits the flexibility of such method

PS:Here my hand moved in order to remove the taped diffraction grating so the picture was not taken from the same pose but later I thought about having fixed cameras looking at the same direction with a minimal baseline to know their relative pose and easily register both images before proceeding with the spectrum isolation.


texts: Where in the signal chain is Channel Equalization applied?

texts:
I am reading about channel equalization and I am somewhat confused on where in the signal chain channel equalization is normally applied and if it's before or after a correlator detector or matched filter.

My confusion is that if equalization occurs before matched filtering/correlator detection, then a training sequence used to estimate the channel will need to be based upon the output of the ADC, not of the matched filter. So if a pseudo-random sequence is used as a pilot tone it won't consist of symbols but of some other modulation type.

If the equalization is based upon the symbol rate output of the matched filter how are fractional delays handled?


texts: Say I have two zero-mean vectors, with a size of N and the translation between them is k. Say the image signal std is $\sigma_s$ and the noise std is given by $\sigma_n$. What is the variance of the correlation value in case the correlation is estimated by Fourier transform, without zero-padding? Is there a way to find the variance for the Pearson-correlation too?


texts:
I am a beginner in DSP and is familiar with $\sin(\theta)$ declaration (as studied in trigonometry) - where $\theta$ is the angle it makes with X - axis. Please tell me what does $\sin(2\pi f t  + \phi)$ equation means and how $\theta = 2\pi ft + \phi$.

Thanks in advance


texts: how to get segmented OPTIC DISC from retinal image?

texts:
i have been segmented some image of retina. but the result is not good as i hope. for one image i can get good segmentation, like this image

my code is from some reference in internet, in below i will write my code and this code is start when i have got a filtered image (mean filtering) .

prewitthor = [-1 0 1; -1 0 1; -1 0 1];
prewittver = [-1 -1 -1; 0 0 0; 1 1 1];
Ix = imfilter(double(imgMeanfilter),prewitthor,'replicate');
Iy = imfilter(double(imgMeanfilter),prewittver,'replicate');
J = sqrt((Ix.^2)+(Iy.^2));
g = J - min(J(:));
g = g / max(g(:));

th = graythresh(g); %# Otsu's method.
a = imhmax(g,th/2); %# Conservatively remove local maxima.
th = graythresh(a);
b = a > th/4; %# Conservative global threshold.
c = imclose(b,ones(3)); %# Try to close contours.
d = imfill(c,'holes'); %# Not a bad segmentation by itself.
%# Use the rough segmentation to define markers.
%  g2 = imimposemin(g, ~ imdilate( bwperim(a), ones(3) ));
L = watershed(c);
boundaries = L == 0;
redChanel(boundaries) = 255;


texts: Modulation of data bits into complex symbols in MATLAB

texts:
In communication theory, a modulator takes the input sequence and and maps it to some complex numbers. In MATLAB the following commands can do that.

data = randi([0 1],96,1);
hModulator = comm.PSKModulator(16,'BitInput',true);
modData = step(hModulator, data);

My question, is regarding the last step. Why is a step function able to do this mapping. In particular this step function represents the step response.

Thanks for any advice.


texts:
I am looking for a great introduction to FFTs for my job. I studied math, but never heard of FFT until I got this job. There is not a lot of documentation at my place of work and the articles I have found online have been somewhat confusing, even the wikipedia entry.

So I am looking for a recomendation for a higher level introduction to FFT. I would perfer free resorces over paid ones, but I can't be too picky here.

Thanks in advance!


texts:
I was reading about active sonar and couldn't quite understand how the echos are recognized.

My doubt is, when the sound signal is reflected back, it is greatly attenuated and distorted due to many factors.

Do they use MFCC(which I think is only good for audible range) for identifying the echo or are there any other better techniques? I feel that the problem is modeled and the echo data is fit to the model but I am not sure.


texts: Sampling rate conversion for audio using ffmpegwrapper in python

texts: I have many audio files @ 22kHz. I want to convert it to 44.1kHz. Since I have many files to convert, I am looking for an easy solution. I came across ffmpegwrapper for python. I installed the package for python. But I couldnt find out the command to resample. Can anyone please help me ? This is the link for the wrapper. https://pypi.python.org/pypi/ffmpegwrapper


texts: Problems Using FFT to Compute Impedance in a Model Neuron

texts:
I'm a neuroscientist currently investigating the resonance properties of a single neuron model that a colleague and I have constructed. The language we code in is Julia, which I hope is similar enough to Python for most people to understand. I've run in to a very particular problem, so bear with me please.

In order to investigate the resonance properties of the model neuron, I am applying an exponentially swept sinusoid current to it and analyzing its voltage response. In my field, such a current is called a ZAP current, though a more familiar term is probably Chirp signal. Just so there is no confusion, the current is generated from the following function \begin{gather*} ZAP(t) = I_{app}sin(2\pi f(t)t)\\f(t) = (0.001)\frac{f_{min}}{Lt}(e^{Lt}-1)\\ L = \frac{\ln{\frac{f_{max}}{f_{min}}}}{t_{max}} \end{gather*} where $t_{max}$ is the time duration of the simulation, $f_{min}$ and $f_{max}$ are the starting and ending frequencies of the sweep, and $I_{app}$ is the magnitude of the sinusoid. The voltage response of the model neuron to this input looks like this:

Clearly, there is a resonance in the model at whatever the input frequency is at around 50,000 ms. This means there should be a peak in the impedance of the model at this frequency. The impedance is calculated as the ratio of the discrete Fourier transform of the output voltage to the input current $$ Z = \frac{FFT(V(t))}{FFT(ZAP(t))} $$ I then plot the magnitude of the impedance against the natural logarithm of the frequency. I expect to get something like the one on the left, but instead I obtain the one on the right:

As I vary the parameter $E_K$, the resonance frequency changes, and I expect to see this reflected in the impedance-frequency plot, but every one of the impedance-frequency plots looks almost identical to the one shown above despite the voltage responses looking quite different.

I have spent hours going through my code line by line and experimenting with different modifications to figure out where I'm going wrong, but have not been able to produce the desired output. Here is the stripped down code:

## Time Parameters
dt      = 0.01         # ms
tmax    = 100000        # ms
tspan   = convert(Int64,tmax/dt)
t       = linspace(dt,tmax,tspan)

## Simulation and Analysis
# magnitude of sinusoid
Iapp = 1.0
# minimum frequency
f0 = 0.1
# maximum frequency
ff = 15.0
# create an array of the frequency sweep values for plotting
Zfreq = ZAPfreq(f0, ff)
# optimize Fast Fourier Transform for an array of size and type ZAP()
P = plan_fft(ZAP(Iapp, f0, ff))
# calculate FFT for input ZAP()
inFFT = P*ZAP(Iapp, f0, ff)
output    = simulate(ZAP(Iapp, f0, ff))
# calculate the FFT of the membrane voltage response
outFFT = P*output
# calculate the impedance of the cell at each frequency ZAPfreq[i] from Z = V/I
Z = outFFT ./ inFFT
# calculate the magnitude of the complex impedance
MagZ = abs(Z)
# center the DC response (f = 0 at center of frequency axis)
shiftZ = fftshift(MagZ)
# plot the impedance at each frequency
plot(Zfreq, shiftZ, grid = false,
  legend = false,
  linecolor= :black,
  xscale= :ln,
  xlabel = "log(\$f\$)",
  ylabel = "Impedance (Ω)",
  title = "Kispersky-Caplan Impedance Response with \$E_K\$ = $EK",
  top_margin=5*mm,
  bottom_margin=5*mm,
  left_margin=5*mm,
  right_margin=10*mm,)

Here, the $\texttt{simulate()}$ function is the one that actually carries out the simulation of the model. Any help in determining the problem is greatly appreciated.


texts: For many papers which talks about using wavelet transforms for feature detection in image processing, it is stated that it is advantageous for the wavelet to have zero mean? Why is this so? Thanks in advance.


texts: Confusions in windows based design of FIR filters?

texts:
I am reading the proakis book"DSP USING MATLAB 3rd Edition"
In chap 7, article 7.3, i came across example 7.8,where i saw formulas for pass band ripple and stop band attenuation
I have highlighted them in attached snapshot but i couldn't find out how they were calculated
Please also include reference of these formulas of Rp and As, into your answer, as i could not find their reference in book
and also what is "delta_w"?Is it "transition width"?


texts: Given Position Measurements, How to Estimate Velocity and Acceleration


texts: What does the negative sign mean in the image frequency domain?

texts:
When I transform an image from the spatial domain to the frequency domain, some frequencies are negative. What is the meaning of the negative sign?

For example:


texts: AR Modeling: Why residual is white noise?

texts:
I was going through AR modeling.

The AR model of  a covariance stationary process can be expressed as:

$$x[n]=\sum\limits_{i=1}^{p} \alpha_i x[n-i] + \epsilon[n]$$

where $p$ is the model order and $\epsilon[n]$ is the residual

1) Why is it that the residual $\epsilon[n]$ is a white noise? Is it by definition or can it be shown to be a white noise?

2) Where is the assumption on the stationarity of $x[n]$ used? In other words, if $x[n]$ is not stationary, what would have changed?

Thanks,


texts:
I need to save the audio output of a script in Matlab but I don't know how to do it. It is a complex sound, with several pauses of silence with different durations, so I cannot simply use audiowrite (for my understanding, I need one single matrix S to save a file using audiowrite(S,Fs)).
A simple example of how the sound is generated would be the following:

for ii = 1:length(cf) - 1
sound(s(ii,:), sf);           % sound presentation
pause(d + 0.025);             % waiting for sound end + silent period
end

where d is the sound duration and 0.025 is the duration of the silence.
I was thinking in creating a vector describing the silent period (similarly to the matrix s describing the sound), but as it has a different duration with respect to the sound so the number of columns (which represents the number of signal samples) would be different.

Is it possible to record the output? I would like to save exactly what I hear in the speakers after running the script. It is my first time with sounds in Matlab and I did not find anything online. Thank you for your help.


texts: Image enhancement algorithms for adjusting shadow, exposure, contrast etc

texts:
For those who have either used Picasa/Photoshop, they would see different image enhancement options such as:

Change exposure
Change shadow
Change highlights
Change vibrance

I have searched online a lot about algorithms for doing the above operations. I know that these can be achieved from basic operations such by changing /saturation/contrast or adjusting dynamic range of an image. However, if somebody has used these algorithms then it is clear that it is different than just naively changing the basic parameters.

EDIT: I found a submission on MATLAB file exchange which has a nice GUI and implements the imadjust (i.e. adjust the dynamic range of image) command. I think this command is the key to emulate the above listed effects. I am posting some examples:

I am not asking about the auto-color/auto-enhance functions as they may be complex. If someone knows how to implement any of these algorithms, it would be great.

Change exposure:

Change shadow:

Contrast enhancement:


texts: What is the physical significance of statistical quantities like mean, variance, skewness and kurtosis of a digital signal?

texts:
I understood the mathematical meanings of the mean, variance, skewness and kurtosis. But when we calculate these quantities for a signal (say a digital audio signal), what physical meaning do they convey?
I understood mean as the DC component of the signal.
If the mean of the data is made 0, and then if we find the value of variance it is similar to the energy of the signal, the standard deviation is equivalent to the RMS value.
Then what about skewness and kurtosis, what do they physically signify?


texts: How to detect quadrilaterals in a point cloud?

texts: How can I detect a quadrilateral in a point cloud that looks almost like a rectangle? How do I set the criteria (i.e orientation, size etc) to get the shape for example in the image below?


texts: High pass biquad cascade transposed direct form II low frequency accuracy

texts:
I'm quite new to DSP and I'm trying to implement high pass biquad cascade in transposed direct form II. Currently my implementation has very poor accuracy at cutoff frequencies that are less than 5kHz or rather frequencies that are less than 5kHz are still present but diminished in output signal. In the DSP textbook I have in possession I have read that biquads generally can have this kind of problem at lower frequencies but it is not mentioned up to which frequencies this problem can occur.
For the purposes of testing my implementation I'm using white noise generated from Audacity with sample frequency of 44100Hz as input signal and have a reliable application (which I cannot disclose here) from which I generate referent output with the same mentioned input. I know for sure that the referent implementation of high pass filter is also in transposed direct form II.
Output signal of my implementation can be seen below:

and the referent output signal can be seen here:

as you can see the difference is in the lower frequency range.
My question would be what could possibly be wrong in my implementation, are there any common mistakes one could make (that I'm not aware of) when implementing this kind of filter? (as obviously there is solution for this problem based on the referent output) I have also read (online) that this can be due to poles being to close to the unit circle. If so are there any trick one could apply to get as close to the referent output?
I have already implemented low pass biquad cascade in the same transposed direct form II and as opposed to high pass implementation I have not encountered problems of this kind.


texts: How to detect underdamped harmonic signal?

texts:
I would like to ask what could be the easiest way to detect the presence and beginning (no more, no less) of under-damped harmonic signal in a collect of ultrasound data. I have some acquired data which is presented in 2-D image form, where vertical axis are related with time. Under-damped harmonic signal, which I need to detect, looks like here, but of course it is noised.

I would like to detect presence of this kind of signal automatically. Currently I've developed algorithm, which calculates short-time Fourier transform for every vertical line of image, collect values of five the most often frequencies for every short-time window, and chooses the vertical line with the most harmonically nature - with the most repeated frequencies. Unfortunately in this solution every time one of the line is chosen. I can use some kind of threshold for sure, but i don't think so it's good solution. However, it isn't the most important problem - my algorithm calculate which line has under-damped harmonic signal, no where it starts. Second problem is that this solution is too slow for my purpose - 20 times per second.

I have tried to make my own research but solutions like Kalman filter, or estimation by least squares method, in my opinion, it's like attempting to kill ant by tank - I need smaller caliber method. Currently I don't need to know features of signal like values of angular frequencies and amplitudes.

Any ideas signal-processing community? Thanks in advance.


texts: Is there a rule of thumb for selecting the variance of the input?

texts:
Considering an estimation problem, where I want to estimate the unknown input $x$ using the known channel parameters. This estimation problem can be solved by Least Squares.

Thus, the model is $$\hat{x}[n] = \mathbf{A}^T\mathbf{x}_{n} + w[n]$$ where $\mathbf{A} = [a_0,a_1,\ldots,a_{L-1}]^T \in \mathbb{R}^{1 \times L}$ represents the channel's impulse response, and $\mathbf{x}_{n} = [x[n], x[n-1], x[n-2],\ldots,x[n-L+1]^T$  and $L$ is the order.
The model is an FIR filter and $w[n]$ is the measurement noise which is $w \sim N(0,\sigma^2_w)$.

After the estimation, I want to see the performance using Mean square error defined as $MSE = \frac{1}{NT}\sum_{n=1}^Ne[n]^2$ where $T$ is the number of independent runs, that is for every SNR, I generate $T = 10$ different channel parameters at random and for each  $T$ I perform estimation.

The error is $e[n] = x[n] - \hat{x}[n]$.

The graph to plot would be SNR on $X$ axis vs. $MSE$ on $Y$ axis. SNR is defined as $\frac{\sigma^2_x}{\sigma^2_w}$.

But I don't know what is the value of the numerator, $\sigma^2_x$. I cannot understand how to plot the curve. Can somebody please explain (with an illustration / graph would be very useful) what is the procedure to plot the graph, what is the value of variance of the input, $\sigma^2_x$?

Please correct me where ever I have done mistake (especially, in the formula ).


texts: How can output sequence be equal to the sum of copies of the impulse response, scaled and time-shifted signals?

texts:
I am sorry, this is a very basic question. But i am having hard time understanding is how it is possible.

I know impulse response is the output of the system when impulse sequence is given as input with initial conditions set to 0.

Scaling is to increase the amplitude of the signal, i.e. if i multiply the input by 2, output will also be multiplied by 2.

Time shifted signal is if I delay the input then the output is also delayed by the same factor.

Now can some one please illustrate this with an example how any sequence can be decomposed into sum of copies of the impulse response, scaled and time-shifted signals?

Thanks a lot in advance.


texts:
I need a reference for the fact that each LFSR with XOR operation has a period of $2^m-1$ excluding zero state and every LFSR with XNOR operations has the same period excluding all ones state.

I want to cite it when I'm writing about the usage of LFSR in a paper, I've found some references but they avoid a proof and all of them include only the case of XOR operations.

Since LFSRs are mostly used in signal processing I ask it here.

Edit:
I know that the feedback polynomial should be primitive.


texts: Fourier Transform of an acceleration signal containing engine orders

texts:
I am trying to understand how to evaluate this equation in the context of  acceleration data which contain engine orders

$a^{f_{e}^{crit}}(f)=\sum_{o}^{K}A^{o,f_{e}^{crit}}\mathscr{F}(cos(2\pi \cdot f_{e}^{crit} \cdot o \cdot t))$

$a^{f_{e}^{crit}}$ is the acceleration, $f_{e}^{crit}$ is the critical engine speed,
$A^{f_{e}^{crit}}$ is the acceleration expressed as a complex number and $o=0.5,1,1.5,....$ are the engine orders

My confusion arises when I try to understand how it is possible to sum the time histories of the engine orders and then apply a fourier transform to frequency domain.
I am not actually sure is it possible to have a time history of an engine order...

Any clarifications will be appreciated.
Thanks!


texts: Given two IIR filters (one Low-Pass and one High-Pass) designed using Butterworth, how can I know if they can be obtained using sampling the impulse response?


texts: What is the value of the given periodic signal at any time, how to solve it in MATLAB?

texts:
Firstly hello all, I need help about periodic signals. I have a question as below.

$x(t)$ is a periodic signal and $0.1t^3[u(t) - u(t - 7)]$
describes its one period.
What is the value of $x(t)$ at time $t = 317$?
Hint: Determine one period of the signal and find its values.

How can we solve this in MATLAB ? I tried with the code below, but answer was not correct
x(t) = 0.1 * t^3 * (heaviside(t) - heaviside(t - 7));
ezplot(x);
x(317)

Thank you.


texts: Improvement of SNR by sampling different number of cycles using FFT of a fixed length singal

texts:
My question relates to Fourier transform of signals with different lengths in time but the same fixed length of the digitized signal with different sampling rates.

Specifically, how does the number of cycles recorded effect the SNR of the FFT spectrum of a signal given a fixed number of NFFT points(the number of samples recorded is kept constant)?

My first signal(square wave of frequency 500 Hz) was sampled at a sampling rate of 100 kilosamples/sec and the signal was sampled for 10 sec, so a total of 1000001 samples.

The second signal(square signal of frequency 500 Hz) i used was sampled for 0.02 seconds at a sampling rate of 50,000 kilo-samples/second. So again the data vector length was 1000001 samples.

The FFT spectrum that i got for signal 1 was much sharper and had a high SNR  compared to signal 2(second signal). intuitively it makes more sense that the signal with more cycles would give a better result.

Is this correct ? more importantly can anyone help me in finding a quantitative relationship for this behavior?

your help will be much appreciated.

Thanks.


texts: Why is my MATLAB's bode plot wildly off?

texts:
I will give out all the details in case it is relevant. I have a MIMO state space system. I find its bode plot using MATLAB and separately using Mathematica. The plot from MATLAB is wildly off compared to the correct bode plot. However, the Mathematica plot is quite close to the correct one. Here's the interesting thing. The transfer function whose bode plot is being taken in both the softwares is calculated to be the same. Have I made some mistake or is it numerical errors contributing to the problem? Here is relevant part of my code:
A=[0,0,0,0,1,0,0,0;
    0,0,0,0,0,1,0,0;
    0,0,0,0,0,0,1,0;
    0,0,0,0,0,0,0,1;
    -297.3,163.5,0,0,0,0,0,0;
    162.9,-267.2,104.2,0,0,0,0,0;
    0,57.8,-74.2,16.4,0,0,0,0;
    0,0,16.4,-16.4,0,0,0,0];
B=[0,0,0,0,0;
    0,0,0,0,0;
    0,0,0,0,0;
    0,0,0,0,0;
    131.4,0.046,0,0,0;
    0,0,0.045,0,0;
    0,0,0,0.025,0;
    0,0,0,0,0.25];
S=[1,0,0,0,0,0,0,0;
    0,0,0,1,0,0,0,0];
D=zeros(2,5);
sys=ss(A,B,S,D)
systf=tf(sys);
s1a1=systf(1,2);
bode(s1a1);

[MATLAB plot which is way off the correct one][1][Mathematica Plot which is quite close to the correct one]2
EDIT: The transfer function being plotted here is:
$$\frac{0.046s^6-5.522\times 10^{-17}s^5+16.46 s^4 - 1.748\times 10^{-14} s^3 + 880.1 s^2 - 7.808\times 10^{-14} s + 7108}{s^8 - 4.373\times 10^{-15} s^7 + 655.1 s^6 - 2.258\times 10^{-12} s^5 + 9.887\times 10^{4} s^4 - 2.144\times 10^{-10} s^3 + 3.43\times 10^{6} s^2 - 4.353\times 10^{-9} s + 2.069\times 10^{7}}$$


texts: Image Scrambling versus Image Encryption

texts: What is the difference between image scrambling and image encryption or are they the same thing in the context of image processing? What about in communication systems in general?


texts: What does the stability margin have to do with the quality of a filter?

texts:
I designed a 2nd type Chebyshev bandpass filter with passband between 1 and 6 Hz and 30 dB attenuation in the stopband. When I looked at its Bode plot in Mathematica, I noticed "stability margins" (black lines) on the plot. I'm not familiar with this concept.

Does the stability margin have any impact on the stability of the IIR filter? For instance, will using the following filter on data (that is sampled at the appropriate sampling rate) cause stability issues?

The x-axis in both plots is the frequency (Hz) and the top plot is the magnitude response (dB) and the bottom is the unwrapped phase (radians).


texts: how to detect center of a blurry circle with opencv

texts:
I have got the following image:

There are curvs on the picture. i would like to find center of the circles containing curves.

i tried opencv and hough circle transform but had no results.


texts:
If I understood it right, a keypoint is a tuple $$(x,y,\sigma, r),$$ where $x,y$ define the position of the keypoint and $r$ an orientation (given by the most domiant gradiant vector around the keypoint). I'm still not sure about the intention of $\sigma$.

What is done in the first part of SIFT is to consider $$L(x,y,\sigma):=G(x,y,\sigma) \ast I(x,y),$$
where $I(x,y)$ denote the value of the image at position $(x,y)$, $\ast$ the convolution and $G(x,y,\sigma)$ the gaussian filter with standard-deviation $\sigma$, evaluated at position $(x,y)$.

Now DoGs are considered, for different sizes of the image and for different blurring-values $\sigma$ and interesting points are collected.

What confuses me most about this procedure is that Lowe denotes $\sigma$ as the scale of the image. However, $\sigma$ is just a blurring-parameter.

Hence, I define a blured image of a scaled image by
$$L(x,y,\sigma,s):=G(x,y,\sigma) \ast I_s(x,y),$$ where $I_s$ is the Image $I$ scaled by factor $s$ (So multiplying both dimensions of the image by s, and rescaling it). Thus, an interesting point in a DoG is a point $(x,y)$ in the image $L(x,y,k\sigma,s)-L(x,y,\sigma,s)$.

In Lowe's paper, he never considers the parameter 's' but just $\sigma$. Why is that possible ? How do I relate $(x,y)$ of $L(x,y,\sigma,s)$ to a position in the image $I$ and why do I save the blurring-parameter $\sigma$?

In what way is the keypoint now scale (resize)-invariant ?

Should there be in the resized image at some DoG a keypoint, which corresponds to the former keypoint by having more or less the same orientation and magnitude of its surrounding gradiants ? Is that the invariance Lowe is talking about ?

To find a keypoints, a local extrema of $L(x,y,\sigma)$ around a point $(x,y,\sigma)$ is considered. What is idea behind using interpolated extrema via Tayler expansion ?

Thanks Michals


texts: In the case with a 1-D input like audio, how can a system with one input do many different kinds of processing at different sampling rates and still, at the end of the processing, produce one waveform? For example an ADC/DAC reading and writing at 48kHz, but has an FFT running at 8kHz or another set of processes running at 16 kHz? Is it a matter of decimating and interpolating? How would all of these processes line up?


texts: What is the difference between PSD and squared magnitude of frequency spectrum?

texts:
The power spectrum of a signal can be calculated by taking the magnitude squared of its Fourier transform. Being an audio person, the signal of interest for me would be a time series.

How does this representation differ from a PSD (power spectral density), and importantly, in what practical situations should one use a PSD instead of the power spectrum described above?


texts:
I'm a student studying communications engineering.  I'm trying to understand why this particular laser diode is made for 155 Mbps and 622 Mbps.  I'm thinking that the bitrate is entirely dependent upon the bandwidth of the photodiode.  I can see from the datasheet that $f_c = 2 \text{ GHz}$ and so what I'm thinking is that you could have, a 1 GHz carrier with around 2 GHz of data.  So wouldn't this allow for a 2 Gbps bitrate?  I'm just wondering if this thinking is correct.

The datasheet can be found here:
Datasheet


texts:
I have this model in simulink (the graph is my output):

The step input has amplitude 0.5 m/s, and it steps up after 0.1 seconds. The gain $K_p=5$.
The saturation block is to keep the voltage between -3 and 3 volts.
The transfer function is the system, and it is given by $H(s) = \frac{16.94s + 579.5}{s^2 + 507.2s + 1224}$
The integration block is to convert velocity (in m/s) to position (in m). So the output is position.
I want my system response to be as fast as possible, and with no overshoot. On the graph above, an overshoot can be seen. To fix this, I added a $C_d=\frac{0.4s+1}{0.04s+1}$ term in the feedback loop.

As you can see there is no longer any overshoot. But it still takes about 3 seconds for the output to stabilize around the desired value.
How do I make the system response faster, such that the desired output value is reached sooner? Can I add a block in my simulink model perhaps?
Edit
Putting the $C_d$ block in the forward path sped up the response, but not by much. About 1 sec.


texts:
I have a sound source that generates an ultrasonic pulse. I have two microphones seperated by a distance which are at a distance from the source. I want to find the time delay of arrival of the ultrasonic pulse at the mics. I am filtering out all the frequencies other than my source frequency from the outputs of the mics. Due to noise and other reasons, the shape of the pulse received at each mic is not same. I am using cross-correlation to find the time delay but the results are inconsistent. I observed that when I use low frequencies (100~300hz), results are consistent. But I want to find using ultrasonic sound. I am using the below code for finding time delay

[xc,lags]=xcorr(x1,x2);
[m,i]=max(xc);
timeDelay=lags(i);

Can anyone please tell me what is it that I am doing wrong and how to correct it? I posted a similar question here, but couldnt understand the provided answer. In some articles, it is mentioned that cross-correlation works only for cases when the signal shapes are identical. If so, how can I find the delay? I was also wondering if the voice tracking cameras used in video conferencing use some technique other than cross-correlation.


texts: How to add 2 MFCC extracted features to a variable?

texts:
I am working on signal processing for speaker verification.

I have extracted MFCC features for few wav files using GMM algorithm.

Now, i want to add any 2 MFCC features to another variable.

How can I achieve this?


texts:
I'm reading the book
Vinay Ingle, John Proakis - Digital Signal Processing Using MATLAB® (3rd Edition) and I came across a function to shift sequences. Mathematically,

$$
y(n) = \{x(n-k) \}
$$

if $m = n-k$, then
$$
y(m+k) = \{ x(m) \}
$$

function [y,n] = sigshift(x,m,k)
n = m + k;
y = x;
end

This function shifts nothing. I've tried to find errata list of the book, but I couldn't find it. Is this function correct?


texts:
As per the convolution theorem, a convolution in time domain is equivalent to a
multiplication in the frequency domain.

Then say (MATLAB code),

x = x(1:256)
y = y(1:256)
conv(x,y) should be equal to ifft(fft(x).*fft(y))

But it is not. Why is it so? What is that I am missing?


texts: How to filter out noise in high frequency signal?

texts:
I am trying to filter this signal (download-zip):

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

df = pd.read_csv('signal.csv')
sig = df['1']

b, a = signal.butter(4, 0.1, analog=False)
sig_ff = signal.filtfilt(b, a, sig)
plt.plot(sig, color='silver', lw=0.3, label='Original')
plt.plot(sig_ff, color='red', lw=0.3, label='filtfilt')
plt.xlim(0, sig.index[-1])
plt.legend()
plt.show()

As you can see the noise reduction works but it also cuts off the impulse signal. I think the impulse frequenzy might be as high as the noise frequency. How can I filter out the noise of the signal without deleting the impulse?

Edit:

To give a further explanation what I am trying to do: I am trying to determine the Impulse properties like raise time and half-life time. Although it is possible to do with the noise in the system, I thought it might influence the Impulse. The Impulse I have shown is one of the larger ones that I have. It gets harder and harder to analyze smaller Impulses like this one:

As you see, this Impulse is partly concealed by the noise signal. I was wondering if it would be possible to remove the noise sufficiently to also be able to analyze these small Impulses.

The Spectrum (np.fft.rfft) of the larger Impulse (Gray/Red) is this:

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

df = pd.read_csv('signal.csv')
fft = pd.DataFrame(np.abs(np.fft.rfft(df['1'])))   #y
n = df['0'].size
unit_freq = 1000000000 #Giga
sample_rate = 10000000000   #10 GS/s
freq_sample_fact = sample_rate/unit_freq
freq = np.fft.rfftfreq(n, 1/freq_sample_fact)       #x
fft.index = freq
fft.values[0] = 0
fft.plot(grid = 1,
         color = (255/255,0,0),
         linewidth = 0.3,
         figsize = (10,5),
         legend = False,
         xlim = [fft.index[0], fft.index[-1]*0.8],
         ylim = 0,
         xticks = np.arange(0, freq_sample_fact/2 + 0.1, round(freq_sample_fact/2/10, 1)))
##plt.semilogy(fft)
plt.xlabel('Frequenz / GHz')
plt.ylabel('Signalstärke')
plt.title('FFT')
plt.show()

The FFT of the smaller Impulse (blue) is:

Noise

This is the spectrum of the noise:

I believe the y axis (Signalstärke) represents the "amount" of signal found on one frequency. The noise signal has a pretty high amount compared to the other ones because I took a wider time frame of the noise.


texts: What is the optimal Wiener-filter for this purpose?

texts:
Suppose I want to measure something with a sensor which in response to $u(t)$ produces an output signal in form of $v_{out}(t) = (1-e^{-t/ \tau})u(t)$, where $u(t)$ is the Heaviside-function and $\tau=40ms$.

How to solve the deconvolution?

How do I determine the optimal Wiener-filter if I have an additional white noise $n(t)=n_0$ with $\omega_{max}=300s^{-1}$?


texts: Fourier transform with periodicity at the harmonic frequency

texts:
Let's suppose I have a signal $F(t)$ that is periodic, with two periodicities $P1$ and $P2$, with $P1>P2$

Suppose that I know the values of the two periodicities. Using the Fast Fourier transform I can show the two values as peaks in a power spectrum.

Now, let's suppose the second periodicity $P2$ (the faster one), has exactly the same value as the first harmonic of the fundamental value, or $P2=2×P1$. This means that I will be not able to distinguish it by using the power spectrum, at least not by looking at the frequency of the peak.

My question is: is there a way to separate the contributions in such a case?

For example, is it possible to predict the power of the first harmonic, so that the difference between the predicted power and the observed power of the harmonic peak gives a result significant enough (i.e., greater than $3\sigma$) to say that the first harmonic also "contains" the contribution from a periodicity?

Please, be plain I am not experienced in this (nonetheless some equations/numbers are ok).


texts: Image Processing Terminology Question: Even/Odd Quadrature Pairs and Center Surround Filter

texts:
I am reading the paper Learning to Detect Natural Image Boundaries
Using Local Brightness, Color, and Texture Cues available here.
In section 2.2.2, page 5, slightly after halfway done the page on the left the authors use the terms

even and odd quadrature pairs of filters
a center-surround filter

For instance an example of an even/odd quadrature filter they discuss is a Gaussian second derivative filter (even) and its Hilbert Transform (odd).
The example of a second surround filter is a Difference of Gaussians filter.
Any elaboration on what these two terms mean in general much appreciated.


texts: choosing windowing function for audio signal processing

texts:
Currently I am working on chord recognition, and get confused on several aspect. One of them is choosing windowing for reduce the spectral leakage.

from what I read, hanning/hamming function is a good choice for windowing, but currently I read about welch windowing function, and its quite good either.

So, can somebody explain to me which windowing function I should choose and the reason?or are there any better windowing function?

thank you


texts: LTE questions (subcarriers and cyclic prefix)

texts:
Assume we have transmission bandwidth of 10 MHz, in this case the total number of subcarriers (FFT size) present is 1024. According to LTE standards, 600 out of 1024 subcarriers are data subcarriers.

data subcarriers= total number of subcarriers- pilot/null subcarriers

Moreover, 0.07 % of 1024 are used as Cyclic Prefix extension

1) Is it correct that we have 1024-600 are therefore unused subcarriers?
(where 600 = total number of Resource Blocks (RB) * number of subcarriers/RB = 50*12)

2) An OFDM symbol is made up of data part and CP part. Is it correct to say that the number of QAM symbols for each OFDM symbol is then 600 (equal to number of data subcarriers) and the number of CP symbols are 72? How is the actual transmission over the subcarriers taking place. For example in downlink, does the transmitter allocate a certain number of subcarriers over which it transmits?

I hope I can get some feedback! Thanks


texts: good free software (or code) to separate multiples sources in a single wav?

texts:
For a school project I'm working on instrument classification on multi-instrumental tracks. To do so, I'm following Arie Livshin's modus operandi, and I would like to get a good software to perform source separation: given a multi-instrumental short extract, getting n (with n being equal to the number of instruments) tracks with more or less one instrument per track.

The best I've found so far is the FASST toolbox for Matlab, but the result on a saxophone/guitar song was quite disappointing. Have anyone encountered something better I could use?


texts: Reconstruct images from PCA reduced dimensions with NN

texts: I was reading this Medium post and I had the idea to reconstruct the original images with a convolutional neural network instead of applying the inverse transform method. The problem is that I don't know how to define the input of the CNN. From what I know, PCA reconstructs the original images as a linear combination of the eigenvectors, so I guess the features should be the k eigenvectors for each original image, but having the same features for different labels doesn't make sense. Is it possible to recontruct the images from the reduced dimensions? If possible, what approach is the one you think would work?


texts:
I have signal that looks like this:

As you can see there are some almost periodic pulses at the background with amplitude about 1000. I am saying almost, because, if you zoom in, you may see that they slightly differ from each other, plus there may be intervals without them, something like between 35000 and 40000.

How can I get rid of these pulses?

csv with data


texts: How to get coefficients for sine/cosine function from complex FFT?

texts:
I'm working on a control system that measures the movement of a vibrating robot arm. Because there is some deadtime, I need to look into the future of the somewhat noisy signal. My idea was to use the frequencies in the sampled signal and produce a fourier function that could be used for extrapolation.

My question: I already have the FFT of the signal vector (containing 60-100 values e.g.) and can see the main frequencies in the amplitude spectrum. Now I want to have a function f(t) which fits to the signal, removes some noise, and can be used to predict the near future of the signal. How do I calculate the coefficients for the sine/cosine functions out of the complex FFT data?


texts: Does oversampling improve processing gain?

texts:
I am used to Time-Bandwidth product describing the processing gain or improvement in SNR for a spread spectrum signal using a matched filter.

One could view the bandwidth $B$ as the sample rate (complex) and the time $T$ is the integration time and thus there are $TB$ samples.  Thus, the matched filter produces a gain of $10\log_{10}N$, with $N$ being the number of samples.

So with all of this in mind, suppose a bandpass filter removes all noise power except for the signal bandwidth, thus the noise power is $kTB$.  The signal power is the amplitude $A$ squared, $A^2$.  If we over sample the signal by some factor $M$, then I want to say that the processing gain is now $MTB$ because there are $M$ more samples.

I also have worked some theory of this as well as a MATLAB script and all is indicating that it is true.  Am I missing something?  Why not over sample signals to provide more processing gain using a longer matched filter?


texts:
I have received signal from FMCW Radar which is of the shape [128x64] = [Number of samples per chirp x Number of chirps per cycle] and i want to calculate the stft
i am calculating it with stft command and for that using vectorized data.[1x8192]

fs = 1000e3;
win = blackman(64,'periodic');
[S,F,T] = stft(data,fs,'Window',win,'OverlapLength',60,'FFTLength',256);
S = abs(S);
imagesc(T,F,S);
colorbar;
xlabel('Time');
ylabel('Frequency');
zlabel('Amplitude');
title('Spectrogram');

From this i am getting the same plot for every cycle. Is this approach correct or do i have to calculate the stft separetely for every chirp?
If my approach appraoch is correct what does this stft tells me?
Data


texts:
2 identical signals generated by the same PLL/VCO should have the same phase noise profile and their respective phase noises should be correlated.

Suppose one of them is delayed and I start sampling both simultaneously , if I now compare the phase noise of their respective samples taken at a certain time instance would the phase noise still be correlated? and if not how long would the delay have to be in order for their phase noise to be uncorrelated (if decorrelation is involved)?

My guess is that since phase noise has a trapezoidal shape and has a low pass filter frequency response, it is roughly the reciprocal of the loop BW that determines the length of the delay that would cause phase noise to become uncorrelated , the wider the loop BW i.e. the shorter the delay.

Does my reasoning make sense?


texts:
I cannot find out what does "notch" means in image processing?
We have selective filters that one of the best of them is Notch filters. but what does the concept of "Notch"? why they are called "notch" filters?


texts: Simplify equation of single pole IIR transfer function

texts:
Example - Consider the causal stable IIR transfer function
  $$
H(z)=\frac{K}{1-\alpha z^{-1}}, \quad 0 < \lvert \alpha\rvert 1
$$
  where $K$ and $\alpha$ are real constants
  Its square-magnitude function is given by
  $$
\lvert H\left(e^{j\omega}\right)\rvert^2 = H(z)H\left(z^{-1}\right)\bigg\vert_{z=e^{j\omega}}=\frac{K^2}{\left(1+\alpha^2\right)-2\alpha\cos\omega}
$$

Can anyone please explain how to simplify the equation to get this form? I am not able to understand it.


texts: Estimation of Group Delay from Noisy Frequency Response Measurements

texts:
Consider a linear, time-invariant system.  Noisy measurements of the magnitude and phase associated with the frequency response of the system are available over some dense generally non-uniform grid of frequencies.

I need to use these measurements to estimate group delay.  Direct approximation of the derivative of phase via successive differences in the phase measurements is extremely noisy.

Some form of smoothing seems appropriate (e.g., spline smoothing).  If I know the maximum rate of change of group delay as a function of frequency, how can I incorporate that side-information into a smoothing procedure?  More generally, is anyone aware of other techniques (beyond fitting the frequency response measurements to some rational filter model and computing group delay from the associated parametric model)?


texts: Performing DFT of streaming audio problem. Is there a limit?

texts:
I am trying to write software that will perform the discrete fourier transform of real time data coming from the microphone into the sound card on a computer. I am using Java with the javax.sound APIs.

I am capturing 250 ms of data each time. That means, as the sampling rate is 44100, I am buffering 11025 of 16-bit shorts and performing the DFT on this data in each iteration.

My DFT code correlates this window of data with sine and cosine waves from 19 Hz up to 198 Hz in steps of 1, so as this window is 250 ms of data , this means it is actually correlating the incoming audio with frequencies from 76 Hz up to 792Hz in steps of 4.

If I now wish to take a smaller window of data each time of 125ms instead of 250ms in order to speed things up. If i correlate this data with sine and cosine waves of incrementing frequencies by 1 like before, this means that it is actually correlating the incoming audio with waves in steps of 8Hz. This is not good for my problem as I want to be able to look for frequency differences in the signal of less than 8Hz.

My question is, is this the normal trade-off, speed versus frequency resolution , or is there some way around this ?

Many thanks in advance. I am new to audio processing so forgive me if i'm missing out on some common sense :)


texts: Early-Late Symbol Synchronizer on Non-Triangular Pulses

texts:
I've been studying the basics of digital communications using the free book at desktopsdr.com.

One of the examples is a 4-QAM demodulator which where symbol timing recovery is done with some Early-Late Gates after match-filtering with RCC.

I thought that Early-Late Gates were only useful when all pulses had triangular shape. However, binary data filtered with Raised Cosine does not:

.

For non-triangular signals, the Early-late algorithm seems to output an error even when the sampling point is exactly right:

When there is a single symbol, I understand that the error L - E == 0
If there is a transition to a sequence of repeated symbols, however, I see that the estimated error is non-zero, which is wrong.

What am I missing?


texts: i have an audio signal. i have to find whether my audio signal is from given avi scene

texts: I have audio signal. I want to find whether my audio signal is from a given avi file . I tried using correlation and mfcc. But i'm not getting accurate output. So please help me in this.


texts: Impulse invariance vs. DT representation of a CT system: Where is the inconsistency?

texts:
Suppose you have a continuous-time (CT) system $h_c(t)$, bandlimited to $B$. Your goal is to represent the system as a discrete-time (DT) system $h[n]$, sampled at $f_s \leq 2 B$. Clearly $h[n]$ won't be a faithful representation of $h_c(t)$ because we do not satisfy the sampling theorem. But I am interested in the exact relationship between $h_c(t)$ and $h[n]$ in this case. There are two ways to think about this:
Representing the CT system as DT one
Based on this question (and answer): Representing a continuous LTI system as a discrete one, $h[n]$ represents a low-pass filtered version of $h_c(t)$:
$$
h[n] = \tilde{h}_c(n T_s) ,\\
\tilde{h}_c(t) = \int h_c(\tau) \operatorname{sinc}\left(t-\tau\right) \operatorname{d}\tau
$$
Impulse Invariance
According to https://en.wikipedia.org/wiki/Impulse_invariance, the sampled $h[n]$ corresponds to an aliased $h_c(t)$:
$$
H(e^{-j\omega}) = \frac{1}{T_s} \sum_{k=-\infty}^{\infty} H_c\left(j\frac{\omega}{T_s} + j\frac{2\pi}{T_s}k \right)
$$
I could take the IDTFT:
$$
h[n] = \sum_{k=-\infty}^{\infty} T_s e^{-j2\pi k n} h_c(n T_s)
$$
which is not the same as the low-pass filtered version above.
There no low-pass filtering.
These two approaches seem to give me two different answers on how to relate $h[n]$ and $h_c(t)$ (when sampling theorem is not obeyed).
What is wrong?


texts: What spectral estimation technique to use for finding sharp spectral lines?

texts:
At the moment, I am using the Welch's averaged modified periogram method for spectral estimation, which has the frequency resolution $f_s/N$ where $f_s$ is the sampling frequency and $N$ the window length. I get a a resolution that is about $0.1$ Hz. I would like to spectral lines from a set of noisy data and it appears that the resolution provided by this method is not enough in all cases.

What would be a better way to estimate the line components?


texts:
Say we have a signal S, and we composite it with a 0.1-volume 30-sample-delayed version of itself, so:

T(k) = S(k) + 0.1*S(k-30)

How would one rearrange this equation to make S the subject?

i.e given the resultant signal T, and the fact that we know the parameters of the echo (0.1 and 30), how to reproduce the original S?


texts: Obtaining the frequency and phase spectra from fourier transform?

texts: For a question on my homework, I am given f(t) = e^(-a*abs(t)) and asked to find the Fourier transform of the function. I understand how to do that part, but then the answer requires me to "Compute the amplitude and phase spectra" of the function. My question is, what are these spectra and how do I obtain them from the given function or its Fourier transform?


texts:
I've been reading the Chebyshev filters chapter in The Scientist and Engineer's Guide to Digital Signal Processing and it says

"The Chebyshev filters discussed in this chapter are called type 1 filters,
meaning that the ripple is only allowed in the passband. In comparison, type 2 Chebyshev filters have ripple only in the stopband. Type 2 filters are
seldom used, and we won't discuss them. "

Why is it that Type 2 filters are uncommon? It seems to me that it's much more useful to have the ripple in the stopband (the bit you don't want) than in the passband (the bit you do want).


texts: Why do Octave and MATLAB both automatically shift the gray values in this image?

texts:
Edit: I found this other question that actually addressed a separate but possibly related problem I was experiencing. However, in the below case the image is in uint8 when read into both Octave and MATLAB so it doesn't actually address this specific problem.

I'm going through the Scientist and Engineer's Guide to Digital Signal Processing and experimenting with the image manipulation examples given later in the chapter. But I've run into an odd issue that is grinding my progress to a halt because it makes it impossible to predict what will happen.

I've used Octave from the start, but today downloaded a trial of MATLAB and it does the exact same thing.

Here's an example. I created a test image to experiment with grayscale transforms. Here is the original PNG:

In Octave I run the following code:

>> dots3 = imread('dots_3gray.png');
>> imshow(dots3);

And I get this as the result:

As you can see the values are all shifted -- the image as displayed by Octave (and also MATLAB) has downshifted all the values so the whites are now dark gray and the grays are now black. (ignore the size difference, the second is a screen capture) Both are 100x100 pixel grayscale images. The min value in the matrix as it is read in by Octave is 0 and the max value is 158.

Interestingly, using the eyedropper tool in Paint.NET I checked the range of values in the original PNG and the min value (in the center of a gray dot) is 96 and the max value (in the white field) is 255 -- a difference of 159 which is oddly enough exactly the number of steps in the range of numbers [0, 158] reported in dots3 as read by Octave. So some sort of shifting certainly appears to be going on here.

I can get the image to display with the correct colors by shifting the pixel values by 97, the difference between 255 and 158:

>> imshow(dots3 + 97)

Any idea why this behavior is happening? It makes it extremely difficult for me to experiment with the algorithms because I can't know if a change is caused by the code or by Octave / MATLAB doing this on its own.

Platform is Windows 10. Thanks.


texts: spread spectrum communication in airport

texts:
Does anyone know , how the spread spectrum sequences are used in airports. I've attended a presentation this morning regarding spread spectrum in my college, the author mentioned that the sequences are helpful in landing of the aircraft, and also to mitigate interference between air crafts. How is that possible? Is it like assigning a unique code to every aircraft?

Thanks in advance,
phani tej


texts: Is there any library for convolution reverb software for Visual Studio besides Freeverb?

texts:
I am currently working on a simulation of a virtual scene. I calculate the IR of the direct path and the early reflections and want to convolute them with the input signal. My problem now is that implementing such a software for real-time purposes would exceed my time limit I got for my work. So I need a third party C++ library (my project is written in C++) for that.

I already tried Freeverb3 but did not get it to run using MinGW and FFTW as an additional third party software for Visual Studio. Is there any other free software besides Freeverb3 that can more easily be compiled and used than Freeverb?

I searched on this site as well as google for further software; but without success. Alternatively: Is there any way to get a convoluted input signal in real-time using convolution reverb libraries that I am not seeing? It kind of is a necessity for my project and any way possible is appreciated. Thank you.


texts: How do i remove these kinds of noise from the discrete signal in python?


texts:
I have posted this question in math.stackexchange.com, [can be found here], which I originally thought it is a math question. I now believe this would fit more to the Signal Processing community. For convenience, I am reposting the question in below. I would appreciate any help.

  I am trying to understand what it means by $0.01\log_{10}$, which was published in the following paper at page 7 in IEEE.

  Berrier, Keith L., Danny C. Sorensen, and Dirar S. Khoury. "Solving the inverse problem of electrocardiography using a Duncan and Horn formulation of the Kalman filter." IEEE Transactions on biomedical engineering 51.3 (2004): 507-515.

  I cannot convert $0.01\log_{10}$ to a number since I expected to see something like $0.01\log_{10}^3$ to be able to say it is equal to 0.0048. The authors uses this expression twice in the paper.

  Could someone kindly help me in understanding what the authors meant by $0.01\log_{10}$?

  The following is a snapshot of the paragraph of the paper in which $0.01\log_{10}$ was used.


texts: Using Local Binary Pattern for finding Homography between two Image

texts: Can LBP be used to find the homography between two images with similar field of view for Image Registration?


texts:
"Necessary condition for lpf to lpf transformation is that a magnitude response must keep its original values at $\omega=0$ and $\omega=\pi$"?

Why is it so?

But does that not essentially read that the cutoff ought to stay the same? Even though one wants to transform a lpf with cutoff $\omega_c$ to another with cutoff $\omega'_c$. Then why this requirement?


texts: Is it possible to combine two or more Biquads?

texts:
I've wrote a Equalizer, and now it apply the Biquads in serie (cascade), I was just thinking if i can combine the biquads it will more efficient than applying one-per-one.

Is that possible?


texts: Kalman Filter EM Estimation of Covariances

texts:
The question might be very simple, but I get a strange result from Kalman Filter. Let us consider the simplest state-space model, the random walk plus noise:
$$
y_{t} = x_{t} + \varepsilon_{t}\\
x_{t} = x_{t-1} + \mu_{t-1}
$$
Let us generate $N_{data} = 3000$ data points and with parameters: $Var(\mu_{t}) = 1$ (which is transition variance) and $Var(\varepsilon_{t}) = 1$ (which is observation variance).

Using Kalman EM in Python, I try to estimate the transition and observation variance.

First, I would like to estimate "observation_covariance" and I assume that "transition_covariance" is known:

kf = KalmanFilter(
    transition_matrices=[1.], observation_matrices=Data['x'],
    transition_covariance=[1.], initial_state_mean=3,
    initial_state_covariance=[1.],
    em_vars=['observation_covariance']
)

kf = kf.em(Data['y'])

the result is $0.79$.

Second, I do the opposite, i.e. I estimate "transition_covariance" and I assume that "observation_covariance" is known:

kf = KalmanFilter(
    transition_matrices=[1.], observation_matrices=Data['x'],
    observation_covariance=[1.], initial_state_mean=3,
    initial_state_covariance=[1.],
    em_vars=['transition_covariance']
)

kf = kf.em(Data['y'])

the result is $0.001$, which is far from $1$!

Next, I assume that both "transition_covariance" and "observation_covariance" are unknown:

kf = KalmanFilter(
    transition_matrices=[1.], observation_matrices=Data['x'],
    initial_state_mean=3, initial_state_covariance=[1.],
    em_vars=['transition_covariance', 'observation_covariance']
)

kf = kf.em(Data['y'])

the result is "observation_covariance" = 0.77 and "transition_covariance" = 0.0002.

What do I do wrong? Shouldn't those estimated variances be close to $1$?

The all code I use is below:

#%%
import pandas as pd
import scipy as sp
import numpy as np
import matplotlib.pyplot as plt
import pylab as pl
from pykalman import KalmanFilter

N_data = 3000
Data = pd.DataFrame(columns=['NoiseTrs', 'NoiseObs', 'x', 'y'], index=range(N_data))
Data['NoiseTrs'] = np.random.normal(loc=0.0, scale=1.0, size=N_data)
Data['NoiseObs'] = np.random.normal(loc=0.0, scale=1.0, size=N_data)

# random walk

x_f_v = 3 # first value for the simulation
for i in range(N_data):
    if i == 0:
        Data.loc[i, 'x'] = x_f_v
    else:
        Data.loc[i, 'x'] = Data.loc[i - 1, 'x'] + Data.loc[i, 'NoiseTrs']

# plt.plot(Data['x'])
# plt.show()

Data['y'] = Data['x'] + Data['NoiseObs']

# plt.plot(Data[['x', 'y']])
# plt.show()

F = [1.]                                               # transition matrix
H = Data['x'].values.reshape(N_data,1,1).astype(float) # observation matrix
Q = [1.]                                               # transition noise
R = [1.]                                               # observation noise

#%%
init_state_mean = [3.]
init_state_cov = [1.]

kf = KalmanFilter(
    transition_matrices=F,
    observation_matrices=H,
    # transition_covariance=Q,
    # observation_covariance=R,
    initial_state_mean=init_state_mean,
    initial_state_covariance=init_state_cov,
    em_vars=['transition_covariance', 'observation_covariance']
    # em_vars=['observation_covariance']
    # em_vars=['transition_covariance']
)

kf = kf.em(Data['y'].values.astype(float))

print("observation_covariance R :", kf.observation_covariance)
print("transition_covariance Q :", kf.transition_covariance)

```


texts:
I'm a math postgrad student working through a paper on eigenvalue decompositions of matrices of FIR filters (used for stuff like total decorrelation, convolutive mixing, MIMO). Towards the beginning, when describing their signal model, they use the phrase:

  If the PSD of the $l^{th}$ source is generated by a stable and causal innovation filter $\text{F}_{l}(z)$, ...

What does this mean? I understand a stable filter is one whose coefficients $a[n]$ approach 0 as $n \rightarrow \infty$, and a causal filter is one which does not use values from the future (i.e. no negative time lags). I have read that the innovation in terms of stochastic processes is defined as the difference between the actual next value of a time series, and the value given by an optimal prediction based on the information already available.

I cannot, however, find any description of an innovation filter. I have a mathematics background rather than a DSP/engineering background, and so sometimes some of the terminology trips me up, which is why I was hoping DSP stack exhange could kindly help!


texts: Finding the differences(using features, not subtraction) in order to find differences in signals

texts: I have a question. Let’s say I have two signals (discretely represented as arrays), $S_1$ and $S_2$ as shown below. $S_1$ has a similar form to $S_2$. If the signals are subtracted, $S_2-S_1$, they will not give the output on the right as their voltages don’t necessarily line up in the parts where their features don’t. Is there a way I can filter $S_1$ Using $S_2$ to give me the output on the right. Thanks


texts: Number of samples in a discrete signals after sampling a continuous periodic signal should be integer?

texts:
If a continuous periodic signal is sampled with time interval Ts , and T being time period of continuous signal --
For the resultant discrete signal to be periodic following must be true--
the ratio of T/Ts = rational number = number of samples in the discrete signal.

If I take an example of sine wave with T = 300 seconds , Ts = 100 seconds
Number of samples = 3

If I take an example with same sine wave  T = 300 seconds , Ts = 175 seconds
Number of samples = 300 / 175 = 1.714285714285..(repeating)

My question is how come the number of samples in a discrete signals is not an integer , in other words I am not able to understand how can a discrete signal have number of samples in decimals.


texts: Inter-Symbol Interference (ISI) channels

texts: Is there any open and free data-set for digital ISI channels? I want to have a variety of ISI channels' taps, such as $h[k]$ here. Especially looking for BPSK channels.


texts: What's the model for a DAC followed by a sampler?

texts:
I have a situation where a sampled signal is passed through a DAC and re-sampled by a switched capacitor circuit.

I can't see a model for this in the literature.

The standard model of a DAC is the ZOH. But when it gets re-sampled by the switched cap circuit it seems to me that ZOH effect of the DAC disappears because of the re-sampling.

What does the Signal Processing SE community think?

Assume the re-sampling is at the same rate as the DAC.


texts: The necessity of null subcarrier in OFDM?

texts:
In looking to LTE specifications, with the subcarrier spacing $\Delta f = 15 \textrm{kHz}$,

for bandwidth $10 \textrm{MHz}$, fft size $N_{fft} = 1024$ that needs a sampling rate $F_s \geq 1024 \times 15\textrm{kHz} = 15.36 \textrm{MHz}$. The useful subcarriers are the 600 centered ones (excluding the DC). There are $1024-600=424$ null subcarriers.
for bandwidth $20 \textrm{MHz}$, fft size $N_{fft} = 2048$ that needs a sampling rate $F_s \geq 2048 \times 15\textrm{kHz} = 30.72 \textrm{MHz}$. The useful subcarriers are the 1200 centered ones (excluding the DC). There are $2048-1200=848$ null subcarriers.

I want to know what is the objective of band-edge null subcarriers in LTE, or in OFDM ? I have found the photo above in Internet, it seems that these null subcarriers are guard band.

Question 1 : are these null subcarriers really sent over propagation channel ? I mean the occupied bandwidth of LTE in "$10 \textrm{MHz}$" case is really $10 \textrm{MHz}$ or $15 \textrm{MHz}$ ?

Related question, BW of OFDM question, but the answer is still unclear about what is the occupied bandwidth in the shared wireless medium.

Question 2 : if the occupied bandwidth is only $10 \textrm{MHz}$, can other systems use this bandwidth (from subcarrier 300 to 511 and from -300 to -511) ? Is there degradation of its own performance ? Does it cause inteference to LTE data subcarriers ?

Question 3 : if the occupied bandwidth is $15 \textrm{MHz}$, the factor $424/1024 = 41.4 \%$ seems a lot. How is it dimensionned ? Are they "guard band" to allow the side lobe of sinc pulse shaping (from FFT) to vanish ?

For the question 3, I have found this question in stackexchange a related question with the answer

  Specifications will often call for some null carriers around the edge
  of the band (to allow for rolloff in the antialiasing filters in the
  front end)

Hm, $41.4\%$ seems too much for rolling off, doesn't it ?

  Update : my questions are about the band-edge null subcarriers, but one may find interesting information about the DC null carrier in
  the answer. Note that the DC subcarrier is skipped at OFDM baseband
  signal generation, i.e. not be used to transmit data. But in wireless
  environment, there may exist DC carrier to help mobile devices to find
  the carrier frequency, at least it is true for Downlink LTE (see LTE
  UE radio TX and RX spec, figure 5.4.2-1).


texts:
Let $f$ be an $N \times M$-image and suppose that $g$ is its  equalization.
Question  - Why the equalization does not change the objects, why a car on $f$ does not convert into a bus on $g$?. It is not obious that after the pixel intensity $r_k \mapsto s_k$ recalculation for $g$
$$
s_k =\frac{L-1}{NM}\sum_{j=0}^k n_k, k=0,1,\ldots,L-1,
$$
we obtain the same scene as was for $f$! Here  $n_k$ denotes the number of
pixels that have intensity $r_k.$


texts: what's the pass band ripple and stop band attenuation of a digital filter?

texts:
Hi i'm a beginner in signal processing i want to know what'sthe pass band ripple and stop band attenuation of a  digital filter ?
Thanks.


texts: Question about ASK, correlation, and frequency domain

texts:
So I'm currently studying ASK (amplitude shift keying) and how it is modulated and demodulated. The modulation take out data signal, $M(t)$, and multiplies it with our carrier frequency, lets say $\cos(2\pi f t)$, and that's our modulated signal.

For the demodulation, we our taking our received signal and multiplying it with our carrier frequency, which in the frequency domain shifts our received signal to the left and right by our carrier frequency. So we end up with out signal both at the origin and at 2 times our carrier frequency. After that we can do a low pass filter to recover out message signal $M(t)$.

So my question is, what happened to our correlator? I thought in digital communications you take your received signal and pass it through a match filter, which can also be implemented as a correlator. In discrete time this is a multiplication with a signal and then a summation, right? What it seems like we're doing is just multiplying just a single point from the received signal with a single point of our carrier frequency. I've simulated this in MATLAB, and I can see what happens to the signal, I'm just confused why this simple multiplication be being called a correlator.

That being said, can this multiplication and low pass filter be done in the frequency domain by any chance? I know a convolution (or correlation) in the time domain is just a multiplication in the frequency domain, but i'm not sure how to do what we're doing for the ASK demodulation in the frequency domain.

Thanks for your time and input!


texts:
I wanted to prove to myself why the DCT is better than the DFT and heres a brief of what I understand so far.

The DTFT works with a finite sampled input signal, but the frequency response obtained is continuous and periodic. The DFT samples the DTFT since it is still not practical for real world applications. The DFT inherits this periodicity and X[k] can be shown to repeat from the definition itself. Taking the IDFT of the periodic spectrum, results in a periodic waveform, and this is why the DFT assumes x[n] is periodic. Now the reason the DCT is better because its periodicity is even and that eliminates any discontinuity.

Why does the DCT assume that x[n] is mirrored? Is this established in the derivation of the DCT beforehand? Furthermore we say that x[n] doesn't have any discontinuity because X[k] is mirrored for X[k+N], and taking the IDFT of that would result in a periodic x[n] mirrored with no discontinuity. Any answer is appreciated whether its descriptive or mathematically.


texts: I am trying to self-study audio codecs and I am trying to understand the difference between CODECS that come under AMR-WB, SuperWB and EVS vs. AAC-LD (MPEG-4). When is the former used and when is the latter used. Can one be used instead of the other? Also where does LPC (Linear Predictive Coding) get used? Any guidance would help


texts: interpretation of simulation results : capacity with precoder

texts:
I am studying the concept of computation the capacity. I have early asked about the difference between CSI unknown/ known to transmitter here.

In the book about Matlab implementation OFDM system, the equation for capacity with CSI is known to the transmitter is given.
$$ C = \max  \log_2 \det (I_{N_R} + \frac{E_x}{N_T \cdot N_0} H \cdot  H^H) $$
I would like to rewrite the above equation for the case if the signal is precoded and have got :

$$ C = \max  \log_2 \det (I_{N_R} + \frac{E_x}{N_T \cdot N_0} H \cdot V \cdot V^H \cdot H^H) $$

I have simulated it in Matlab and got :

dashed line - with precoder ;   line        - wihout precoder

I see, as SNR increases, the precoder provides a larger improvement in capacity and also decrease the bit error rate (BER).

what conclusions can I make else?


texts:
Another question related to fixed point saturation and rounding. Say using notation S<WL, FW> where S means it is signed number, WL is the full bitwidth, and FW is the fractional bitwidth. So S<16, 15> means a 16-bit signed number that has 15-bit fractional bits.
Normally in a N-tap filter, denote input as S<x_WL,x_FW> and coefficients are S<c_WL,c_FW>. Then each multiplication would be S<x_WL+c_WL, x_FW+c_FW> and the N-tap output y would grow S<x_WL+c_WL, x_FW+c_FW> by log2(N) bits to S<x_WL+c_WL+log2(N), x_FW+c_FW>. Finally y's bitwidth S<x_WL+c_WL+log2(N), x_FW+c_FW> would be saturated and round off to S<y_WL, y_FW> where y_FW = x_FW+c_FW-round_off, and the part to the left of decimal point of y would be y_WL-y_FW.
Beside this routine approach, what other ways to limit internal bit growth, for example, in individual multiplication output S<x_WL+c_WL, x_FW+c_FW> and final output? There were some papers on designing the coefficients so that each multiplication can guarantee only grow 1-bit. But what else can be done?
Thanks


texts: How do you program a completely transparent crossover?

texts:
Or, if that's too broad, what is/are the most popular algorithms?

Background: I have no formal DSP training but much informal tinkering. I am trying to program a crossover for an audio effect. Another audio effect I've used (ReaXComp) has completely transparent crossovers, or so it sounds to my ears. I assumed that crossovers were just two matching filters, a lowpass and highpass filter of some kind, at the same frequency with a Q value of $\sqrt{\frac{1}{2}}$ (that seems to be the "default" Q value). However, when I run an audio signal through a lot of such crossovers it sounds... weird.

Later, I discovered through experimentation that you can put a two-pole low pass filter on a sound, and then subtract the original sound from the output of that and it sounds like a high pass filter, which is exatly what I want: a low and high pass filter that when added together create mathematically the exact same sound. Unfortunately, if you want a steeper filter and apply an identical filter again to get a 4-pole filter (again at a q value of $\sqrt{\frac{1}{2}}$) the resulting high band just starts to sound weird, not like a high pass filter at all. It basically sounds like the original sound with some sort of weird comb filtering. So I finally decided to come here and ask how to do it properly.

Edit:

robert bristow-johnson asks in the comments:

okay, RealXComp is a multiband compressor. so you want to split the audio into subbands for multiband compression and, if none of the individual-band compressors hit their knee, you want it all to add up to the original signal (perhaps with a little delay)? is that it? is that what you're trying to do?

Yes, Robert, that's exactly what I'm trying to do, sorry if that wasn't clear, I'm a bit of a DSP noob


texts: Learning PSK Modulation and Demodulation - Good Text to Read?

texts:
Title sums it up. I am curious to see what you all suggest. I'm a newbie and just need some beginner/intermediate material.

Thanks!


texts: How to Cluster Image Colors Using K Means Clustering in CIE a*b Domain?

texts:
I am working on building detection from aerial images using Image Processing in MATLAB.

I am doing an image segmentation based on the local homogeneity of image. I want to apply K Means Clustering in CIE LAB Color Space with some clusters on the anistropic diffused image for color quantization and generate the image for further processing.
My RGB image is of 877 X 454 dimension.

How do I do that?

Thanks


texts: Is it possible to know the order of the filter, just looking on the pole zero plot?

texts:
is it possible to know the order of the filter, just looking on the pole zero plot.

I know how to get the order of the filter using calculations(highest order), but I want to know is it possible to see that in pole zero plot.

So far my idea is that the higher number of zeros/poles (pairs) is the order, for example if I have 3 poles and 1 zero in a zero ploe plot, than is the filter 3 order.

My knowledge over this is still small, so I am sorry if it is a stupid question.

Thanks


texts:
I need help with analyzing the computed FFT of my signal. I don't wanna bother by going into the details of how my signal is formed so I will just state which frequencies I know my signal has. I know that the fundamental frequencies of my signals are 1,325 Hz and 1,079 Hz.
After computing the FFT of my signal I got the following FFT diagram.

My first observation is that the fundamental frequencies I expect are not identical to the frequencies I calculated. Is that to be expected when doing FFT analysis of any signal? My expected frequencies are mentioned above, the similar frequencies to those are 1.28 ( close to 1,325 Hz) and 1.038 (close to 1,079)

Secondly, I thought that the fundamental frequencies in my signal should have the highest amplitudes from all other peaks. That is the case with the peak at 1.28 Hz but not the case with the peak at 1.038. What could be the reason for that?

Finally, I know that the other peaks represent the rest of the harmonics of my signal but I am not sure how to interpret them exactly? what do they exactly say about my signal?


texts: Generate projection image by OpenGL or Matlab

texts: I want to generate the "projection" image described as bellow. The left picture is the original picture and the right image is what I want. But, I have no idea about how to generate the right image. I know that OpenCV can only generate affine effect, so I know that only OpenGL or Matlab can generate this effect. However, I have no experience about OpenGL combined with Visual C++, so I don't know how to generate the right picture by OpenGL. Besides, according to other webside, I know that function "affine3d" in Matlab can achieve this effect, but my Matlab doesn't provide this function. Is anyone who can help me? Please. Thank you.


texts: Avoiding DC spike while decoding FSK signal

texts:
I am using the Quadrature Demod module in GNU Radio to decode an FSK signal, but the signal is appearing quite noisy. It has two distinct peaks centered around the advertised frequency, but they are close together and only a little above the DC spike at the center.

In my first attempt, I set the baseband frequency of my HackRF SDR to the exact center frequency of transmission with a sample rate of $2\textrm{ MHz}$. I then applied a $30\textrm{ kHz}$ low-pass filter to the signal before doing the quadrature demod on the signal. What I got out was a near quiet signal during idle periods and something resembling digital data during the transmission, but a bit on the noisy side. It was easy to set a trigger and separate out individual packets, but hard to identify the bits. A screen shot of the start of a packet is here:

So I decided to try capturing offset from the center frequency by about $900\textrm{ kHz}$ and multiply the data by a corresponding complex signal to shift it back down to baseband. The signal now is well above the noise floor during transmission, however, my quadrature demod is capturing large amounts of noise during the idle periods. If I stop the capture at just the right moment, I can see what looks like a very clean data signal, but considerably weaker amplitude than the surrounding noise.

How do I get the best of both worlds so I can cleanly detect packets and decode the bits with GNU Radio?

My flow graph from the last test:


texts: Inverse Z transform of a left sided signal

texts: Please help me to find the impulse response $h(n)$ of a Transfer function $H(z) = \dfrac{1+\frac{1}{6}z^{-1}}{1-\frac{1}{4}z^{-1}}$ given $h(n)$ is left sided.


texts:
I was playing with the idea of performing integration on a sound signal, since I've never heard of where it'd be used.

Is it used somewhere?

Here's something:
http://pcfarina.eng.unipr.it/Differentiation-Integration.htm


texts:
I was looking into the fundamental frequency in DFT and I noticed many sources mention that the fundamental frequency is $1/N$, where $N$ is the number of samples. (When doing the DFT, we have $k/N$, so all frequencies end up multiple of $1/N$)
It is also mentioned that the frequency resolution is $Fs/N$, where $Fs$ is the sampling frequency of the discrete signal. However $Fs$ is nowhere to be seen in the DFT. Why is that? I’m sure there’s a simple explanation behind this that correlates $1/N$ to $Fs/N$, but I couldn’t find it anywhere. What confused me is that in the DFT we are calculating amplitude and phase at frequencies multiples of $1/N$, but they end up being multiples of $Fs/N$ in the signal frequency spectrum.


texts: How can I construct a Band-pass filter from a low and a high-pass filter?

texts:
Suppose, I need to construct a Band-pass filter in OpenCV. But, I know, there are no functions in OpenCV for Band-pass filters.

Now, what I need to do is to have a low-pass filter and a high-pass filter and combine them as a series. That is, first, the image would be passed through a low-pass filter and then the output of that low-pass filter would be passed to a high-pass filter.

Am I correct?

Now, what kind of low and high pass filters should I use? Would they be,

Gassian low/high pass filters
Mean low/high pass filters
Median low/high pass filters
Sobel filters
or, anything else...


texts:
I am actually working on a project involving the cross-correlation of two signals. My cross-correlation code is working fine, but I suspect that I should apply a window to my data set in order to avoid spectral leakage.

As I am not AT ALL specialist of signal processing, I have a few questions :

My goal is to precisely track the maximum value of the cross correlation. Which type of window should I chose ?
Applying the window before zero-padding the data set is the good way to do it, right ?
Not really related to signal processing as a theory, but are the Accord Framework windowing functions efficient ?

Thanks a lot !


texts:
How are you supposed to use GNU Radio additive scrambler block? The wiki documentation is very vague on the subject:

Scramble an input stream using a Linear Feedback Shift Register
(LFSR).
This block scrambles up to 8 bits per byte of the input data stream,
starting at the LSB. The scrambler works by XORing the incoming bit
stream by the output of the LFSR. Optionally, after bits have been
processed, the shift register is reset to the value. This allows
processing fixed length vectors of samples.
Alternatively, the LFSR can be reset using a reset tag to scramble
variable length vectors. However, it cannot be reset between bytes.
For details on configuring the LFSR, see gr::digital::lfsr.

In my university SDR lab, there is some data being transmitted and I have to fully demodulate and decode it.
I'm currently stuck at descrambling data. It is known that additive scrambler is used and its polynomial is $1+x^{-14}+x^{-15}$ with initial state is 010111111111111. I've identified sync word in data stream so I know where to start descrambling but I have trouble configuring additive scrambler block.
Could someone with more knowledge explain how to use it and maybe post an example?
For example should I input polynomial $1+x^{-14}+x^{-15}$ as $1100000000000001_2=C001_{16}$ (as GNU Radio Manual and C++ API Reference suggests) or as $1000000000000011{2}=4003_{16}$ (as Daniel Estévez suggests) Same for seed value. Thanks!


texts:
I am solving one of the question from signal processing about calculating the 3dB bandwidth of the filter. But I am stuck once I got the magnitude response of the filter. Can someone help me with this?
Thanks


texts:
I have an audio signal

SampleRate Fs: 44100 Hz

TotalSamples: 94144 samples

Duration t: 2.1348 s

The frequency resolution is given by  Fs/N where FS is the input signal's sampling rate and N is the number of FFT points used.

If I want to have 10Hz frequency resolution (bins of 10Hz), I should use 4410 FFT-points (44100/4410 = 10) but fft(signal,N) function of matlab specifies that N (4410 in my case) should greater than the signal length (94144 in my case). How should I proceed?


texts:
Can you obtain a transfer function in frequency domain with a bode plot form given by this function:
$$ S=k_1 \sqrt{1+\frac{k_2}{f}} $$
I did not managed it because actually in the lowest part of frequencies decreases with 10dB/dec. So is not a simple pole (20dB/dec) and zero function.
Maybe it is possible to obtain such function by adding many low pass filters.
Any idea?


texts:
I have a a channel matrix "H" that is circulant.
I have data blocks.
I want to add the channel effects to the signal.

When H was only a vector of channel coefficients I would say:

%Going Through The Channel
After_channel= filter(H,1,Data);

but now that H is a matrix the line above wouldn't work.

I'm not sure what to do


texts:
Technology: C++, CodeBlocks IDE.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    WavAnalysis wav_analyse;
    static const uint16_t BUFFER_SIZE = 1024;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    fseek(wavFile, 44, SEEK_SET); // skip header data
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        wav_analyse.FFT(buffer); // currently shows data only
    }

Wav file header informations:

1 channel PCM,
8 bits per sample,
sampling rate is 11025Hz.

In next step I'm normalising values to the range of [-1;1) with function:

float WavAnalysis::normaliseValuetoFloat(uint8_t value){
    float normalisedValue = (float)value;
    normalisedValue -= 128;
    normalisedValue /= 128;
    return normalisedValue;
}

My goal is to create my own library for voice activity detection, now I'm working on FFT module. I need this data to calculate signal energy and its entropy in chosen signal parts.

updates:

After reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two).

Question now: FFT changes signal domain from time (real values) to frequency (which contains complex numbers). Why does available sources populates the FFT algorithm with complex array? Ex.: https://stackoverflow.com/questions/10121574/safe-and-fast-fft


texts: increase of encoding rate increases bandwidth?

texts:
I came across this paragraph in an article about signal processing.

Addition of redundant bits for improving the error probability leads to bandwidth expansion of the
transmitted signal by an amount equal to the reciprocal of the code rate.

(page 16)
http://www.ece.rice.edu/~ashu/publications/encylopedia.pdf

I am not sure I understand this. why adding redundancy means increasing the bandwidth? it will just take more time to transmit this signal, no?

Please help me clarify this. thanks.


texts: How to implement a digital sawtooth oscillator?

texts: In reference to this topic: How to implement a digital oscillator?, I would like to know how can I implement a solution similar to the one in the topic on a Sawtooth oscillator.


texts: Scaling factor of Discrete Fourier Transform

texts:
I am going through DFT basics. I found somwhere it  is represented by the equation
$$ x[n] \ \triangleq \  \sum_{k=0}^{N-1} \ X[k] \ e^{j 2 \pi nk/N} $$

$$ X[k] \ = \ \frac{1}{N} \sum_{n=0}^{N-1} \ x[n] \ e^{-j 2 \pi nk/N} $$

While in other literature
$$ x[n] \ \triangleq \frac{1}{N}   \sum_{k=0}^{N-1} \ X[k] \ e^{j 2 \pi nk/N} $$

$$ X[k] \ = \ \sum_{n=0}^{N-1} \ x[n] \ e^{-j 2 \pi nk/N} $$

When is the scaling factor needs to be reversed? Which equation is to be used for 2-d Fourier Transform (Image TransforM - where to include $\frac{1}{MN} $)?


texts:
What I found out:

The order of the multiplier would be $n=5$.

The two LO frequencies can be 90 MHz and 80 MHz.

The bandwidth is given by $BW = 2(B_f+1)W $

Where W is the modulation bandwidth given by 500 Hz.

I am unable to find out $B_f$.


texts: Mathematics in selection of RC time constant for an envelope detector for AM

texts:
Let the capacitor be charged to voltage $ V(t_0) $ at $ t=t_0 $ and then start discharging. At time $ t \, (>t_0)$, the delayed capacitor voltage is $$ v(t)=V(t_0)\operatorname{exp}(- \frac{t-t_0}{RC}). \tag 1$$

The rate of change of $ v(t) $ AT $ t=t_0 $ is
$$\frac{dv}{d(t-t_0)}|_{t=t_0}=-\frac{V(t_0)}{RC}. \tag 2$$

My questions:

When they are saying rate of change of $v(t)$ , why have they
differentiated $ v(t) $ with respect to $ (t-t_0)$, why haven't they differentiated with respect to $t$ and then subtituted $ t $ with $ t_0 $ , which gives the same answer as shown:
\begin{align}
\frac{dv}{dt} &= V(t_0)e^{\frac{t_0}{R_C}}\frac{d}{dt}(e^{-\frac{t}{RC}}) \\
&=V(t_0)e^{\frac{t_0}{RC}}e^{-\frac{t}{RC}}(-\frac{1}{RC}) \\
&= >\frac{dv}{dt}|_{t=t_0}=-\frac{V(t_0)}{RC}
\end{align}
How to differentiate $ v(t)$ w.r.t $ (t-t_0)$. I am particularly confused about this because of the component $ V(t_0) $ of eq $ (1) $. Should I consider it a constant or should I consider it a variable as I am differentiating $ v(t) $ with respect to $ (t-t_0)$. In other words how to perform this differentiation?