texts:
I am currently working on a MUSIC algorithm for DOA of RF emitters in 3D.

At the first stage, interested to apply the 1D MUSIC using a linear array of 4 antennas, and estimate only the azimuth of the target projected on X-Y surface(and not the elevation). The code was written and the relevant simulations performed.

However, there are two issues which require further clarifications.

In the described setup, two solutions will be received, as plotted below:

Wondered what may be the methods to eliminate the second solution, given a static array and a moving target.

Taking into account that the elevation is not being estimated (as opposed to the case of 2D MUSIC), wondered whether the estimation accuracy in azimuth is being effected, or only the 2D projection of the signal has an impact on the estimated azimuth.

Further Elaboration of the second question:

Given the following 3D scenario, and using 1D MUSIC algorithm(with 4 equally spaced antenna array for instance), can it be assumed that the estimated azimuth of arrival will be the projection on XY as can be seen below:

Thank you Envidia – as 360 degrees are to be covered, and mechanical rotating is not being considered, limiting to 90 degrees will not answer the requirements.

Thank you David, following is the presentation of the error in the azimuth, resulting from elevation.

Seems that the error in the estimated angle can be expressed as:
alpha – alpha’ = atan(y0/x0)- atan(sqrt(y0^2+h^2)/x0)

Thank you Stanely, as described in “Left-right ambiguity resolution of a towed array sonar” – page 9, Assuming a non-straight array breaks the undesirable symmetry of the beam pattern.
In order to answer both the ambiguity and the error in Azimuth due to elevation, evaluating the UCA structure.

In addition, considering to use simple interferometry instead of Music, as multiple target separation is not a current requirement of the system.

The desired system must however be relatively compact(4 element UCA) and low cost(single channel proffered).

Update - 18 July:

Taking into account the following origin of the error, when using ULA for 3D DOA:

Wondered what is the expression describing the estimated angle error size as a function of elevation(for a given x and y).


texts:
I'm studying for my finals , and I'm struggling with finding bandwidths.

I have this energy spectral density : Ψ(f)=rect(f) , and I need to find the bandwith, 3 dB band and the band with 90 % power.

About the 90 % case, do I need to find the total energy and then ∫W0Ψ(f)=0.9×TotalEnergy?

If I had a power signal and wanted to find the 3 dB bandwidth, would I need to find the average power and then solve ∫W0Sx(f)=0.5×TotalPower ?

Thanks in advance.


texts: Frequency domain filtering: must filter coefficients always be conjugate symetric?

texts:
While trying to do frequency domain filtering of audio signals using windowed overlap-add methodology, I came across some pre-calculated frequency domain coefficients. I noticed that the coefficients, complex numbers, are not conjugate symetric. Can that be? What does it tell me about the filter?
If the input filter is FIR, described by y(n)=b(1)x(n)+b(2)x(n−1)+⋯+b(nb+1)x(n−nb), then the discrete Fourier transform of this real filter coefficients should be conjugate symetric as for any other real input. Furthermore, after the input signal is transformed to frequency domain, multiplied with the filter coefficients, and transformed back to time domain using inverse DFT, the signal (audio_filtered) should again be real?
A = fft(audio);
H = fft(filter);
Afiltered = A .* H;
audio_filtered = ifft(Afiltered)

If the input filter is IIR, are things different with respect to conjugate symetry?


texts: Help Understanding the Robert Cross Operator

texts:
I have been reading this Wikipedia article:  https://en.wikipedia.org/wiki/Roberts_cross
And it says this:

Now I have also been reading this for the Robert Cross operator (from Feature Extraction and Image Processing 3rd Edition):

I can understand The books explanation (kinda) but not wikipedia.
So in Code I will have something like this:
EdgeValue(at x,y) = Max[(Px+1,y - Px,y+1), (Px,y - Px+1,y+1)]

So from the 2 values I choose the max. And in the new image I just draw that value in x,y. Makes sense.
What I do not get is Wikipedia. Why does it go on finding the gradient?
Also that looks like the Pythagorean Theorem not a gradient equation.


texts: what are and why are sine and cosine modulated integrals used?

texts:
I have found the definition of the following formulas in a paper regarding active vibration control, where they are called sine and cosine modulated integrals.

$y$ is measurement signal with a strong periodic component of frequency $N\Omega$

$$y^{(i)}_{Nc}=\frac{2}{T}\int^{T}_{0}y^{(i)}(ϕ)\cos(Nϕ)dϕ$$

$$y^{(i)}_{Ns}=\frac{2}{T}\int^{T}_{0}y^{(i)}(ϕ)\sin(Nϕ)dϕ$$

where $\phi=\Omega t$.

From these the vector $y_N^{(i)}$ is defined as
$y_N^{(i)} = \begin{bmatrix} y_{Nc}^{(1)}\\ y_{Ns}^{(1)}\\\vdots\end{bmatrix}$

The same is done for the control input(s) $u$.
Then a quadratic cost function to be minimised at each step is defined using these newly introduced signals in this way:

$J(k) = y^T_NQy_N+u^T_NRu_N $ where $Q$ and $R$ are just two weighing matrices.

Are they introduced to consider the sine and cosine components at the considered frequency of the signal?

Can someone explain their meaning and why are they introduced?
Here the link for the paper

Another question: suppose I have the value $y_N$: how can I invert the relationship to get $y^{(i)}$

Here the link for the paper.


texts: What data should be collected to determine the autocorrelation sequence?

texts:
For a current project I need to implement an algorithm that needs the autocorrelation sequence of the channel, as part of a key step.

We're measuring the frequency utilisation in our local area - simply be scanning the spectrum (from 440 MHz to 780MHz) with an SDR and collecting the power at each frequency. The goal of the algorithm is to determine how the spectrum may be split into bands to transmit on.

I want to ask, is this data sufficient for what we need to do or is there anything else we would need to collect?


texts:
I am trying to filter out some square wave signal to within a limited band (1/4 or 1/8 of the original), I realized that there's a lot of ringing in the wave when I use my filter (elliptical), I also tried Butterworth, and others (given in Matlab fir1, and classic iir filters) but the only filter that seems to give no ringing is Gaussian. So my question is, how should I go about designing a LPF with minimal ringing? (preferred characteristics: minimal pass band ripple, stop band of more than -50dB, relatively fast roll off). Also as I am trying to implement this in a DSP, low order filters such as IIR types are preferred.

Thank you for any help.


texts: How Is the Formula for the Wiener Deconvolution Derived?

texts:
Wikipedia - Wiener Deconvolution shows this formula:
$$
\ G(f) = \frac{H^*(f)S(f)}{ |H(f)|^2 S(f) + N(f) }
$$
Could someone explain the derivation?
Specifically, where does the squaring ($|H(f)|^2$) come from?


texts: FIR Filter Design - from slope and cutoff frequency

texts:
I am stuck with the following design requirements for FIR filter:

Low-pass
-6dB @ 1.6kHz
Slope: 24 dB/octave.

Ideally I would like to get also FIR coefficients, but any help how to design this filter using MATLAB, ScopeFIR, ScopeIIR, or any other software/method that you may find useful will be appreciated.

Thank you.


texts: Chi-squared distribution variable spectral analysis

texts:
I an interested in spectral analysis of a random signal.

Assume the signal $n(t)\sim\mathcal{N}(0,\sigma^2)$ is followed by the white Gaussian noise with zero mean and $\sigma^2$ variance.

The test signal is $z(t)=n^2(t)$.

Obviously, $z(t)$ is the Chi-squared distribution with 1 degree of freedom.

The histogram of $z(t)$ with $\sigma^2=1$.

The Normalized FFT spectrum of $z(t)$ is shown following:

The spectrum has an impulse at the zero frequency and a flat platform over the other frequencies. Obviously, the impulse is caused by the DC component in $z(t)$ with $E(z)=\sigma^2$.

My question is: is there any possible mathematical description of $z(t)$?


texts: Positive and negative frequencies: how to prove they are independent?

texts: This seems to be quite a basic question but is there some detailed proof why interference power (i.e., power spectral density) coming from the positive and negative frequencies are independent? I am considering two real baseband OFDM signals which are interfering with each other and where $2N-f=-f$ is relation between positive and negative frequencies while $2N$ is total number of frequencies (tones). Assume that two signals are not sync and that is the source of interference leakage coming from the negative spectrum. To simplify, I want to prove why is the received PSD equal to : $PSD_{rec.,k}=A^2_{pos.,k}+A^2_{neg.,k}$ instead of $PSD_{rec.,k}=A^2_{pos.,k}+2A_{pos.,k}A_{neg.,k}+A^2_{neg.,k}$ where $A^2$ is squared amplitude (i.e.,DFT coefficient) of tone $k$. Could anyone recommend me some literature or give me a short answer on this question?


texts: Getting a more accurate frequency read from autocorrelation and peak-detection algorithm

texts:
For a project I am attempting to create an automatic tuner for a guitar, which reads the audio from the guitar jack, determines the frequency and adjusts the string by a motor.

Using http://www.instructables.com/id/Reliable-Frequency-Detection-Using-DSP-Techniques/ the algorithm is quite accurate.

void setup() {
      sum = 0;
      pd_state = 0;
      int period = 0;
      // Autocorrelation
      for(i=0; i < samples; i++)
      {
        sum_old = sum;
        sum = 0;
        for(k=0; k < samples-i; k++) sum += (values[k])*(values[k+i]);

    // Peak Detect State Machine
    if (pd_state == 2 && (sum-sum_old) <=0)
    {
      period = i;
      pd_state = 3;
    }
    if (pd_state == 1 && (sum > thresh) && (sum-sum_old) > 0) pd_state = 2;
    if (!i) {
      thresh = sum * 0.5;
      pd_state = 1;
    }
  }
  // Frequency identified in Hz
  freq_per = realFreq/period;
  lcd.cls();
  lcd.printf("%f",freq_per);
  }

At the end the frequency is determined by the by dividing the realFreq, which is the precise reading frequency with the period determined by the peak detection portion.

The frequency is quite accurate between 40-200 Hz normally about 0.5 Hz out which is accurate enough for my needs. But above 200 Hz the accuracy falls to 2-3Hz.

Is there a technique to improve the accuracy of this function. The sampling frequency is 4410 and I wanted to reduce this to improve the speed but keep the accuracy as high as possible.

Thank you.


texts: Validity of an argument that two transfer functions are minimum-phase based on their ratio being minimum-phase

texts:
Update I think the essence of my question below is this: If the ratio of two transfer functions may be represented exactly as a minimum-phase filter (MPF) plus a pure delay (in the title, I simply refer to this representation as “minimum-phase” for brevity, even though it’s not accurate), does that imply that each transfer function in the ratio must also be represented exactly as an MPF plus a pure delay?
I was reading a paper where an argument is made in the Appendix regarding the validity of representing a transfer function as a minimum-phase filter (MPF) plus a pure delay.
In particular, the goal is to show that two transfer functions $H_L$ and $H_R$ can each be represented as a minimum-phase filter (MPF) plus a pure delay.
That is, if we have $H_L = |H_L| \text{e}^{\text{i}\phi_L}$ and $H_R = |H_R| \text{e}^{\text{i}\phi_R}$, where $\phi_L$ and $\phi_R$ are their respective phase responses, then given that these are rational transfer functions that can be decomposed into a cascade of minimum-phase and all-pass transfer functions, we must show that $\phi_L = \phi_L^{\text{mp}} + \omega\,t_L$ and $\phi_R = \phi_R^{\text{mp}} + \omega\,t_R$, for some constants $t_L$ and $t_R$ (i.e., the all-pass phase response is purely linear), and where the superscript "mp" stands for minimum-phase.
As I understand it, the argument by the authors of the paper goes as follows:
Give $H_L$ and $H_R$ as above, we have $$\ln \left(\frac{H_R}{H_L}\right) = \underbrace{\left(n_R-n_L\right)}_{\Delta n} + \text{i}\underbrace{\left(\phi_R-\phi_L\right)}_{\Delta \phi},$$
where $n_R = \ln |H_R|$ and $n_L = \ln |H_L|$.
Since, in general, we have $\phi_L = \phi_L^{\text{mp}} + \phi_L^{\text{ap}}$ and $\phi_R = \phi_R^{\text{mp}} + \phi_R^{\text{ap}}$, where the superscripts "mp" and "ap" stand for "minimum-phase" and "all-pass", respectively, this means $\Delta \phi = \Delta \phi^{\text{mp}} + \Delta \phi^{\text{ap}} = \mathcal{H}\left(\Delta n\right) + \Delta \phi^{\text{ap}}$, where $\mathcal{H}$ denotes the Hilbert transform operator.
The authors show that this may be expressed as $\Delta \phi = \mathcal{H}\left(\Delta n\right) + \omega t_0$ for a constant, $t_0$.
Let us assume that this equation (which corresponds to Eq. (A8) in their paper) is valid.
The authors then go on to suggest (incorrectly in my opinion) that since $\Delta \phi^{\text{ap}} = \omega t_0$, $H_L$ and $H_R$ must each always be representable exactly as an MPF plus pure delay (when this is, in fact, not known).
I think this argument is flawed because it assumes that $\Delta \phi^{\text{ap}} = \phi_R^{\text{ap}}-\phi_L^{\text{ap}} = \omega t_0$ implies that $\phi_R^{\text{ap}}$ and $\phi_L^{\text{ap}}$ are also each linear functions of $\omega$ (since only then do $H_L$ and $H_R$ each have MPF plus delay representations).
However, this is not the only possibility correct? I think a function like $\omega t_0$, which is linear in $\omega$ can, in general, be obtained as the difference of two non-linear functions of $\omega$, each corresponding to either $\phi_R^{\text{ap}}$ or $\phi_L^{\text{ap}}$, which would mean that an MPF plus delay representation for $H_L$ and $H_R$ as described earlier is not always necessary, right? For example, if $\phi_R^{\text{ap}} = \alpha \omega^2$ and $\phi_L^{\text{ap}} = \alpha \omega^2 + t_0 \omega$, for some scalar $\alpha$, then $\Delta \phi^{\text{ap}} = \omega t_0$. Am I going wrong somewhere?
Thanks in advance for any inputs!


texts: Relationship between FRF, FFT, AutoPower, & CrossPower

texts:
Given A is an input signal & B is an output signal:
I know that the frequency response function (FRF) is defined as the CrossPower of AxB divided by the AutoPower AxA.
Logic tells me I should be able to get the same results using FFT of both signals by taking FFT(B)/FFT(A).
When I do this and compare results between using cross(A,B)/auto(A) and FFT(B)/FFT(A), I get NEARLY the same FRF result... magnitude is the same but the phase is inverted. (i.e. The real parts of both calculations are identical, but the imaginary parts are opposite.)
Any thoughts on why?


texts:
From GNU Radio documentation, the control_loop block proposes loop bandwidth values in the range $[\frac{2\pi}{200}, \frac{2\pi}{100}]$ in radians per sample.

Some blocks, like the new timing symbol sync block recommends a value around $2\pi\cdot 0.040$. Given sample rate $R_{sample}$ and symbol rate $R_{symbol}$, the symbol rate can be expressed in radians per sample as

$$2\pi\frac{ R_{symbol}}{R_{sample}} = \frac{2\pi}{N}$$

where $N$ is the oversampling ratio is samples per symbol. From literature, the loop bandwidth around a few percentages of the symbol rate (say 3% for example) is recommended.

I have a problem in relating the recommended control_loop values to the values suggested in the literature. Suppose for example the signal is oversampled by a factor of $N = 100$ samples per symbol.

A loop bandwidth value of say $\frac{2\pi}{100}$ will be equivalent to 100% of the symbol rate, which doesn't seem to be logical. The same loop bandwidth will be equivalent to 3% for an oversampling factor of $N = 3$.

I think that the ratio between the loop bandwidth and the  symbol rate depends on $N$. For example, in the figure below, I don't think a loop bandwidth of $\frac{2\pi}{100}$ would mean the same thing to the FLL and the PFB ($N = 4\,\text{sps}$) as it will to the Costas loop ($N = 1\,\text{sps}$).

Why don't the recommended values in control_loop take N into account?
How can the loop bandwidth in GNU Radio synchronization be configured
as a percentage of the symbol rate?


texts: Unit step function present in convolution result

texts:
We are currently learning about convolution in my signals and systems class, and one of our textbook problems is to compute the convolution of $x(t) = e^{-\alpha t} u(t)$ and $y(t) = e^{-\beta t} u(t)$. After working out the integral, I obtained the following result

$$
x(t) * h(t) = \frac{e^{-\alpha t} - e^{-\beta t}}{\beta - \alpha}.
$$

The solutions manual for my textbook has the same answer, except their result is multiplied by $u(t)$. I am unsure of where this is coming from, since I know that I computed the integral correctly. I used the unit step functions to simplify the bounds on the integral, so I do not see how they are still around in the final answer.

Can anyone explain what is going on here?


texts: DSP Hardware recommendation or is it even needed?

texts:
I'm new in embedded programming. Trying to choose a dsp, they seem very feature rich for my planned usage.

I want to analyze 18 signals (simultaneously or near simultaneously) real time.
I want to do FFT analysis to determine every signal's fundamental frequency, phase and amplitude.
Send that data for processing to another micro controller to trigger other stuff etc.

So the core functionality i need is, enough i/o and adc's, just enough precision to deal with this task and FFT analysis.

Or all this can be done with a micro controller which is not dedicated to signal processing?

Maybe you can point me to the right direction?

Thank you.


texts: Seperation of wideband and narrowband - Adaptive Filter

texts:
I have the following diagram for the adaptive seperation of a narrowband and wideband signal using LMS algorithim,

The way it was explained to us was that "The narrowband signal is correlatied over significant time whereas the broadband signal is not correlated over significant time" and in the delayed line, the ADF can only predict the narrowband.

That doesn't make much sense to me. Why is the narrowband correlated over significant time and the broadband isn't and also what's the point of the delay in this?


texts: Meaning and unit of frequency in Laplace (Fourier) transform

texts:
Imagine transfer function obtained by Laplace transform, for example:

$G(s) = \dfrac{1}{s+1}$

Now, I would like to do some frequency analysis, so I replace the $s$ with $\omega i$ (let's consider this operation valid for this example).

What is the unit of the $\omega$? So far what I have seen, the $\omega$ is noted as frequency or angular velocity. I asked my colleagues and I got various answers:

rad/sec
Hz
no unit

What is correct and why? Does it depend on real variable passed to transform (if somebody uses different variable than time)?


texts: I'm trying to compute the the interference that one OFDM user with beamforming causes to another user. The two systems are fully overlapped in frequency and time. I know how to generate an OFDM signal in MATLAB and compute its BER in AWGN and fading channels, I just don't know how to implement beamforming. The beamform is a circular sinc, I believe I need multiply my signal with the gain of the main lobe of the sinc function. I don't know how to calculate the interference caused on the other user. I'm not asking for anyone to provide me with a code, I'm just hoping that someone here can provide some directions on how to approach this or if there are any other resources that I can check.


texts:
I am using a wavelet transform and am testing the following approach to thresholding:

  All coeffients (whatever their value) after the first N are set to 0

So if my timeseries window is 128 elements, I will zero all after the first 8 (N).

This seems to smooth nicely but is NOT proper Hard Thresholding.

Any thoughts on this?


texts: Effect of different downsampling rate on EEG signal

texts: I have a raw EEG signal of length 2,50,000 samples. I band passed it from 0.05-10Hz (sampling frequency=500). Then I down sampled it at 20Hz. Now question is: What will be effect if I vary down sampling from 20Hz to say 5Hz or 60Hz? And why 20Hz is appropriate?


texts:
How would I take a song input and output the same song without certain frequency ranges?

Based on my research so far, the song should be broken down into chucks, FFT it, reduce the target frequency ranges, iFFT it, and stitch the chunks back together. However, I am unsure if this is the right approach to take, and if so, how I would convert from the audio to FFT input (what seems to be a vector matrix), how to reduce the target frequency ranges, and how to convert back from the FFT output to audio, and how to restitch.

So far, I've understood the basic premise of fft (through basic 3blue1brown yt videos and the like) and that it is available through scipy/numpi, and figured out how to convert from youtube to 0.25 second chunks in a wav format. I've tried googling the problem, but while many people say it's trivial, I cannot find an explanation with psudocode or actual code.

For background, my grandpa loves music. However, recently he cannot listen to it, as he has become hypersensitive to certain frequency ranges within songs. I'm a high school student who has some background coding, and am just getting into algorithmic work and thus have very little experience using these algorithms. Please excuse me if these are basic questions; any pointers would be helpful.


texts: How to design an all pass type filter with inverted phase response?

texts:
I want to model a "negative dispersion" in waveguides.

Is it possible to design an all pass filter with inverted phase response? (e.g. -pi at 0 and pi at Nyquist)?

I feel :) this could be possible in complex domain (but don't know how). I could use a Hilbert transformer to complexity real signal at first.


texts: why does the additive synthesis method for a triangle wave require amplitude scaling by 8/pi^2?

texts:
I had to make a bunch of band limited digital triangle waves recently, so I went to (where else) wikipedia for the equations.
I noticed that there is a constant amplitude scalar of 8/pi^2 (~.8106). And indeed this does bring the amplitude range down to about +/-1. The wikipedia article (https://en.wikipedia.org/wiki/Triangle_wave#Harmonics) doesn't explain the theoretical reasoning for this but I would like to know why this is so.


texts:
In an lab class experiment who's subject of interest was Johnson's noise I measured the ac voltage of a battery. Now I wish to find the psd of the measurement and show that it is constant.

1.Is such a thing even possible with 255 ac measurements in a $0.043s$ spacing?

How can it be done without a direct measurement of the voltage?


texts: Estimating onset time of a tone burst in noise?

texts:
What techniques might one use to estimate the onset time of a sinusoidal tone burst in a noisy signal?

Assume the tone burst has a known fixed frequency (but unknown phase) and a very sharp rise time, and that the goal is to estimate the onset time within better than half the rise time, and/or one period of the frequency of the tone, if possible.  How might the estimation techniques change if the S/N ratio is very low (much less than 1)?

Added: Assume the tone burst is of unknown length, but longer than a small multiple of the rise time and the frequency period.

Added: A DFT/FFT shows the very probable existence of a tone.  The problem is figuring out exactly precisely where in the FFT window the tone (or perhaps multiple tone bursts of the same frequency) may have started within the FFT window, or determining if the current tone started outside that DFT window, provided I have all that additional time domain data.

Radar pulse detection accuracy is closer to the resolution I need, except I only have an edge, as the tone is of unknown length, and, other than a known rise time, unmodulated.  Narrow band pass filters distort the rise time, and thus kill edge arrival estimation resolution.


texts: What is the impulse response used in an interpolation filter when upsampling?

texts:
I need to downsample a single period waveform from $M$ samples to $L$ samples. If that matters, in my particular case, $L=M-1$.

I read about downsampling and came to the conclusion I need:

expand the original waveform by a factor $L$ (some other source call the step “zero stuffing”),
interpolate the missing samples,
decimate by a factor of $M$:

If I understood it correctly, expansion only requires adding $L-1$ zeros between each original sample. Decimation seems simple too since it only requires keeping every $M^{th}$ samples.

But I'm stuck with the interpolation process. The naive solution of using linear interpolation gave me surprisingly good results at low frequencies but quickly degraded when the frequency increases (i.e., .when the number of samples in the waveform decrease).

I found several mentions of using an interpolation filter that looks like a dot product1. For example, on the Upsampling Wikipedia page, I see:

  $$y[j+nL] = \sum_{k=0}^K x[n-k]\cdot h[j+kL],\ \ j = 0,1,\ldots,L-1,$$

  where the h[•] sequence is the impulse response, and K is the largest value of k for which h[j + kL] is non-zero

In my understanding, $x[•]$ is the sequence after the expansion step. $y[•]$ is the upsampled waveform. But I don't understand what are $h[•]$ and $K$.  I read they are related to the impulse response and I understand the concept. But I can't see where it comes from and how to obtain it in practice.

Could someone explain to me how to obtain $h[•]$ and $K$?

1It also looks like a convolution to me, but I'm not quite sure of that. And apparently this would be an instance of FIR filter. We already talked about that in other questions, but this is still not clear to me.


texts: How to apply dictionary learning to several images?

texts:
I'm implementing a dictionary learning algorithm for doing sparse coding on images and I have a problem how to learn a dictionary corresponding to several iamges.

Let’s say X is the data matrix. If I apply dictionary learning only to one image then X is equal to the image. But what if I want to learn the dictionary for several images ? Should I in this case just put all images into X, i.e. X = [image1, image2, image3…]?

Another approach I thought of was to learn a dictionary for each image separately and then decide online which dictionary to use (by e.g. comparing histograms or some similarity measures to decide to which training image the new input image is most similar to and then choosing the corresponding dictionary).

What appraoch should I use?


texts: What does imaginary Component of a bin's phase in the Fourier Transform mean?

texts:
I have been recently working with the FFT and realized that each frequency within a bin corresponds to a phase. This concept I have no problem with because if you wanted to construct the summation of sinusoidal waves back into the original signal, you would need the phases of those sinusoidal waves.

My Questions:

Why must there be an imaginary component to each of the bins corresponding phases? It makes no sense to me why a phase would need an imaginary component.
In reference to DSP with the FFT, how does this imagery component come into play when characterizing a signal?


texts: Get bit stream from known radio frequency

texts:
I'm a beginner in radio demodulation, and several days can't solve my problem. The problem is to get bit stream from known frequency.
I made I C# application that gets the data in real time from FunCube dongle and applies FFT. But what to do next - it is a puzzle for me.
The final goal is to detect narrow-band signal on a known frequency and get the bit stream from it.
I've already read different books on DSP but I'm at an impasse.
So, the question is what to read, where to go, maybe any algorithms.


texts: What Is the Relation Between Deblurring and Deconvolution in Computer Vision and Image Processing?

texts:
The deblurring problem can be modelled as follows

$$
f = \phi u + \epsilon, \; \epsilon \sim N(0, \sigma)
$$

where $\phi$ is a filter (e.g. a low-pass filter) and $\epsilon$ is a Gaussian noise.

In computer vision, what is the relation between deblurring and deconvolution?


texts: BIBO stability of $y(t)=\int_{-\infty}^{t}{x(\tau)d\tau}$

texts:
How can I prove that the LTI system with (output $y(t)$, input $x(t)$)

$$y(t)=\int_{-\infty}^{t}{x(\tau)d\tau}$$

is BIBO (bounded-input/bounded output) stable?


texts: How to Downsample The Chrominance Components

texts:
So I am doing an image compression project for college and am trying to create a visual demonstration of how downsampling chrominance components can reduce the amount of digital information while being hardly noticeable to the average person. While doing research for this project, I came across this video where the guy gives a demonstration of downsampling that leads to there being 100x less color in the image he uses as an example. I was hoping to do something similar but am unsure as to how he was able to downsample the chrominance components in an image by a factor of 10x in each direction.

Looking at the standard ratios for chroma subsampling(/downsampling) the best I could find seems to be 4:2:0 which would downsample the chrominance by a factor of 2x in each direction. It's possible that might be enough for a demonstration, but I was hoping I might could push it a little further.

As a side question, does anyone have any recommendations as to how best to apply the downsampling color to my raw image? I have some ideas involving either photoshop or GIMP, but I was wondering if anybody had a better suggestion.


texts:
I have few questions I tried to solve regarding nyquist theorem, and I would like to see your opinion if I'm doing it correctly?(one I know the answer second one not sure).

1.Let $f(x)$ and $g(x)$ be functions with max frequencys $B_1$ and $B_2$, what is the max sampling distance allowed according to nyquist to the function $h(x)=f(x)g(x)$.

My answer: according to the convolution theorem $H(x)=F(x)*G(x)$(* for convolution), so $H(x)=\int_{-B_1}^{B_1}F(u)G(x-u)du$ so $u \leq B_1$ now we knowthat $x-u \leq B_2$ so we get $x\leq B_2+B_1$ and this $x$ is our max frequency, now I can say that our sample rate is $f_s\geq 2(B_1+B_2)$ so our sample max distance denote $T_s$ is $T_s \leq \frac{1}{2(B_1+B_2)}$
is that correct?

2.lets mark function $f(x,y)=sinx*cosy$ what is the max sampling rate?

to be honest here I'm really not sure, I think its zero by intuition but not really sure if I'm correct and if so why?

Please note: those are the notation I saw when I found those questions, thanks


texts: How to send / receive a short impulse in an extremely noisy signal with high timing accuracy?

texts:
I am pretty new to DSP. I need a computer to transmit data to a receiver through audio signals in a loud outdoor environment. (I am writing the software for both sender and receiver so I can design the signal however I want.) I am using cheap speakers and microphones operating at 44.1Khz.

I would like for the sender to emit a signal that can be recognized by the receiver with extremely high accuracy on the time domain. This signal does not need to contain any information, the receiver just needs to be able to figure out exactly when the signal started, ideally down to the exact sample.

My first idea was for the sender to emit a 2kHz wave for 250ms. The receiver would continuously perform FFT to identify that wave, and when present, it would look at the FFT history to figure out the sample at which the wave had started. However this approach feels clunky because of the number of samples needed to satisfy the FFT. I could never achieve 1-sample accuracy without doing an FFT for each sample, and I don't think it would even give me good results.

I have been learning about PSK for unrelated reasons, and I am getting the impression that there are lots of ways to detect properties of waves – without the FFT. So my question is – what methods could I use to identify an instantaneous change in my input signal, in an extremely noisy environment?


texts:
I have couple of questions?

Is there a relationship between a FIR filter being minimum phase/mixed phase and being causal?
Is there a relationship between a FIR filter being minimum phase/mixed phase and its group delay. I understand that a symmetric/non symmetric filter has a constant phase and fixed group delay. But, what if filter is FIR and non-symmetric?Doe symmetry affect the min/max/mixed phase ?


texts: What is the Fourier transform of $\delta(t-a)$

texts: As I know the Fourier transform of $\delta(t)$ is equal to $1$, on the other hand, shift with $a$ in time domain is equal to multiplying with $e^{-jaw}$ so the Fourier transform of $\delta(t-a)$ is equal to $e^{-jaw}$, but on the other hand the Fourier transform of Dirac comb ($\sum_{n=-\infty}^{+\infty}\delta(t-nT)$which is equal to sum of Dirac functions) is also another Dirac comb, This doesn't make sense to me. The Fourier transform of Dirac comb should be sum of the $e^{-jnTw}$.


texts: Transferring audio through arduino. Formation of a parcel

texts:
I'm new here. I want to try streaming audio using arduino.
I have:

arduino
Radio module nrf24l01
Computer
Matlab program, arduinoIDE

I want to use a computer microphone, step by step ADC of the computer. But here's how to learn how to form sendings from this signal so that it can be sent through the arduino to the radio module, and then restored again on another computer?
Is there a tutorial video or theory? I would be very grateful, thank you!


texts:
if we have a discrete random process
\begin{equation}
x\left(n\right)\:=\:0.2x\left(n-1\right)+w\left(n\right)+w\left(n-1\right)
\end{equation}
where $ w\left(n\right)$ is a noise with a mean
$
m_w=0.5$ and variance $\sigma ^2_w\:=\:1$.
I  am trying to find the value of $E\left\{x^2\left(n\right)\right\}$.
Here's my work below:
\begin{equation}
E\left\{x^2\left(n\right)\right\} = E\bigg\{\big[0.2x\left(n-1\right)+w\left(n\right)+w\left(n-1\right)\big]^2\bigg\}
\end{equation}
for
$$E\big\{w\left(n-i\right)^2\big\}=\sigma _w^2+m_w^2=1+0.5\:=\:1.5.$$
After that, I get the following
\begin{align}
E\left\{x^2\left(n\right)\right\} =&\phantom{+} 0.04 E\left\{x^2\left(n-1\right)\right\}\\
&+0.4E\left\{w\left(n\right)x\left(n-1\right)\right\}\\
&+0.4E\left\{w\left(n-1\right)x\left(n-1\right)\right\}\\
&+E\left\{w^2\left(n\right)\right\}\\
&+2E\left\{w\left(n\right)w\left(n-1\right)\right\}\\
&+E\left\{w^2\left(n-1\right)\right\}
\end{align}
Am not sure what to do from here? Please help.


texts: How to apply FT to real-life signal that labeled in seconds, not radians

texts:
In training examples we always do a transformation on signals which have t-scale in labeled in radians.
I understand that Pi is just a number, but I still have some troubles to understanding how to relate real-life continuous signal with t-labeled in seconds.

In my head when we have real-life signal (Amplitude on time) we have full information about that signal and can determine all of it frequency components. And I know how to do it converting this signal to discrete time, but how to do it with continuous time FT?

So my question is:

could you please explain to me, ho to apply fourier transform and get frequency compnonents out of continuous signal which lengthis for example 3 seconds or something and it's aperiodic.


texts: Digital delay effect: avoiding clicks on delay time change

texts:
I'm implementing a digital audio delay effect using a simple circular delay line. Changing the delay time by making the delay line longer or shorter introduces discontinuities in the audio signal, resulting in clicks.

What would be the best (most pleasing for the ears) strategy to avoid such clicks when changing delay time?


texts: Which algorithm could be used to compare two waveforms from an oscilloscope in XY mode?

texts:
I would like to receive some hint as to which algorithm could be used to compare two waveforms from an oscilloscope in XY mode, as shown in the image:

Note that the image shows a percentage difference (displayed in red) between the two curves (one yellow, one blue).
It is this percentage value that I would like to obtain.
I understand that the curves are produced point to point (x, y) and then a sequence of position data (x, y) is generated:

I believe that the algorithm would have to compare two data arrays.
Does anyone have any idea how to do this?
Thank you.
Edit: Following the formula of the video (Normalized Correlation), I believe that the result of comparison is interesting, my next step is to try to do it with a microcontroller to find out if it will have resources.
Note: After calculating the correlation for each axis, I multiplied the result of the axes and inverted the result, to show the difference. If this is not correct, please comment on any suggestions.

Ref.:

Normalized cross-correlation is also the comparison of two time
series, but using a different scoring result. Instead of simple
cross-correlation, it can compare metrics with different value ranges.

Source: https://anomaly.io/understand-auto-cross-correlation-normalized-shift/index.html
Edit (03/14/2021):
In addition, the measurement is performed with a dedicated microcontroller and synchronized with the frequency of the sine wave, that is, the number of readings is fixed.
The basic circuit:

The name “Octopus” maybe doesn’t say anything alone but if you google
it along the words “curve tracer” you will obtain thousands of
result.In few words an “Octopus” curve tracer is a small circuit that
used in conjunction with a scope allows to display  the voltage across
a component under test on horizontal (X) axis versus the current
through that component on the vertical (Y) axis.A scope set to X-Y
mode is required (most of them have this feature).

This   circuit will produce a “signature” waveform on the oscilloscope
to aid in the testing and analysis of shorts, opens, and leakage in
just about any electronic component including resistors, capacitors,
inductors, diodes,transistors and digital ICs too.Each component has a
characteristic waveform (called “Lissajous” pattern), some examples:

Source: https://www.jammarcade.net/simple-component-tester-a-k-a-octopus-curve-tracer/


texts: Methods to evaluate the quality of an IIR Filter fixed-point implementation

texts:
I'm implementing a scattered look-ahead IIR filter in Matlab/VHDL, basically I convert an order-2 IIR filter into an order-4 IIR in order to take advantage of the pipelining of an FPGA. (reference http://people.ece.umn.edu/users/parhi/SLIDES/chap10.pdf)

Anyway, I'm trying to evaluate how many bits I need in every stage and I was wondering if there is a metric to evaluate the "quality" of the quantization.

For example an error of 0.1% in the transient of a step response doesn't matter much but a a neverending limit cycle of 0.1% after the transient would be a problem.

I was thinking of using a metric like m = error^2 * n

where error is the difference between the reference double implementation and my fixed-point implementation and "n" is the sample number so an error at sample 100 would weigh more than error at sample 1.

I would need to balance quantization errors with FPGA resources and FPGA speed of course.

Are there other metrics? Am I on the right track?


texts: Which equation for analyzing mixed mode sparameters?

texts:
I am reading about converting single ended sparameters to mixed mode here.
"As shown by Equation 43, single-ended S-parameters can be converted into mixed-mode S-parameters with the [M]-matrix (Bockelman & Eisenstadt, 1995). Note that the conversion method assumes that Zoo = Zoe = Z0. This assumption is only true if the coupling between the differential signals does not exist."
The Smm=MSseM^-1 equation (pg10, eq 43) is one I'm seeing elsewhere online and no one else has mentioned this caveat. What confuses me about this is, when designing a differential pair, don't you want the maximum amount of coupling? So converting to mixed mode in this way just some kind of quick check/rule of thumb thing? Should I always be using equation 48?


texts:
I am trying to calculate the signal to noise ratio of this signal. I'm aware that the SNR calculation should be
$$SNR_{db} = 10\log_{10}\frac{P_s}{P_n}$$
For the noise signal $w[n]$ I'm using the formula $P_n = \frac{1}{N}\sum_{n=0}^N \big\lvert w[n]\big\rvert^2$ and the same for $P_s$.
My problem is that there seems to be a DC offset in the amplitude of my signal

There doesn't seem to be any actual noise here before the signal it just sits at an offset above zero. My signal is stored as quadrature samples and I don't know the proper way to get rid of the offset so I can calculate SNR properly.


texts: Applying duality property to fourier transform of unit step function

texts:
For Continuous time aperiodic signals, the duality property of Continuous Time Fourier Transform (CTFT) is following

$$\mathscr{F}\Big\{x(t)\Big\} = X(f), \qquad\text{then} \quad \mathscr{F}\Big\{X(t)\Big\} = x(-f)$$

Now we know while Dirichlet conditions are not satisfied for unit step function $u(t)$, so its CTFT analysis and synthesis cannot be done. However, we can still do it provided we are willing to accept occurrence of singularity functions like Dirac delta impulse in its Fourier transform equation.

i.e.

$$\begin{align}
\mathscr{F}\Big\{u(t)\Big\} &= \mathscr{F}\Big\{\tfrac{1}{2} + \tfrac{1}{2}\operatorname{sgn}(t) \Big\} \\
 &= \frac{\delta(f)}{2} + \frac{1}{j2\pi f} \\
\end{align}$$

where the signum function,

$$\operatorname{sgn}(t) \triangleq \begin{cases}
-1 \qquad & t<0 \\
0 \qquad & t=0 \\
+1 \qquad & t>0 \\
\end{cases}$$

However if I apply duality property to the above result, then I should get following:

$$\begin{align}
\mathscr{F}\Big\{\frac{\delta(t)}{2} + \frac{1}{j2\pi t}\Big\} &= u(-f) \\
 &= \tfrac{1}{2} + \tfrac{1}{2}\operatorname{sgn}(-f) \\
 &= \tfrac{1}{2} - \tfrac{1}{2}\operatorname{sgn}(f) \\
\end{align}$$

However when I read at least some books on Fourier transform, I find that result is $u(f)$ and not $u(-f)$. Question is why ?


texts: Change FFT frequency domain values range

texts:
So, I`m currently working on program for computing spectrogram in real-time, using signal from a microphone. And now I want to add "scaling" feature, that allows to look at the spectrum more closely without losing frequency resolution (example was created using simple DFT) :

This feature could be easily done using DFT algorithm ($DFT(freq) = \sum_{n = 0}^{N - 1}samples(n)*e^{-i*\frac{2\pi n}{N} * freq * scalingFactor}$), which also takes a lot of time to compute.
And, to increase performance of the program I`m using FFT algorithm. So the question is : How to implement the same feature in the FFT without severe loss of performance? Increasing number of samples for computing transform ($N$) doesn't help, because it decreases time domain resolution. I've also considered using the trick from DFT example : $FFT(freq) = fft_{even}(freq) + e^{-i*\frac{2\pi}{N}*freq*scalingFactor}*fft_{odd}(freq)$, what also didn't help.
Edit: answers to the question at FFT for a specific frequency range. actually provide methods to change FFT frequency domain values range, but (if I'm not mistaken) they require to compute Fourier transform two or more times (FFT and IFFT for applying filters) what increases computing time. So is there better way to  solve this problem?


texts:
The "problem" is that I want to validate if my received RF packet is valid or not valid, in other words I want to validate if my RF packet corrupted or not corrupted .
the transmitter that Im using is micro controller launchpad called c1350 , so through the datasheets for the CC13xx I discovered ( in page 5, section 4) that it uses CRC32 (page 704, section 8.2.3.8). So, the implementation of crc that my transmitter cc13xx useis CRC32.... my question is:
I've the recieved packet and I know its CRC in terms of binary bits, so now how can I check by CRC if my recived packet is valid or not? my packet before transmitting "before getting to the air" wasn't having CRC .. and once transmitted "on the air" it has CRC (received packet has CRC).
what approach/algorithm should I do/implement in order to check if my received packet corrupted or not?
CRC implementation is CRC32 .
by datasheet cc13xx: enter link description here we discover at (page 5, section 4)
It uses CRC32: enter link description here (page 704, section 8.2.3.8).


texts: what is the relationship between the reliability of a monte carlo test and the length of the samples tested and the number of errors found?

texts:
Considering this setup, single tone transmission over a channel impaired by AWGN, doppler spread, and inter symbols interference.
We are to compute the BER as a function of the SNR.
We want to find the number of samples that need to be tested and the number of errors that need to be found.
What number of samples/errors need to be simulated to observe a bit-error rate values ($10^{-3}$ for instance) that have 90% confidence level of being within a factor of two of the actual values?


texts: How would I go about designing a difference equation for a given type of filter?

texts:
I have experience using design tools such as Xilinx's CoreGen and MatLab's DSP tool kit, but I have not really had much experience designing filters from the ground up. Reinventing the filter as it were.  I prefer to use FIR filters because they are easier to implement and take less fabric.

I know that the filter command from MatLab implements a difference equation and give the filtered results based from the inputs given, but how does it calculate this difference equation?

How would I go about designing say, a high pass filter when I know the frequency I want to cutoff at, and the frequency I am sampling at?

I get a good majority of it, but I am still learning, so my question is :

How do I design a high pass filter with a difference equation so that I could implement it in something like C, and could I do this in the time domain, or would it have to be frequency domain only?


texts: Evaluating the inverse $\mathcal Z$-transform on the unit circle

texts:
I am trying to understand the math.  The inverse $\mathcal Z$-transform is given by:

$$x[n] = \displaystyle\frac{1}{j2\pi} \int_cX(z)z^{n-1}dz$$

where $\displaystyle \int_c$ is a contour integral. The inverse Fourier transform is given by:

$$x[n] = \displaystyle\frac{1}{2\pi}\int_{-\pi}^\pi X(e^{j\omega})e^{j\omega n}d\omega$$

My textbook claims, and I agree, that evaluating the inverse z-transform at $z=e^{j\omega}$ will result in the inverse Fourier transform.  However, I can't get the math to show this. Substituting $z=e^{j\omega}$, I get as far as:

$$x[n] = \displaystyle \frac{1}{j2\pi}\int_cX(e^{j\omega})e^{j\omega n}e^{-j\omega}d(e^{j\omega})$$

Can somebody tell me intuitively how to simplify this equation to look like the inverse Fourier transform? Is my confusion due to a lack of understanding of the contour integral?


texts: How to calculate the entropy of random normally distributed samples?

texts:
I have a hardware device that outputs a normal distribution of readings. It's (fitted) parameters are mean = 35 units, std.dev. = 8 units and I read the values as 8 bit integers.

I'm trying to determine a theoretical rate of entropy generation per reading, so for example 3.4 bits /reading or the like. Is there some formula I can make use of?

PS.  As entropy is actually generated by the observer rather than by the process itself, I'm particularly interested in the significance of the bit depth of the individual readings. I.E. what happens to the entropy rate as I alter the sample depth? I feel that I need to elucidate this point with a (facile) example...

Imagine measuring men's foot sizes, and you're using whole inches.  They would therefore range from 1 inch to 12 inches. That's 12 values and thus contain 3.6 bits of entropy /sample if feet were uniformly distributed in size. Now if you  change to a metric rule ranging from 1mm to 305mm, you'll be acquiring entropy at the rate of 8.3 bits /sample. This demonstrates that whilst God determines the size of men's feet, the entropy generated from measuring them is actually determined by the type of rule (or analogue to digital converter sample depth).

This would all be very simple if my actual case was uniformly distributed, but unfortunately it's a normal distribution.


texts: FFT implementation with decimation in frequency vs decimation in time?

texts:
When using FFT implementations which would be the advantages of using decimation in time (DIT) vs decimation in frequency(DIF) and vise-versa?

I have read here that in practice there is not much difference between DIT and DIF FFTs, but the hardware of some DSPs (Digital Signal Processors) is optimized for certain FFT variants. I would like to have more information about this if possible.


texts: Calculating Delta MFCC, correct formula?

texts:
I have seen different formulations of how to calculate delta MFCCs.  In general, I want to be consistent in such a way that if I have other features to look at other than MFCCs, the way I would calculate their deltas would be the same.

According to this link, HTK supported different ways of looking at how to calculate MFCCs.  One was using a regression formula.  Another is just doing a simple first order difference.  Another listed on that page is doing a modified kind of simple difference.  Another link also showcases the regression formula.

Which one of these is the best way to go?
In what situations might one outperform the other?  I can see that doing first order differences can be easily done in code and doesn't require end frame replication, but many sources I've been reading for MFCCs at least do not use the first order difference.
For other types of delta features that arent MFCCs, is that also the case?


texts:
Are there any algorithms that attempt to perform the inverse of color quantization on an image? In other words, is there a smart way to increase the bit depth of image?

The obvious answer would be to simply stretch the values of all pixels to fit the new range; however, that would leave gaps in the histogram, and the resulting image would still have the same number of different values. Are there any algorithms that, for example, take neighboring pixels into consideration in order to determine a better estimation for each pixel?


texts:
My question is related to the quantization error and the functionality of SAR-ADCs. In general, the quantization error of an ADC is defined as +-0.5LSB. If this concept is correct a voltage that equals 1.75LSB, would produce 2LSB at the output of the ADC and a voltage that equals 1.25LSB would produce 1LSB at the output of the ADC. Based on the linked example transformation curve we got U_LSB = 1V/(2^3bit) = 0,125V, so an input voltage of 0,21875V (1.75LSB) would produce an output voltage of 0,250V and an input voltage of 0,15625V would produce an output voltage of 0,125V. So far so good. Let’s jump to the basic concept of an SAR-ADC.

An input voltage Vin is sampled by a sample-and-hold block. This sampled voltage is then compared by a comparator with a known voltage. This known voltage V_DAC is provided by the DAC that is supplied by a reference voltage Vref. The digital input for the DAC is generated by a SAR register as a digital word. This digital word depends on the result from the comparator. Initially the SAR begins with setting the MSB. After that the output voltage V_DAC of the ADC is compared with the input voltage Vin. If Vin is greater than V_DAC the MSB stays set. If Vin is less than V_DAC the MSB will be set to zero again. In the next step the SAR register sets the following bit and the comparison process of V_DAC and Vin goes on, until the LSB is reached.
My problem lies in this strict comparison process, which will never allow the output voltage of the ADC to be higher than the input voltage Vin. When I take the example from the first paragraph a SAR-ADC would give me 0,125V (1LSB) as an output voltage, as long as I don’t exceed 0,250V (2LSB). So an input voltage of 1.25LSB and 1.75LSB would both provide 1LSB output. This would mean the concept of +-0.5LSB quantization error wouldn’t be correct for SAR-ADCs and the ideal transformation steps would be shifted to the right for like 0.5ULSB (see diagram with red curve). The new quantization error would be max. -1LSB.

Is this thinking process correct or am I missing something? I can’t imagine that the general concept of quantization error does not match with the architecture of SAR-ADCs…


texts: How to Estimated the Noise Standard Deviation (STD - $ \sigma $) as a Function of Brightness from an Image?

texts:
Hi I don't know where to start from.

I'm trying to implement a plot of noise with MATLAB.

I have found a plot of noise standard deviation sigma vs. brightness from a  images in the blog post - Profiling Sensor and Photon Noise.

But I think I need to some reference to implement profiling as above.

I also encountered the following reference - Noise Estimation from a Single Image.

How to make a plot of noise standard deviation sigma vs. brightness from a images?


texts:
Consider the following system:

What is the variance of $y$, $\mathbb{E}(y^2)$  ?

(EDIT: I know input signal has infinite power but will be made bandlimited by $H$. Both $H$ and $G$ are simple rational filters with lowpass characteristics. Feel free to use discrete-time versions if it's easier)

If $H(s)=G(s)=1$, it is trivially $\mathbb{E}((x^3)^2)=15\sigma^6$.

If only $G(s)=1$, I can pretend that $z$ is still white with a variance decreased by $H(s)$ and apply the formla from before. This is mathematically not sound but matches at least with numerical experiments.

Similarly, I can "hack" an expression which matches numerics when only $H(s)=1$. However, this is even less sound and when I combine them ($H(s)\neq 1, G(s)\neq 1$) it falls apart.


texts: Deriving the CRLB for an active system with non-square shaped bandwidth

texts:
I'm attempting to calculate the CRLB for a bandlimited time-delay system which has a triangular shaped signal spectrum, instead of the usual square one.

Currently I'm working on an active system.

Following the procedures done by Quazi et al. in  "An overview on the time delay estimate in active and passive systems for target localization",

I can reach two different results. The first one, using his calculations for a High SNR, active system, don't really match my data, while the second one, computing for a Passive system and considering a $2$ factor (as he explains after equation 23) due to only one of the sources being contaminated by noise (which makes intuitive sense to me, as long as the SNR is high), actually fits my data very well.

As such, I am assuming I'm doing the first set of calculations wrong, and I was hoping some of you could help me spot my mistake.

So here goes, for both the calculations

PASSIVE

$$\frac{1}{\sigma^2} = 2T \int_{0}^{B}(2\pi f)^2 \frac{S(f)}{2N(f)}df$$

where my noise is square shaped, and my signal is triangle shaped, in baseband, so

$$\frac{1}{\sigma^2} = 2T \int_{0}^{B}(2\pi f)^2 \frac{S_0(1-f/B)}{2N_0}df$$

$$\frac{1}{\sigma^2} = 2T(2\pi)^2 \frac{S_0}{2N_0}\int_{0}^{B} f^2(1-f/B) df$$
$$\frac{1}{\sigma^2} = T \ 4\pi^2 \  SNR \  (B^3/3-B^3/4) $$
$$ \sigma^2= \frac{12}{4\pi^2T} \frac{1}{SNR} \frac{1}{B^3}$$

which, for an active system, dividing the variance by two since the source isn't noisy, I end up with
$$ \sigma^2= \frac{12}{8\pi^2T} \frac{1}{SNR} \frac{1}{B^3}$$

This fits very well to my data, and the last argument is logical to me.

ACTIVE

So, he starts by defining the CRLB as $\sigma^2 = \frac{1}{d^2\beta^2}$ where

$$d^2 = \frac{2E}{N0}$$
where $E$ is the energy of the signal, so $E = ST$, where $T$ is the signal observation time

$$\beta^2 = \frac{\int_{-\infty}^{+\infty}\omega^2|F(\omega)|^2 d\omega}{\int_{-\infty}^{+\infty}|F(\omega)|^2 d\omega}$$

Now, the calculation of $\beta$ is similar to what I've done before, setting my $S(f) = S_0(1-\frac{f}{B})$

$$\beta^2 = \frac{\int_{0}^{B}(2\pi f)^2S_0(1-\frac{f}{B}) \ \ 2\pi df}{\int_{0}^{B} S_0(1-\frac{f}{B}) \ \  2\pi df}$$

$$\beta^2 = \frac{(2\pi)^2\int_{0}^{B} f^2(1-\frac{f}{B}) \ \ df}{\int_{0}^{B}
(1-\frac{f}{B}) \ \ df}$$

$$\beta^2 = \frac{(2\pi)^2\frac{B^3}{12}}{ \frac{B}{2}} = (2\pi)^2\frac{B^2}{6}$$

solving now for the cramer-rao

$$\frac{1}{\sigma^2}=\frac{2E}{N_0}(2\pi)^2\frac{B^2}{6}$$

multiply top and bottom by $B$ so $N = N_0B$, and $S/N = SNR$

$$\frac{1}{\sigma^2}=2T(2\pi)^2 \ SNR\  \frac{B^3}{6} = 8\pi^2T \ SNR \frac{B^3}{6}$$

$$ \sigma^2= \frac{6}{8\pi^2T} \frac{1}{SNR} \frac{1}{B^3}$$

Which does not fit my data as tightly.

I'd like to ask you where my intuition is going wrong with both solutions, or if I am making any dumb mistakes.

Thanks


texts: Normalization factor in the convolution theorem

texts:
Maybe it's a trivial question, but I couldn't find any explanation for this.
According to the convolution theorem, in the continues case we add normalization factor, i.e.
$$
\mathcal F\left\{h\star g\right\} = \sqrt{2\pi}\cdot \mathcal F\left\{h\right\}\cdot \mathcal F\left\{g\right\}
$$
Do we still need to add a normalization factor also in the discrete case? If we do, what should its value be?


texts: Does my filter desing for unusual EEG experiment looks good?

texts:
I have made some progress since my last question, and again I am asking you for advice.
Hi,
I'm still designing an unusual (in terms of signal analysis) EEG experiment, which forces me to design my own filter. I have made some progress since my last question, and again I am asking you for advice.
I prepared a document that describes what filter I chose, why this particular one, and how I made this decision. Ultimately, I would like this document to become an attachment to the scientific publication that I plan to publish after my experiment. The document is here. It does not contain the source code which is here.
I have little experience with filter design, so I'd like to ask a few questions:

In general, does my approach makes sense?
Does my filter looks good for the task intended?
Is my approach to finding the best filter (parameter Grid Search) a good one?
Is there any example of such a well-written attachment describing the filter selection that I could rely on?

I am happy to accept any suggestions on how to improve both the filter and the document. I'm worried about making some false assumptions. I really care about the highest possible quality of my (PhD) project.
I will be very grateful for any comments.


texts: Numerically generating noise time series from spectral density

texts:
I'm trying to figure out a way to construct (numerically) time series of random variables given some spectral density $S_{xx}(f)$. I'm interested in various types of spectral densities (flat, lorentzian, 1/f) so if there is a general method that starts from an expression of $S_{xx}(f)$ and generates a suitable time series that would be ideal of course, but I am not sure if there is.

Honestly I am not so sure where to start. My guess is that you compose your random signal as a sum of different components with amplitudes related to your spectral density at a certain frequency. I understand that if you want your noise to have a complete frequency range you need infinitely many terms, so I suppose you cut off your noise at some frequency $f_{max}$, giving you some maximum amount of terms $K$. You'll also need some step size $\Delta f$ for the different frequency components, but after that I get kind of stuck. How do you incorporate your spectral density into this?

I understand that the question is perhaps a bit too general, so I'm also very much interested in advice on some sources on the subject. The ones I have been able to find are very technical, while for now I'm simply trying to create some time series in Mathematica given some spectral density as input, after which I want to see if I can reconstruct the spectral density from the output. That would get me started quite well, and I can think about what features are essential from there on.


texts: Which physical device accomplish the task of pulse shaping?

texts:
So I'm reading a lot about DSP lately and now I'm learning about pulse shaping. I understand the way it works and how useful it is to avoid (or reduce) ISI. But, I was wondering which physical device is in charge of accomplishing such task in the transmitter? I've been doing some research but I haven't found anything that states it. I thought of the DAC, but I'm not sure how you can tell a DAC to convert digital signals to its analog counterpart with a specific waveform. Let's say I'm using a root raised cosine as pulse shaper, can the DAC output an rrc waveform?

If it's not the DAC, which one would be? And when would the conversion to analog happen? Before or after pulse shaping? (this questions is in case the DAC is not the one doing the pulse shaping task).

Thanks.


texts: 60 Hz harmonics filtering "disappear" when segmenting the signal into smaller chunks

texts:
I have a signal that I filtered the 60 Hz harmonics using the following python code:

q = fs/2/12
b, a = signal.iirnotch(120/(fs/2), q)
data= signal.filtfilt(b, a, data, axis=1)
b, a = signal.iirnotch(60/(fs/2), q)
data= signal.filtfilt(b, a, data, axis=1)
q = fs/2/6
b, a = signal.iirnotch(180/(fs/2), q)
data= signal.filtfilt(b, a, data, axis=1)
b, a = signal.iirnotch(240/(fs/2), q)
data= signal.filtfilt(b, a, data, axis=1)
b, a = signal.cheby2(7, 40, [70 / (fs / 2), 295 / (fs / 2)], btype='bandpass')
data= signal.filtfilt(b, a, data)

I'm using filtfilt to have a zero delay. I'm characterizing the signal so I don't want any phase distortion.
I also increased the Bandwidth at 120 Hz because the power at this harmonic is larger or "wider".
The plot of the absolute spectrum for the whole signal before filtering is like this:

The plot of the absolute spectrum for the whole resulted signal looks like this (data is a multichannel and I'm plotting one of the channels):

You can see that at 120 Hz a suppress happened. Now, when I had a smaller chunk of the data. Where the small chunk is 200 samples and the whole signal samples are ~500K. The absolute spectrum looks like this (after filtering)

You can see that there are peaks at 120 and 180 Hz noted by red circles. Why is that happening?

The 5 filters responses are shown below. They ordered in the same way as they were ordered in the code above (the first one is at 120 Hz, the second one at 60 Hz, etc) The y-axis represents the amplitude in dB and the x-axis represents the normalized frequency.


texts: What is the difference between photon shot noise and salt and pepper noise?

texts: I am currently working on an application which deals with the restoration of fluorescent beads examined using widefield microscopy. There are two major sources of noises that are being encountered in the image: photon shot noise and salt and pepper noise. I have read in a paper that, both of them can be filtered using a median filter. So, is the essential difference between them only their sources?


texts: I have already asked this question 2 times, but still i am confused because this is not available anywhere on the internet and explained properly. I found some information in this document and i am going to apply their method , but confused to understand. here is the document http://www.altera.com/literature/an/an480.pdf. If anyone have some time to explain me kindly explain me where is radix 2 stage in this document to calculate the fft of size 512 because it has been broken into 3 small sequences of length 512 and then applied the fft on small lengths and then calculated it with combining and multiplying it with twiddle factors respectively. Kindly help me i am stuck in here for more than a week.


texts:
In papers and textbooks and on Wikipedia, I regularly stumble upon so-called "lattice filters". They always look horribly more complex than their 'non-lattice counterpart' and I usually don't really understand what's going on (and why). I could not really find a useful introduction to lattice filters and the fundamental idea behind them. What I believe to have understood (please correct me if I'm wrong) is that they represent some form of very efficient implementation scheme for classical filters, e.g., RLS?
Can somebody explain the intuition behind lattice filters? What are they, which problem do they solve, and how do they solve it? References to readable introductions are also highly appreciated.
(Note that I have actually had a fair amount of DSP in my undergrad studies, but lattice filters were never even mentioned.)


texts: Non-Linear, Non-Stationary spectral analysis methods! When and where?

texts:
I have been reading about non-linear non-stationary signal analysis methods and it seems to do this type of analysis the go-to method is the Empirical Mode Decomposition (EMD), then Hilbert Transform (HT) to get instantaneous phase and frequency.

However I have been doing some analysis on a non-linear, non-stationary signal by splitting the time signal into intervals with a Hanning window and Fourier transforming each interval which I think might also be the idea behind the Short Time Fourier Transform (STFT), although I am not sure.

Can anyone tell me what is wrong with this method, and why the EMD / HT method is more advantageous? I have also seen wavelet analysis used in similar cases, is this something I should look into?


texts:
A graylevel reference image is transformed displacing each pixel. The magnitude of the displacement follows a bidimensional gaussian distribution. When two pixels in the reference image fall in the same pixel in the transformed image, the resulting graylevel of the transformed image is the sum of graylevels of both pixels in the reference image.

Is it possible to calculate the most likely bidimensional gaussian distribution of the transformation? Do you know any research paper about it?


texts: Generating spectrogram for band-pass filtered wav file python

texts:
I have some .wav files of heart sounds. I want to apply band-pass filter [20Hx 100 Hz]. Then generating  PCG images size of 560x420 pixels and RGB format. How could i do this?
Any help will be highly appreciated.


texts: Is maximizing hamming distance the same as minimizing correlation?

texts:
For the design of an error correcting code, I might wish to maximize the distance between the codewords $\sum a_i \oplus b_i$.

For spreading sequences I'd like to minimize the cross-correlation at $t=0$ of $\sum \sigma(a_i)\sigma(b_i)$ where $\sigma(\cdot)$ maps binary $0\to1$ and $1 \to (-1)$ (i.e. what you'd get out of a BPSK matched filter when $E_b$ is normalized and there is no noise).

Are these criteria the same? It seems to me that since $\sigma$ acts as an isomorphism that turns cyclic$\pmod 2$ addition into cyclic complex multiplication, they are equivalent statements. Can you verify this and let me know where I can read more about it?


texts: Advantages of Splines in Compressed sensing

texts:
I am working in compressed sensing, basically in ECG reconstruction

Normally we were using biorthogonal wavelets for reconstruction.

Someone advised me to use exponential spline basis instead of biorthogonal wavelets and I tried it and the results were better compared to wavelets.

Even though I got better results I still don't know why it worked. I am going for presentation and I am expecting this question.


texts:
I need to implement a script for generating features from an input image by using the Gabor filter. I have no past experience of wavelets and I'm just learning Fourier analysis (I understand the basic idea behind Fourier analysis and transform) so they can't help me to understand Gabor filter, because I need to have an implementation done in a week. I don't need to understand the foundations of the Gabor filter function, but I would want to understand to some extent of what it is and what does it do. What are the parameters? What do they mean? What is the output of the function? For example this is the formula I copied from Wikipedia:

$$g(x,y;\lambda, \theta, \psi, \sigma,\gamma) = \exp\left(-\frac{x'^2+\gamma^2 y'^2}{2\sigma^2}\right)\exp\left(i\left(2\pi\frac{x'}{\lambda}+\psi\right)\right)$$

Now my obvious question is: What does this mean? What does the variables mean? According to Wikipedia:

$x, y$: I assume these coordinates specify the pixel value of an image at coordinates $(x,y)$ (2. This is OK, understood)

$\lambda$: represents the wavelength of the sinusoidal factor (Sinusoidal factor, huh? 3a. How do you select it? 3b. Where does it come from? 3c. Is it an arbitrary number or what? Freely chosen?)

$\theta$: represents the orientation of the normal to the parallel stripes of a Gabor function (4. What does that mean?)

$\psi$: is the phase offset (5. offset of what? How is this value determined? Is it freely chosen?)

$\sigma$: is the sigma/standard deviation of the Gaussian envelope (6. Need more explanation...)

$\gamma$: is the spatial aspect ratio, and specifies the ellipticity of the support of the Gabor function (7. Again need more details and more explanation)

And most importantly:

$$g(x,y;\lambda, \theta, \psi, \sigma,\gamma) = X$$

What is the output value $X$? What does it mean?

As I mentioned I don't need thorough explanation of the theory, because I bet it is long and reading a 1000 page book on unknown subject is not an option for me right now. I need to have have a black-box understanding of this function so that I can implement it in code and most importantly understand what is the input and what is the output.

Thank you for any help!! =)

P.S.

I read this post:

https://math.stackexchange.com/questions/259877/value-of-x-y-in-computing-gabor-filter-function

but it doesn't answer my question thorough enough :)


texts:
I've read an interesting paper called FingerIO
that transmits audio waves in OFDM,
and I wanted to implement and generate sounds using MATLAB.

(I am quite new to signal processing, so please understand my lack of background knowledge!)

In OFDM, there are 64 subcarriers, each with their own frequency band and holding a symbol.
OFDM applies IFFT on the symbols and converts them into time domain with 64 time domain samples.
The 64 time domain samples are sent to the receiver.
The receiver then applies FFT on the received signal and recovers the 64 transmitted symbols.

Below is the snippet of my code to test the data.
I first created a 64X1 matrix that represents subcarriers in the frequency domain, put data in the subcarriers, and applied IFFT.

for i=1:64
   X_Freq = zeros(1,64);
   X_Freq(i) = 1;
   x_Time = ifft(X_Freq);
end

My anticipation was that the frequency of the signal will increase with the value of i since higher subcarriers have higher frequencies.
However, when I ran the code, the frequency increased with the i during the first half (when i=64/2) of the subcarriers, but it began to decrease after the half point.

So I thought, since an FFT returns a symmetric positive and negative frequencies data, I've added the code below before the IFFT operation to create the positive frequency data.

for i=1:64
   X_Freq = zeros(1,64);
   X_Freq(i) = 1;

   X_Freq = [X_Freq X_Freq(end:-1:1)];

   x_Time = ifft(X_Freq);
end

After revision, the frequency now increases with the value of i, but the problem is that the output of the IFFT is now 128 samples.

Does anyone know how I can use 64 samples and use up to 64 subcarriers?
I would appreciate any comments/advises!
Thanks in advance!


texts: How to choose notch frequencies for filtering line noise?

texts:
I'm using the function to filter out line noise at 60 Hz (and 120, 180 Hz) caused by electrical noise: ecogNotch

In the case below I can effectively filter out the line noise with a notch filter at 60 Hz +- .5 Hz

For noisier electrodes, like below, I am unable to filter out the line noise with any range on my notch filter.

I understand that this is due to my notch-filter being gaussian in the frequency domain and my artifact exceeding all filter shapes significantly. Is there another way to effectively notch-filter out the extreme cases of line noise.

My two thoughts were either interpolating across the frequency domain or some sort of statistical baseline. I thought I'd ask here first to see if there is a well accepted answer for how to approach this.


texts:
My input is x and my filtered output is y. The sampling rate of x is Fs. I create a low-pass Butterworth filter in MATLAB as follows.

[b,a]=butter(order,cutoff*(2/Fs));
y = filter(b,a,x);

Letting order vary (cutoff fixed at 20Hz) yields these outputs y.

Letting cutoff vary (order fixed at 6) yields these outputs y.

I have a few very rookie questions about this sort of filter.

Why does the filter constrain y to equal zero at the first sample?
Why is there an initial ripple in y?
Why does the time-delay of y increase with order and cutoff?
The time step between successive samples of x is 1/Fs. Is the time-step between successive samples of y also 1/Fs?

FYI, my goal in filtering x is to remove high frequency noise above 20 Hz or so.


texts: Plot Frequency Spectrum of Binary Sequence in Matlab

texts:
I am new to Matlab and I am trying to implement a section of a published paper, the basic idea of the part that i am implementing is to show the frequency spectrum of camera aperture. The shutter exposure is represented by images on the left side and their frequency spectrum on the right side as shown in the following image.

What the first image represents is that the camera shutter remains open for the entire duration of the exposure time (hence the continuous block). The next 3 images show flutter shutter where the shutter opens and closes according to a binary sequence (white means closed and non-white means open) during the exposure time.

I want to draw these blocks according to a coded sequence of length 52, as well as their frequency spectrum. The coded sequence for first block is all 1's, for second block its alternating 1's and 0's, for the third block its random binary sequence, and for the last block its 1010000111000001010000110011110111010111001001100111.

Can anyone guide me how to achieve this in Matlab? How do i draw these blocks according to the described binary sequence and plot their frequency spectrum? Any help would be highly appreciated.


texts: Applying the inverse FFT to even out a room's sound - What is the more efficient algorithm?

texts:
I have a way (the standard way) to correct for my room's acoustics, but I'm wondering if there's a more efficient algorithm, something that doesn't involve going to the frequency domain maybe?

I have measured an IR in my room, where my speaker will be playing.
I convert this IR to the frequency domain w/ FFT and see some peaks and dips.
I want to correct for these peaks and dips so I apply roughly the opposite EQ changes on some of the bigger dips and peaks to flatten the spectrum.
Take the inverse FFT to get back the corrected IR.
Convolve this corrected IR with the music signal.

Any references to literature/books would also be much appreciated!


texts: How can i calculate a matrix of correlation?

texts:
I want to implement my own music algorithm detecting an angle of arrival of non-stationary signal and I need to make a matrix of correlation of this signal. I have problem because I don't know how to calculate expected value of product of signal and transposition of this signal.

$$ R_s= E[s(t)s^H(t)] $$


texts: Relationship between sensors and materials in terms of electromagnetic spectrum

texts:
The following text is from Digital Image Processing(Gonzalez and Woods)[3ed, Ch 2.2,p46]

  If a sensor can detect energy radiated by a band of electromagnetic spectrum, we can image events in that band. But the wavelength of electromagnetic wave required to “see” an object must be same size or smaller than the object.For example, a water molecule has diameter $10^{-10}$ m. To study water molecules, a source capable of emitting in far ultraviolet or soft X-ray region is required.

For the water molecule example, why do the authors refer to a source emitting ? As an analogy, for X-rays, the bones absorb waves in X-ray region and this renders them opaque on the film. Therefore, to image water molecules, a source which emits far ultraviolet/soft X-rays is needed. Passing this through water would somehow let us image water molecules. Is that what they mean ?


texts:
I noticed that spline interpolation with a degree higher than 3 (everything beyond cubic splines) have a very high interpolation error, hence the prediction is mostly awful. I've come across various lecture notes, slides and Youtube videos that simply indicate that cubic splines (3rd degree) are optimal and that anything beyond that is a bad idea. These sources however never mention why this is the case.

Can anyone explain to me why this is the case and maybe give me a title/link to a journal/conference paper that explains this or maybe even gives a proof.


texts: Problem with Generalized Cross Correlation (PHAT filter)

texts:
I have to calculate time delay between two signals.I am using the GCC-PHAT method. First, I cut the signals into smaller parts (~0.5s) and then try to calculate the delay. When I display those two signals on the graph, the delay is very obvious.

The problem is that for some parts of that long signal, my program calculates the correct delay, but for some parts the delay is totally incorrect. In both cases, when I display those two signals on the graph, the delay seems very obvious.

Relevant code:

duration=20000
a=hanning(duration+1)
[signal1,Fs] = audioread(mic1);
[signal2,Fs] = audioread(mic2);

start=1000;
stop=start+duration;
x1=[a.*signal1(start:stop)];
x2=[a.*signal2(start:stop)];

A=fft(x1);
B=fft(x2);

PHAT=A.*conj(B)./(abs((A).*conj(B)));
result=abs(ifft(PHAT));

Examples:
1) Correct result:

2)Incorrect result:

I recorded those signals in a closed room, so there are probably also reverberations.
Am I doing something wrong? Or is this method just not very effective in my circumstances?

I also tried to prefilter signals, but the results were the same.
There is also no improvement, if I change the length of the signals.


texts: Construct Postfilter for overall Minimum or Linear Phase Filter

texts:
I have a given FIR filter impulse response $h[k]$ for a linear system $y[k] = x[k] \star h[k]$. $x$ is some input, $y$ is the output of the system.

My goal is to construct a postfilter $g[k]$, so that we have $y[k] = x[k] \star h[k] \star g[k]$ with $h_{\rm overall}[k] = h[k] \star g[k]$ being minimum phase.

Though $h$ can vary, it will in general always have most of its zeros on the unit circle.

Question now: How can we construct $g[k]$?
My original approach is quite simple:

Let $a_i$ be zero of $h$ outside the unit circle, then form $G_i(z) = \displaystyle\frac{z - 1/a^\ast}{z-a}$
Form the overall $G$ as $G(z) = \displaystyle\prod_i G_i(z)$

In theory this should work, right?

I implemented this approach in MATLAB and the results are completely useless. My assumption would be that there are (if my approach is correct) are of numerical nature. So my questions are:

Is my approach described above correct?
How can I implement this in Matlab the best way?


texts: DFT symmetry vs DFT duality in Richard Lyons' "Understanding DSP"

texts:
I am reading Richard lyons, understanding dsp, chap 3.

Article 3.2 is about property of dft symmetry but any where in this chapter, i am unable to find discussion about dft duality property

I want to know here ,author means both dft symmetry and dft duality to be a same thing?


texts: OFDM demodulation, how to set the sampling rate?

texts:
I have a signal for which I know the OFDM burst length (from the autocorrelation function of the signal) T_burst and the FFT size 1024 (by measuring the channel spacing) and the guard interval (128).

How should sample such a signal for OFDM demodulation ?
What is the ideal sample rate for that ?
Is it (1024+128)/T_burst?

I plan to use GNU radio for demodulation, like this (this image is from IRC channel - credit to drmpeg):


texts: Reverse biorthogonal 2.2 wavelet inverse DWT implementation

texts:
I have some image data that are - supposedly - transformed using the MATLAB’s 5/3 Le Gall integer lifting wavelet transformation. The actual Matlab code that does the inverse DWT calls the following function:
liftwave('rbio2.2')

It takes as input 4 128x128 matrices (LL, HL, LH, HH) and the wavelet (called LS from lifting scheme) and returns an image that is 252x252 pixels. I don't know if it adds any padding before doing the inverse DWT nor if the resulting image size is normal for this type of wavelet.
I am looking for an implementation of the particular wavelet inverse DWT outside Matlab. I have tried pywavelets but the resulting images are different (wrong).
Can anyone suggest an open source implementation?
UPDATE
I have found (one of the many) the following implementation of the bior2.2 wavelet with integer to integer mapping:
void dwt_cdf53_i_ex_stride_i(
    const int *src_l,
    const int *src_h,
    int *dst,
    int *tmp,
    int N,
    int stride)
{
    assert( N >= 0 && NULL != src_l && NULL != src_h && NULL != dst && NULL != tmp && 0 != stride );

    // fix for small N
    if(N < 2)
        return;

    // copy src into tmp
    dwt_util_memcpy_stride_i(tmp+0, 2*sizeof(int), src_l, stride,  ceil_div2(N));
    dwt_util_memcpy_stride_i(tmp+1, 2*sizeof(int), src_h, stride, floor_div2(N));

    // backward update 1 + backward predict 1
    for(int i=2; i<N-(N&1); i+=2)
        tmp[i] -= ( (tmp[i-1] + tmp[i+1]) + 2 ) >> 2;

    tmp[0] -= (tmp[1] + 1) >> 1;

    if(is_odd(N))
        tmp[N-1] -= (tmp[N-2] + 1) >> 1;
    else
        tmp[N-1] += tmp[N-2];

    for(int i=1; i<N-2+(N&1); i+=2)
        tmp[i] += ( tmp[i-1] + tmp[i+1] ) >> 1;

    // copy tmp into dst
    dwt_util_memcpy_stride_i(dst, stride, tmp, sizeof(int), N);
}

How can this be changed to perform the reverse biorthogonal wavelet?


texts:
i will use matlab code just for convenience, i get the same behavior using a C++ code.

I have two signals:

Fp=5;
A=0.00025;
Phi=0;
Off=0.5;
KADC_5VOLT=5.0/32768.0;

tc=250e-6;
tmax=30;
t=0:tc:tmax;

Buf1= int32 ((A*cos(2.0*pi*t*Fp+ Phi*pi/180.0)+Off)/(KADC_5VOLT));
Buf2= int32 ((A*cos(2.0*pi*t*Fp+ Phi*pi/180.0)+0)/(KADC_5VOLT));

Buf1=double(Buf1);
Buf2=double(Buf2);

performing a FFT on Buf1 i get amplitude 2.4246e-04 for the 5 Hz component ((this values seems to change randomly as a function of A, while A is small); while for Buf2 i get amplitude 2.6287e-04 for the 5 Hz component. If i set A > 0.0015, performing a FFT on Buf1 and Buf2 i get amplitude 0.0015 for the 5 Hz component;

if i use just:

Buf1= ((A*cos(2.0*pi*t*Fp+ Phi*pi/180.0)+Off)/(KADC_5VOLT));
Buf2= ((A*cos(2.0*pi*t*Fp+ Phi*pi/180.0)+0)/(KADC_5VOLT));

performing a FFT on Buf1 and Buf2 i get amplitude 2.5000e-04 for the 5 Hz component.

What is the reason of that? is seems that the problem is related to a quantization error, but why is the offset so important? Also: how can i get rid of it?


texts:
I'm looking at a job spec, detailed below.   I'm perplexed as to what is being asked for.

Could someone offer a basic understanding of this material?   I can imagine a solution may involve performing an FFT, setting bins outside the desired frequency range to 0, modifying phase of remaining bins, and recombining with iFFT.

but I am left scratching my head as to the purpose of this...

Application is required to:

A) input audio from external microphone jack input,
B) bandpass filter to limit audio to between 50 to 500 Hz
C) add phase delay between 150 degrees to 210 degrees (programmable via settings)
D) output resultant audio stream via speaker phone or audio jack
E) audio output volume to be calibrated to match audio input volume

User interface:
A) two modes- configuration mode, normal mode.
B) in configuration mode allow user to adjust phase delay and other audio    parameters, such as filter characteristics, gain and output volume.
C) in configuration mode user can select audio output via speaker phone or external speakers.
D) ability for user to disable incoming phone calls while app is running.


texts:
I have been trying to achieve a Hamming window length of 23 using the equation.
I tried several coding, one of the is the one below:
M=23
w = .54 + .46*cos(pi*(-M:M-1)'/M)
plot(w)


texts: Can't get FFT of Sample & Hold sinusoidal wave in Simulink

texts:
Simulating of Sample-and-Hold fails: "Buffer" block generates the error "All sample times must be discrete. No continuous or constant sample times are allowed"

Any suggestions ?
Thanks in advance.

Well, when I remove "Buffer" and set the parameter "Samples per Frame" in "Sine Wave", the FFT is calculated. But such setup isn't reliable ... I mean it doesn't represent the behavior of "Sample-and-Hold". The block "Sample-and-Hold", once applied to sampled signal works as sinc(x) function (sinc(x) = sin(x)/x).

So, when the frequency of input signal approaches Nyquist frequency, after "Sample-and-Hold" it is filtered out. It is not the case in my setup: none of 3 frequencies is attenuated.


texts: Can the order of filtering and downsampling be exchanged?

texts: Say for example, I have a signal with maximum frequency at 600Hz, and I originally oversampled it at 2000Hz. Afterwards I was only interested in frequency less than 500Hz. I guess I could first filter out frequency >500Hz, then downsample by taking every second sample point; or I could first downsample by taking every second sample, then filter out frequency >500Hz. Is there any problem with the two methods? Do they generate different results?


texts: What preprocessing technique can help me to filter the background text noises using matlab...the image is shown below?

texts: Can anyone help me to improve the degradation of the following image....i am working on OCR system in Amharic language and what is the best image filtering technique that can help me to separate text data from background noise?


texts:
How will the signal $\sum_{n=-\infty}^\infty \Delta (t-n)u_{-1}(t-n)$ look like?

I understand that $\sum_{n=-\infty}^\infty \Delta (t-n)$ is a periodic signal with period $1$, where the triangular pulse $\Delta(t)$ is shifted by $1$ units for each value of $n$.

where,
$$\Delta(t) =
\begin{cases}
1-2\vert t\rvert,& \lvert t\rvert<\frac{1}{2} \\
0,&\lvert t\rvert>\frac{1}{2}
\end{cases}$$
From this I infer that $\sum_{n=-\infty}^\infty \Delta (t-n)u(t-n)$ would probably be a signal in which the RIGHT HALF of $\Delta (t)$ will be shifted by $1$ unit for every value of $n$. But here I have a doubt that $u(t-n)$ will be added with the previous values of $u(t-n)$ i.e $u(t-(n-1))$ and will have a staircase effect. Thus the signal will no longer be periodic.(Which is a cause of concern as we have been asked to find the Fourier series of the signal, which means the signal should be periodic)
I also don't understand what the subscript $-1$ in $u_{-1}(t-n)$ means.

Please help me visualize this signal(It would be highly helpful if you would  draw the graph as well to help me visualize the signal)


texts: How to achieve image straightening as cam scanner does?

texts:
Is it possible to achieve image straightening as cam scanner does

I mean selecting a non-rectangular region and converting it to a rectangular region as an image. I can only do re sizing and crop of rectangular region of image.


texts: What is impulse response if i know input and output?

texts:
I would like to find the impulse response, h[n], of an LTI system given the input

x[n]=[1,−3,2]

and the output

y[n]=[1,−1,−4,4]

I know that y[t]=x[t]∗h[t], but I am having hard time to figure out the right way to calculate the impulse response. I know very little about signal processing, so if you don't mind giving an easy explanation, then I appreciate it. Or, if it's possible to do an example, that's better.


texts: filtering out specific waves in scattering pattern

texts:
I have the following (experimental) image, with its correponding raw data in .csv format here.

The pattern represents the scattering of a laser field off a point defect located in the center. One can clearly see a V-like shape of the scattered waves (here drawn in green). Unfortunately, there is also quite a lot of back-scattering going on, resulting in the very closely spaced parabolic waves running in the opposite direction.

I would like to find an fft-based method for filtering out all the secondary waves, leaving only the V-shaped ones.


texts:
I'm looking for a Python package or method to accurately estimate the arrival time of time signals.

A single time signal is stored inside a 1-dimensional numpy array, so every component of the array represents the value of the signal at a given timestep.

Here is an example of the signals shape:

Setting a threeshold is not always efficient, it depends on the signal behaviour and amplitude.

I would like to find a gradient based method to identify the starting timestep.
Do you have any relevant experience or suggestion?


texts: Matlab: Help in understanding if the example for Maximum Likelihood Equalizer is properly functioning

texts:
I am stuck in the part where I need to apply the MLSE Equalizer with Viterbi  code. The equalizer is an optimal. I am using the Communication Toolbox  http://www.mathworks.com/help/comm/ref/comm.mlseequalizer-class.html#properties

and cannot understand pretty much if the simulation is working properly or not. Basically, the equalizer is an FIR model and the channel is a multipath (not Rayleigh).  Following the example in the documentation, I cannot understand

(1) What this statement does? Why is it calling the ML Equalizer here?

  modSignal = step(hMod, data);

(2) In the example code, there is no statement for additive Additive White Gaussian noise. The example given in the documentation does not clearly mention if the additive white Gaussian noise has been incorporated into the transmitted signal. It only says Introduce channel distortion . What kind of distortion is unclear.

(3) Is the example properly functioning because the simulation BER = 0 for all SNR levels. I am sceptical if I am doing it properly.

I shall be really obliged if some help is provided in how I should properly use the MLSE equalizer. Thank you.

UPDATE : The code throws error :

Error using comm.MLSEEqualizer/step
Complexity mismatch with input 1; expected complex, got real.

Error in MLSEEqualization_test (line 47)
      eqSignal = step(hMLSEE,chanOutput);

I wanted to see if I can apply MLSE for real signal also such as BPSK and to minimize the use of built-in functions for data generation, modulation and demodulation. This would help me to understand how the theoretical concepts can be put together in the code. That is why I am not using the communication toolbox for data generation and other steps; I am using only the MLSE EQualizer module provided in the toolbox. How can I go about this error message? The channel coefficients are real, noise is real and the data is also real. Thank you.

N = 10^3 % number of bits or symbols
rand('state',100); % initializing the rand() function
randn('state',200); % initializing the randn() function

n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
Eb_N0_dB = [0:10]; % multiple Eb/N0 values
h=[1 0.6 0.3]';

L = length(h);
for aa = 1:length(Eb_N0_dB)

    % Transmitter
ip = rand(1,N)>0.0; % generating 0,1 with equal probability
data = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 1

   chanOutput = filter(h,1,data');

    %% ----- ADDED
    EbN0 = Eb_N0_dB(aa);
    SNR_linear  = 10^(EbN0/10)*log2(M);
    SigPWR      = 1; %unit circle symbols
    NoisePWR    = SigPWR/SNR_linear;
    NoiseFactor = sqrt(NoisePWR/2); %half power complex half imaginary

    hMod = comm.QPSKModulator(0,'SymbolMapping','Binary');
  %  hDemod = comm.QPSKDemodulator(0,'SymbolMapping','Binary');
    const = step(hMod,(0:M-1)'); % BPSK constellation

            %% ----- ADD NOISE !!
  %    noiseVec   = NoiseFactor*randn(N,1)+1j*NoiseFactor*randn(N,1);
   noiseVec   = NoiseFactor*randn(N,1);
      chanOutput = chanOutput+noiseVec;

    hMLSEE = comm.MLSEEqualizer('TracebackDepth',10,...
                      'Channel',h, 'Constellation',const);

    hError = comm.ErrorRate;

 % Equalize the channel output and demodulate
      eqSignal = step(hMLSEE,chanOutput);
      demodData = real(eqSignal) > 0;
   %   demodData = step(hDemod,eqSignal);
 % Compute BER
      errorStats = step(hError, data, demodData);

    fprintf('Error rate = %f\nNumber of errors = %d\n', ...
      errorStats(1), errorStats(2))

    %assume 1 symbol error = 1 bit error (needs Gray coding in real system for this to be true)
    BER(aa) = errorStats(1); % SER ~= BER with undelrying Gray coding
end

%% changed, this is already divided by N*N2
simBer = BER; % simulated ber

theoryBer = 0.5*erfc(sqrt(10.^(Eb_N0_dB/10))); % theoretical ber
close all
figure
semilogy(Eb_N0_dB,theoryBer,'b.-');
hold on
semilogy(Eb_N0_dB,simBer,'mx-');
axis([0 10 10^-5 0.5])
grid on
legend('theory', 'simulation');
xlabel('Eb/No, dB');
ylabel('Bit Error Rate');
title('Bit error probability curve for BPSK modulation');


texts: Why Does Image Deconvolution Still Work with Image without Sharp Edges?

texts: Why does image deconvolution still work with image without sharp edges? Take this image for example:


texts: Pole-zeros of a real-valued causal FIR system

texts:
Could someone please help me with the following question?

Below is the magnitude response of a real-valued causal linear phase FIR system of order N = 6. Determine the location of poles and zeros.

I know that for FIR systems all the poles are located at the origin, so we have a pole of order six at the origin. Also from the given diagram, I can say that we have a zero at 0.3pi and one at 0.8pi (both on the unit circle). Now since the system is real-valued, location of poles and zeros should be symmetric w.r.t. the real axis. But I don't know about the two other zeros?

Also, what about the pick in the diagram? Does it mean we have another pole?


texts:
I'm trying to do bicubic interpolation on an 8*8 matrix(image) shown below.

A = 10   20  30  40  50  60  70  80
    90  100 110 120 130 140 150 160
    170 180 190 200 210 220 230 240
    250  10  20  30  40  50  60  70
     80  90 100 110 120 130 140 150
    160 170 180 190 200 210 220 230
    240 250  10  20  30  40  50  60
     70  80  90 100 110 120 130 140

I used the following matlab code for it and I got an output

interp2(A,'bicubic')

But even after googling I'm not getting how to do it manually. Can anyone help me to get the idea using this example(only for few pixels)?


texts: Is there any literature discussing PDF after quantization?

texts: Consider a random variable with a known distribution. I want to know if we quantized the variable the how the probability density function(PDF) would change? Specifically if the original PDF is Rayleigh distributed what would be the distribution would look like after the quantization?


texts: Deterministic / Non-deterministic Stochastic Process

texts:
Problem 6.1-6 of Probability, Random Variables, and Random Signal Principles, 4th Edition by Peebles asks

  If a  process is defined by $X(t) = A$, where $A$ is a continuous random variable uniformly distributed on  $(0,1)$,   is
  the process deterministic or non-deterministic?

The textbook says that  "a process is called deterministic if its value as a function of time can be pre-determined" and the answer to the
question above is the process is deterministic.

My questions are

If $A$ is a random variable, then how can we determine time functions (or ensemble members) before specific $A$ is given?
What are examples of non-deterministic processes?


texts: Filtering Frequency Bands Out of a Signal

texts:
Let's say I have a 2 second data set taken at 220Hz sample rate and I would like to filter out the frequency bands associated with the EEG Spectrum:
$$\begin{align}
\Delta:& [1,3]\text{ Hz}\\
\theta:& [4,7]\text{ Hz}\\
\alpha_1:& [8,9]\text{ Hz}\\
\alpha_2:& [10,12]\text{ Hz}\\
\beta_1:& [13,17]\text{ Hz}\\
\beta_2:& [18,30]\text{ Hz}\\
\gamma_1:& [31,40]\text{ Hz}\\
\gamma_2:& [41,50]\text{ Hz}
\end{align}
$$
What would be the most simple approach to do this ?


texts:
I am using MATLAB Simulink's toolbox for Parrot Minidrones, which have an ultrasound an optical flow sensor built-in. Whenever I am trying to let the drone hover in position, it drifts into one direction (always the same direction). The strange thing is that the drone knows it is drifting, but nothing is happening to correct it:

The drift only seems to occur horizontally, vertically the drone is not drifting. An overview of the relevant part of the PID implementation can be found here. I have tried tweaking some values, but it does not seem to improve. Does anyone have any tips for what the issue might be?
Edit: graph of roll, pitch & yaw


texts: What is the spectrum of modulated noise?

texts:
I use a white-noise generator in an rf bridge to measure antenna impedance.
The receiver is an ordinary AM/CW/SSB communications type, nothing fancy, nothing 'coherent'.

As I approach the null of the bridge the signal is masked by receiver noise.  To make it stand out I 'modulate' the noise with a 1kHz square wave (the noise source is switched on/off at about 1kHz.)  I 'null' on the 1kHz audio, not the received noise power.

The question:  What is the spectrum of the modulated noise and how is it different from that of the 'raw' noise?


texts:
I am constructing a MFCC and come to a section which is kind of confusing me.

It is:

Step 4: Fast Fourier Transform

and has this equation:

Now I understand that FFT needs to be carried out, I just don't understand where the values are meant for:

h(t)

x(t)

H(w)

x(w)

Up to now, I have:

Inputted the raw signal (vector)
Pre-emphasis filtering on the signal
Carried out "Framing" (vector of vectors)
Computed Hamming Window

It's just this step I am unsure of.

Hope someone can help :)


texts:
I'm looking for the way to detect the tree rings automatically in the wood dist image.
Using the matlab, I have removed the background, and binarized the image.

How can I detect the white and black boundaries?
I want to fill that white area.

Is there a way to detect the white and black boundaries?
I want to get rid of the black noise that exists in the white area.
is there any other way to make clearer binary image?
It has scratches which has caused by sandpaper machine, so morphological operation doesn't work well.. any other way..?

I would appreciate your help.