texts: How do scaling of the coefficients for the poles of a biquad filter affect the gain?

texts:
Given a digital filter consisting of a chain of digital biquad filters.
Given a digital biquad filter with a normalized Direct form 1 difference equation: $ y_n = b_0x_n + b_1x_{n-1}+b_2x_{n-2} - a_1y_{n-1} - a_2y_{n-2}$

My goal is to implement the biquad filter with few multiplications. For this end I play with the coefficients. A first question is:

Can I change coefficients $a_1$ and $a_2$ proportionately, and still retain the frequency response of the biquad filter?"

The rest of this post assumes an affirmative answer.
Many of my filters will have $b_0 = b_2$. As a start I change $b_0, b_1, b_2$ so that $b_0$ (and $b_2$) are powers of 2. This changes the gain of the biquad filter, this will be compensated later in the signal chain.
I want to change the coefficients $a_1$ and $a_2$ in a similar way, to eliminate yet another multiplier. I reason that this should be possible - the feedback is dependent on the proportion of $a_1$ and $a_2$. I am, however, unable to fathom how this affects the gain of the biquad filter. So my second question is:

How does proportional changes to $a_1$ and $a_2$ affect the gain of the biquad filter?

A concrete example

Assume the following coefficients:

a0 =  1.000000
a1 =  0.305805
a2 = -0.192467
b0 =  0.236979
b1 =  0.412704
b2 =  0.236979

If used "as is", four multipliers are needed (we would add $x_n$ and $x_{n-2}$ before multiplying with $b_2$).
To remove one of the four multiplications is easy. I modify the non-recursive coefficients b0, b1 and b2 in such a way that b0 is a power of 2.

a0 =  1.000000
a1 =  0.305805
a2 = -0.192467
b0 =  0.236979/0.236979*0.25 = 0.25
b1 =  0.412704/0.236979*0.25 = 0.435380
b2 =  0.236979/0.236979*0.25 = 0.25

I now have a gain of $b_2/0.25$ I now modify $a_1$ and $a_2$:

a0 =  1.000000
a1 =  0.305805/0.305805*0.25 = 0.25
a2 = -0.192467/0.305805*0.25 = -0.157344
b0 =  0.250000
b1 =  0.435380
b2 =  0.250000

Experimentally, it seems the gain now changes with a factor 1.25, but how to derive this?


texts:
I have a question on the multiplication of  two noise.

Suppose I have two noise $n_1[n]$ and $n_2[n]$. I only know their power spectral density $N_1[k]$ and $N_2[k]$. How can I get  $N_3[k]$, where $N_3[k]$ is the power spectral density of $n_3[n] = n_1[n] n_2[n]$. Let's first assume $n_1[n]$ and $n_1[n]$ are independent.

I am thinking to first calculate the auto-correlation $R(n_1[n] n_2[n])$. Then $$N_3[k] = F(R(n_1[n] n_2[n]))=F(R(n_1[n])R(n_2[n]))=F(R(n_1[n]))*F(R(n_1[n])),$$ where $F()$ represents Fourier transform. But we only know the amplitude of information of $F(R(n_1[n]))$ and $F(R(n_2[n]))$ through $N_1[k]$ and $N_2[k]$. That is, we do not have the phase information. How can we calculate $N_3[k]$?

Could somebody help on this?


texts: Basic "filtering" in digital communications

texts:
I am completely stuck on solving some problems for my digital communications class. Junior level undergrad class, so fairly basic. I have been searching around all day for related articles etc but can't seem to find any that are helpful. Any help would be much appreciated.
Here are the three questions

For the coefficients my initial hunch is just to make c2 and c3 = 0, which would leave

yhat[1] = y[1]

My other attempt is to create a system of equations so the x[2] terms are cancelled and the x[1] terms are the only ones left over, but this system proves difficult to me and I am left with a mess of noise. For some reason I can only get two equations with three unknowns.

c3= -3 * c2
c1 + 1/3 * c2 + 1/4* c3 = 1

where c1,c2,c3 are constants

--OK so I think I solved question 1, I ended up getting c1=1,  c2= 1/3, c3 = 1/4 for part a

and  ((169/144)* SNR)/((4/13)*SNR + 1) = SINR for part b.

Moving on to question 2, part a I got what I was attempting to do above, c3 = -3 * c2.

Unfortunately I am stuck again on part B because I fail to see how the coefficients would affect the SINR if we just want to solve for X[1]


texts: To remove doppler for equalizer doppler does it need decision directed like carrier recovery?

texts: Normally equalizer is used at the start of the receive chain .So do we need decision directed to estimate the doppler here and also later for carrier recovery for carrier phase recovery?


texts: Spectral plot shows more notes than there really should be

texts:
I was experimenting with sound analysis lately and from what I see when I plot spectral data of an audio file is that apart from notes that were actually picked there are some other notes with quite high local amplitude.
For example I have a sample where D major chord is played with some nasty distortion. After looking onto the spectral plot I can observe a note D, F# and A as expected. But as I go higher some other notes have higher amplitude than threshold, one of those is E.
Tried same algorithm for recorded guitar chord without distortion, but it sounds like there are some other effects like chorus or flanger and again additional note was found.
So, the question is: why I can see additional notes when analysing spectrum even though they were not picked during recording ?

Note: The note E has some harmonics further in spectrum, so it cannot be treated like noise.


texts: Audio in Image,Graph or WaveForm Representation

texts:
Our task is to feed the audio data into the deep learning tensor flow model in the form of image representation(or graphical,waveform). Question is what is the best way of representing audio in image format??

The representation must focus on words rather than voices.i.e., The similarity of the words must be high than the voices, when two person are speaking the same word.


texts: How to find average and power of a signal

texts:
I need to find the average and the power of this signal:
$$x(n)=\sum_{k=1}^{\infty}2^{-k}e^{j2{\pi}kn}$$
The problem is that the summation starts at 1 and not at 0, and a part of that how can I find the average of a signal expressed in this way?


texts: Understanding audio downsampling code (JavaScript) and adapting to a different ratio

texts:
I inherited responsibility for some audio downsampling code that I don't fully understand:

  // downsampling variables
  var filter = [
      -0.037935, -0.00089024, 0.040173, 0.019989, 0.0047792, -0.058675, -0.056487,
      -0.0040653, 0.14527, 0.26927, 0.33913, 0.26927, 0.14527, -0.0040653, -0.056487,
      -0.058675, 0.0047792, 0.019989, 0.040173, -0.00089024, -0.037935
    ],
    samplingRateRatio = this.options.sourceSampleRate / TARGET_SAMPLE_RATE,
    nOutputSamples = Math.floor((buffer.length - filter.length) / (samplingRateRatio)) + 1,
    outputBuffer = new Float32Array(nOutputSamples);

  for (i = 0; i + filter.length - 1 < buffer.length; i++) {
    offset = Math.round(samplingRateRatio * i);
    var sample = 0;
    for (var j = 0; j < filter.length; ++j) {
      sample += buffer[offset + j] * filter[j];
    }
    outputBuffer[i] = sample;
  }

The audio is always in $32$-bit floats (from the Web Audio API).  The source sample rate is typically, but perhaps not always $48\textrm{ kHz}$. The output is always $16\textrm{ kHz}$ at the moment, although I'm interested in providing an $8\textrm{ kHz}$ option which is part of why I want to understand this better.

The things I do understand:

Each output sample is basically a weighted average of $21$ input samples
Correspondingly, most input samples are partially represented in $21$ output samples
Somehow it's filtering out frequencies above $8\textrm{ kHz}$, and that that is necessary to avoid aliasing
The weights (filter array) make an interesting graph:

Questions I have:

Is this a well-known algorithm that I just don't recognize because I'm a noob? (Perhaps an FIR Filter?)
Which part of the code is the low-pass filter? The fact that it uses $21$ samples when I'd expect $3$-$4$ to suffice? Or is it the "weights" rather than simply averaging the $21$ samples? All of it?
How would I go about choosing the filter values if I didn't already have this list?
Is it significant that the sum of filter array is almost-but-not-quite $1$? ($0.98198732$)
Besides the TARGET_SAMPLE_RATE, what would I need to change for $8\textrm{ kHz}$ output? I assume the low-pass filter would need to go down to a $4\textrm{ kHz}$ max, but I don't know how to do that.

Answers to one or all questions are welcome.


texts: Terminology for instantaneous phase of magnitude component of complex signal

texts:
In my field, we deal with data that are originally complex-valued. Typically, researchers convert their data from real + imaginary to magnitude + phase, and then discard the phase data (i.e., we generally only deal with the magnitude portion of a complex signal).
There are a number of papers on phase synchrony, in which the Hilbert transform is applied to this magnitude-only data to estimate the analytic signal, from which instantaneous phase is extracted. I am very much a novice in signal processing, so I found this a little confusing. The papers refer to the instantaneous phase signal estimated from magnitude-only data just as "phase signal". These folks might not be aware of the complex-valued nature of the raw signal, which is reasonable given how these data are generally handled, but I think there should be a more appropriate term for "phase estimated from magnitude signal using the Hilbert transform", given that there's very little similarity between the real phase signal and this estimated phase signal.
Is this an established concept and, if so, is there a term that would differentiate the two kinds of phase signal?


texts: Reconstruction of sampled band-pass signal

texts:
I am pretty new to signal processing. I am currently trying to reconstruct a sampled band-pass signal created with the filtfilt and cheby2 MATLAB functions. I am trying to do this with sinc interpolation, but I do not know what the discrete reconstruction formula is. I know that

$$h(t) = f_s \cdot \text s \text i \text n \text c(\frac{t \cdot f_s}{2}) \cdot \text c \text o \text s (2\pi t f_s \frac{2n + 1}{4})$$

but I cannot be able to find the corresponding discrete implementation of this - i.e. the equivalent of $$\sum_{n = -\infty}^{\infty} x_n \cdot \text s \text i \text n \text c (t\cdot f_s - n)$$ for the low-pass filter reconstruction that has $$h(t) = f_s \cdot \text s \text i \text n \text c (t\cdot f_s)$$

Can sombody shed some light on this? I have been struggling for a lot of time with this issue (trying different implementations that didn't quite give the right result), but I think the solution should be rather straightforward.


texts:
I am trying to get the frequency response of a system, so, in theory I would need to do:
H = fft(y)./fft(x);

I have measured the system with a long stepped sine log sweep four times as I am planning to perform a spectral averaging to improve my SNR. This gives me a total of almost 5.000.000 samples per file. I have calculated the STFT of smaller chunks and averaged them as it looked like a too long signal to do an FFT. I used the cross spectrum and auto spectrum for that (I did the same procedure 4 times, one per audio file/repetition).
However I think that's not the correct way to go as I am averaging a non stationary signal. Should I just do an FFT of the whole signal? Isn't it too long? Do you have any idea of how I should proceed?
Thanks a lot in advance!


texts:
How can I find inverse z transform of $$X(z)=\frac{5}{(z-2)^{2}}$$ ?

It is known that x[n] is causal.

EDIT: Here is what I have done. Since signal x(n) is causal, convergence of z transform of that signal will be outside of circle with radius r:

We have in bracket sum which represents z transform of signal:

But I don't know what to do next.


texts:
I am trying to understand how to calculate kernel matrix for guided image filter. Following is the formula for kernel calculation.

where k is window withing pixels i and j belong i assumed that window k is a 3x3 matrix and take following I matrix to calculate kernel. omega is total number of pixels in window.
I am confused about index i and j so if I take a matrix 3x 3 that is as
$$
     I=   \begin{matrix}
        1 & 2 & 3 \\
        4 & 5 & 6 \\
        7 & 8 & 9 \\
        \end{matrix}
$$
now mean is 5 and variance is 6.67 taking epsilon as 0.002 and omega is 9 I calculated value for kernel for the first pixel so taking i = pixel(1,1) and all rest will be j including i== j case. then my output came as (I used excel sheet to do this I could have used MATLAB)

$$
     W=   \begin{matrix}
        0.111 & 0.111 & 0.111\\
        0.111 & 0.111 & 0.111 \\
        0.111 & 0.111 & 0.111 \\
        \end{matrix}
$$

when I changed values in matrix I output was still same so I doubt i understood something really wrong. Is there anyone who can explain me how to calculate W in this formula.
Most confusing term for me is that sum of k:(i,j) over window k. If anyone can explain me I guess I will be able to correct my calculation.

Reference

The paper - Guided Image Filtering (Available on Scribd).
Please check section 3.3 for kernel formula.


texts:
One could train a speech recognizer with words or phonemes. I guess that they both have their pros and cons:

with words there would be a lower error rate as phonemes can be put together building a non-existing word (this case would be impossible with word training)
using words would require a larger database and more space and processing time
phonemes are way more general: with all phonemes you can build all existing words, but with all the words in the database you can't recognize all the words in the language

I'm wondering if there is a reason to prefer one over another, or if in some cases one is better than the other. Do both methods have practical applications? Which ones? What are their pros and cons (apart from the ones I named, which may be wrong so feel free to correct me)?


texts: Obtaining the Impulse response from the frequency of a discrete system

texts:
I have the following discrete system's transfer function (Z domain):

$$h[z] = {z \over z - \frac{1}{2} }$$

I need to obtain the following:

The frequency response.
The impulse response.
The fourier spectre.

The first one is pretty easy we just substitute $z$ by $ e^{j \omega}$ giving us

$$h[\Omega] = { e^{j \omega} \over  e^{j \omega} - \frac{1}{2} }$$

In the second one is where I have some questions, as a rule the IR is just the anti-transform of the transfer function $h[\omega]$, the original transfer function $h[z]$ maps quite easily to $h[n] = ({1 \over 2})^n u[n]$, however I read or heard, not sure where though that the impulse response obtained from the frequecy response must be continuous, under that assumption we would replace $e^{j \Omega}$ with $\$$ giving us $h(\$) = {\$ \over $ - {1 \over 2}}$, the we would Laplace anti-trasnform to obtain the impulse response, so which approach would be the correct one? maybe I'm confusing concepts.

Now for the sake of completenes for the fourier espectre we just obtain the magnitude ($|h[\omega]|$) and phase of $\theta_{h[\omega]}$ and evaluate them over a set of $\omega$ values, plotting the results.

Thanks in advance.


texts: Different results for seperable filtering v/s direct filtering on 2-D image in MATLAB

texts:
I compared the difference between seperable and direct filtering for MATLAB's cameraman image. The difference is huge. I would like to understand the reason for this. Code below.

I = imread('cameraman.tif');

% Do seperable 1-D filtering
H = 11;
sigma = 2;
g1 = fspecial('gaussian',[1 H],sigma);

I2 = double(I);
I_seperable = double(I);
for i = 1:size(I,1)
   I2(i,:) = imfilter(double(I(i,:)),g1,'circular','same','conv');
end
for j = 1:size(I,2)
  I_seperable(:,j) = imfilter(double(I2(:,j)),g1,'circular','same','conv');
end

% Do direct 2-D filtering
g2 = fspecial('gaussian',[H H],sigma);

% How much do the results differ ?
I_direct = imfilter(double(I),g2,'circular','same','conv');
delta_I = double(I_direct) - double(I_seperable);
norm(delta_I,'fro')

The result of last computation

ans =

    2.1879e+03


texts: Is this piecewise-defined system time-invariant?

texts:
\begin{equation}
  G_c \qquad y[n] =
    \begin{cases}
      u[n] & \text{if} & n<0\\
      2u[n] & \text{if} & n\ge 0
    \end{cases}
\end{equation}
I found this question in web: Whether or not is this time-invariant. The short answer is no. But I want to make sure I know how to prove this.
Let's take a certain $n<0$ then $y[n] = 2u[n]$. Now, let's put instead of $n \rightarrow (n + n_0)>0$. Since, it is time-invariant then $y[n+n_0] = u[n+n_0]$.
But $(n+n_0)>0$, so $y[n+n_0] = 2u[n+n_0]$. So the only chance is: $u[n+n_0] = 0$, but since $n$ and $n_0$ where randomly chosen then, this system can be time-varying as long as always $u[n+n_0]=0 \rightarrow u[n] =0$ and $y[n] =0$ which doesn't hold as a system. So it is not time-varying. Does this makes sense?


texts: Reversing the Order of Operators for Edge Detection?

texts: Usually, for edge detection, we perform smoothing and then pass it through difference filter. What if application of difference filter happens first and then smoothing. How the math behind the same will change?


texts:
I'm trying to create a low pass FIR filter using the coefficients I found in ITU 1770-3 on page 18. This is the last piece of the puzzle for an audio loudness metering algorithm I'm working on.

I'm not super familiar with digital filters in general, but so far I've been able to create them using numerator and denominator coefficients. From there I can use filter(b,a,input) to process the audio.

But I'm not quite sure what to do with these 4 sets of coefficients. Am I supposed to get a set of numerators/denominators out of them somehow? What can I do to create an LPF out of these coefficients?

UPDATE: With some sage advice from @DanBoschen I have modeled the filter. Here is the response chart:


texts: Sample accurate real-time pitch shifting algorithm

texts:
I am trying to implement a phase vocoder overlap-add pitch shifting algorithm for part of a plugin I'm writing.  I have done this kind of thing offline before and I understand the theory, but this is the first time I've attempted to do realtime processing. This seems to add extra difficulty.

Here's my issue: the audio routing library I'm using gives me 1024 samples of audio at a time, and I must return 1024 samples of supposedly pitch-shifted audio each time.  I know that I can just use some kind of ring buffer or something to cache the samples needed for my overlap-add algorithm, but what do I return the very first time? That is, what do I do with the first 1024 samples of audio I'm given? It seems that with an overlap factor of 4, I would need at least 1792 (256*3 + 1024) samples before I could return my first 1024 samples, because of the overlap requirement.

Am I doomed to just output silence the first go-round, until I get enough samples to actually start doing the algorithm? It doesn't seem ideal to delay the audio, even if only by a couple of milliseconds. I would like it to be sample accurate if at all possible, even if there's a slight drop in quality for the first few windows of data.

thanks in advance


texts: Generate and Recognize Graphical Patterns

texts:
I'd like to develop an algorithm for recognizing and generating graphical designs. As an example, consider these examples from one class:

class 1 example 2 http://185.49.85.137/Kave/up/Decorative-Leaves.jpg

Two examples from another class:

I want to detect which class the query image belong to, as well as possibly generate a new sample from the class.

Do you have any idea how this could be done?


texts:
I am new to DSP, and I am self-studying. I came upon this question, and I am stuck at it. Could someone please help me? Here is the question:

  In order to digitally create a sinusoid with frequency $f$ = 440 Hz, you
  will need the normalized angular frequency $\omega$. How large is $\omega$
  for a sampling frequency $f_s$ = 16 kHz?


texts: Are there any tools for generating fixed point filter implementations?

texts:
It's very easy to make a filter in Scipy or many other tools, but implementing this filter in fixed point in C or VHDL/Verilog is always a chore. I mean, in theory it's just a matter of adequately rounding and scaling the coefficients and then scaling the result back down. In practice "adequately" is a big word.
It seems fairly doable to take the Scipy output and write a little loop that scales the coefficients until they meet a certain error threshold and then calculate the number of bits needed and feed them into some template implementation.
I'm just thinking, surely I'm not the first one ever to design fixed point filters and people have come up with more optimal and automated approaches than doing it completely by hand?
Maybe some ungodly combo of Matlab toolboxes can do it? So far the filter toolbox and the C/HDL toolbox don't like what I'm doing though. fdesign.lowpass is not supported for code generation Also not a huge fan of Matlab, so if there is an FOSS solution, that would be preferable.


texts: What is special about the theorem that over GF(2), $f^2(X) = f(X^2)$?  There is a some 10-line proof for the same in "page no.42, Shu Lin, Daniel J. Costello-Error Control Coding (2nd Edition)-Prentice Hall (2004)"  I think the fact is more general and can be proved straight away.  I feel that  $f^m(X) = f(X^n)$ because in GF(2), $A^m=A=A^n$ where A is any polynomial, variable or constant from/over GF(2)and m and n are any two positive integers.  Am I missing some important point here?


texts:
Given a discrete signal $ r(nT_c)$ specified at a rate $T_c$, assume we want to resample with a 3/2 rate change to match the sampling rate of some other signal.

We would like to upsample it by 3, then filter it by filter of length $K$ and then downsample by 2.

Also assume we have the following relationship exists $$ \frac{3}{2}T_s = T_c$$

Step 1: Upsample then we have

$r'(n\frac{Ts}{2}) = \left\{ \begin{array}{ll}
        r(n\frac{Ts}{3}) & \mbox{if $n = 0,3,6$};\\
        0 & \mbox{if OW}.\end{array} \right.$

Step 2: Filter

$\hat{r}(n\frac{Ts}{2})= \sum_{k=0}^{K-1}r(\frac{(n-k)T_s}{2})h_{filter}(k)\,\,\,\,\,\,\,n=0,1....$

Step 3:

$r_o(nT_s)= \hat{r}(n\frac{Ts}{2}-\underbrace{\frac{K-1}{2}\frac{T_s}{2}}{???}) \,\,\,\,\,n=0,1,$

I don't understand two of the above steps

1) why do we need use a filter to resample and

2)  why isnt it the part underbrace $$\hat{r}(n\frac{Ts}{2}) \,\,\,\,\,n=0,1,....$$

Thank you very much.


texts: Element-wise powering vs. discrete version of binomial theorem on a sum of Gaussians

texts:
I had recently posted a question on applying powers on a sum of Gaussians (here) to enhance signal resolution artificially. The discussion has given rise to another query. Consider this problem. We have two Gaussian time functions $G_1$ and $G_2$. Suppose we wish sum these Gaussians and raise it to a power of 2.

Situation no. 1: $(G_1+G_2)^2$, we should get another function $G$= $G_1^2$ + $2G_1G_2$ + $G_2^2$. The product of two $G_1G_2$ is another Gaussian. We should see three peaks in this case.

Situation no. 2: We sum the two Gaussians element wise i.e., $S_i$ = $g(t)_{1i}$ + $g(t)_{2i}$ where $g(t)_i$ 's are the corresponding elements of $G_1$ + $G_2$. Now each summed element $S_i$ is raised to power 2. We get only two peaks as a result.

I discussed this issue with some of my colleagues including the person who had proposed this method; they seek agree that both operations are equivalent. It seems they are not, because in situation 2, we will never see $G_1G_2$. What would the discrete version of situation 1?

I feel there is some fallacy here and some mathematical insight should be able to settle this problem.

Thanks.

For Situation no. 2: Here is the MATLAB code.

t=[0:1/200:60]';

u1= 19; % mu the mean time peak i

u2= 22; % mu the mean time peak j

A= 250; %Area

s_ij=[0.84 0.87];; %s_ij represent the sigma of i,j pair; Choose elements by indexing

G_ij=A*normpdf(t, u1, s_ij(1,1))+ A*normpdf(t, u2, s_ij(1,2)); %Sum normpdf is a built in function for a unit area Gaussian from statistical package.

Power= (G_ij).^2;

subplot(2,1,1); plot(t,G_ij);title('Unresolved Gaussians');

subplot(2,1,2); plot (t, Power);title ('Gaussian Sum Raised to Power 2');


texts: Chroma key algorithm with unknown background color

texts: Suppose that I have an image with a foreground subject and a monochrome background. The image is a real world picture so the pixels belonging to the background do not share the same exact value. I want to isolate the foreground but I don't know the background color in advance. What are the state of the art algorithms to achieve this goal?


texts: For discrete signals, why does phase change not correspond to time shift?

texts:
I'm going through a Signal Processing lecture where the professor mentions this fact and the argument given is:
Suppose you have a sinusoidal signal: $Acos(\omega t)$

Now if you change the phase of the signal: $Acos(\omega t + p)$ then if it would correspond to a time shift, then
$Acos(\omega t + \omega t_0) = Acos(\omega t + p)$

So, $t_0 = p/\omega $

And this can't always have integral values, which is contradictory since we're considering the discrete case.

My argument is that, since we're considering the discrete case, the value of 'p' will be restricted to a certain set of values, right? And these values will only be those for which p/w is an integer.

According to the definition here the phase ($p$ here) gives you how far the signal is in it's cycle. So by default the value of $p$ would only be those values that allow p/w to be integral, since our signal is discrete right? What am I missing here?


texts: How is the complexity of applying Short term fourier transform over n samples with a moving window of size m amount to O(nmlogm)

texts:
I have been trying to understand a publication here where Short time fourier transform is applied over n samples in steps of m samples each (m is the size of the moving window). I understand that the computational complexity of the Short time fourier transform for m samples is mlogm.

The operation also consists of extracting energy from the samples. Since there are m samples in the window, I believe it should be O(m) in the worst case.
So , as per my understanding, the complexity of the whole operation should be
O(n/m * (mlogm + m)) = O(nm). Since there n/m windows and each window has mlogm for fourier transform and m for signal strength extraction.

But the publication shows the complexity as O(nmlogm). Please help me understanding this.


texts: Wavelet image denoising: dual-tree versus double-density

texts:
What is the main difference between the dual-tree DWT and the double density DWT  image denoising techniques?

How does the combination of them improve the quality of the denoised image?


texts: Apply Principal Component Analysis (PCA) for RGB Images

texts:
I've implemented a method to compute PCA on grayscale images.

I haven't seen PCA on RGB images yet, which left me wondering if it is possible to perform it.

With RGB images, is PCA done for each color channel separately? If so, is there any loss of information or inconsistent data when you combine the three channels?

The code I used is from the Medium blog post PCA (Principal Components Analysis) Applied to Images of Faces.

Does anyone know of any PCA implementations for RGB images?


texts: Powers of $z$ in a discrete transfer function

texts:
I have been working with discrete-time systems and I am not yet able to understand the reason behind using powers of $z^{-1}$ in transfer functions.

I get that $z^{-1}$ means a delay, but when we write a transfer function like this, usually some zeros/poles disappear, I can't see what is the practical use of this notation.

For instance, take
$$H(z) = \frac{1}{(1-\frac{1}{2}z^{-1})(1-\frac{3}{4}z^{-1})}$$

If we multiply by $\frac{z^2}{z^2}$ it becomes
$$H(z)=\frac{z^2}{(z-\frac{1}{2})(z-\frac{3}{4})}$$
and we can clearly see that there are two zeros and two poles.


texts:
I want to segment the following signal (units are x: [px], y: [a.u.]) and need a good way to do so. I want to achieve the following:

I am only interested in the two wide "plateaus" with maximum value (e.g. (1) from ~400px to ~800px and (2) from ~1300px to ~1800px).
Ideally would like the solution to be parameterless.

In the figure the blue line is the original signal and the orange line is the signal filtered by savgol_filter(signal, 51, 1).

I have tried Otsu's method, but it is not optimal, because it is intended for separating a foreground from the background. This is not the case here, which is why I had to do the smoothing (which introduces a parameter(!)) to reduce the noise in the side-peaks, so that they do not "leak" into the foreground, when using Otsu.

I have considered using the derivative of the signal, which should be very strong the flanks of the plateaus (see second figure), but here again the noise in the side-plateaus is causing an issue.

So what would be a good way to segment this signal?

Signal to segment:

signal_filtered = savgol_filter(signal, 51, 1)
plt.plot(signal)
plt.plot(signal_filtered)
plt.show()

Differential of signal and smoothed signal:

plt.plot(np.abs(np.diff(signal))), plt.plot(np.abs(np.diff(savgol_filter(signal, 51, 1)))), plt.show()

EDIT:

Signal with single, non-flat plateau:


texts: Can someone help me with ETSI/BRAN Indoor wireless channel specification and implementation in MATLAB

texts: I want to implement ETSI/BRAN Indoor Model A channel, i have the delays for the paths tau=[0 10 20 30 40 50 60 70 80 90 110 140 170 200 240 290 340 390]*10^(-9); and the Average Relative Power (dB) pdb=[0 -0.9 -1.7 -2.6 -3.5 -4.3 -5.2 -6.1 -6.9 -7.8 -4.7 -7.3 -9.9 -12.5 -13.7 -18 -22.4 -26.7]; and i want to create time varying channel using Mont Carlo Method (i have no idea about it), please help me how can i implement it in matlab


texts: What are reasonable levels for the ERLE (Echo Return Loss Enhancement) in acoustic echo cancellation?

texts: I am working on acoustic echo cancellation which has a double talk detector. During the single talk, the ERLE (Echo Return Loss Enhancement) exceeds 100dB and during double talk around 20dB to 40 dB. I have read few papers and saw that for a good echo canceler the ERLE should be between 40-50dB. Am I going wrong anywhere? Is is ok to get such high ERLE?


texts:
I'm trying to implement this GMSK demodulator.

Is the input to deviator in degrees? do I have to change it to radians?

Does the output of the deviator has to be NRZ or Have to convert it to NRZ?

I'm doing quadrature demodulation so I've to multiply the quadrature components of the incoming signal with $\cos(n\omega_0)$ and $\sin(n\omega_0)$. right?
In this diagram, the incoming signal is $cos(n\omega+\phi)$ which was the resultant output of adding the quadrature components of the GMSK modulation part. I am unable to understand this.

I'm done with the modulator part.


texts: Classifying this signal in dimension and number of channels

texts:
The question is:

"Weight and height measurements of a child taken every month"

Classify this signal as:

one/multidimensional
single/multichannel

I'm not understanding how this can be described as a signal and hence how can it be classified.


texts:
The signal $$x(t)\;\;\;\;0\leq t\leq 0.2s $$

We know that the CTFT of $x(t)=0$ when $|w|>2*\pi*10^4$

We sample $x(t)$ in sample space of $$T=25\mu s$$ or $$F_s=1/T=40000Hz$$and we get a series with length of 8000.

$$x[n]=x(nT)\;\;\;\;0\leq n \leq 7999 $$

We calculate the DFT of $x[n]$ in size 8000 also.

What is the relation between the CTFT to the DFT

$$X^F(\omega) \rightarrow X_N^d[k]$$

The answer is:

$$
\begin{equation}
  X_N^d[k]=\begin{cases}
    \dfrac{N}{T}X^F(10\pi k), & 0\leq k\leq 3999\\ \\
    \dfrac{N}{T}X^F(10\pi (k-8000)), & 4000\leq k\leq 7999
  \end{cases}
\end{equation}
$$


texts: Options for DSP hardware for Under Grad Lab?

texts:
We have TI 6713 dsp kits in our Lab but since those kits are very old(They were started/released near 2000) we are now considering to get new dsp kits ,so our under grad students may clear their hardware concepts related to dsp in a better way
I have seen a question on DSP SE that is some how relevant and  especially the answer of Hilmar there.
But am i bit confused?
Is it okay to use kits like Rasberry PI or Aurdino,for teaching dsp Lab to under grad students?especially as alternative option to dsp kits of TI or Analog devices
If possible,Please also recommend other hardware options
Link of relevant question
Hardware kits for DSP Lab?


texts: FFT of image data: "mirroring" to avoid boundary effects

texts:
I load and display an image of some rice in Matlab:

g = imread('rice.png');
imshow(g);

I take the FFT of this image and shift it:

G = fft2(g);
imshow(log(abs(fftshift(G)) + 1), []);

If I place a x and y axis trough the center of the image; I find that the image is symmetric g(-x,-y)=g(x,y). For a 1D signal we have that the FFT of a real signal has a symmetrical real part and an asymmetrical imaginary part. I guess that is what we see here in 2 dimensions?

Since the original image is darker at the bottom than at the top, there is a strong horizontal discontinuity at the periodic boundary causing the vertical line in the FFT.

I want to get rid of this boundary effect. A common approach to this seems to be windowing.

However I want to solve this problem by a technique I found in a paper called "mirroring".
The paper was not very specific so I need your help in figuring out this approach :-).

First I create a symmetric "tile" from the original image:

tile=[flipdim(g,2) g; flipdim(flipdim(g,1),2) flipdim(g,1)];
imshow(tile);

Now I take the FFT of this "tile":

Tile=fft2(tile);
imshow(log(abs(fftshift(Tile)) + 1), [])

The vertical line seems to be (almost) gone: good.
However the mirroring seem to have introduced more symmetry.

What is the correct result: the FFT of the original image or the FFT of the "mirrored" image?

Is there a way I can "mirror" so that I both get rid of boundary effects and get a purely real FFT?

Thanks in advance for any answers!


texts:
Hello I'm reading the following document to better understand windowing and how to use it.

  "Spectrum and spectral density estimation by the Discrete Fourier
  transform (DFT), including a comprehensive list of window functions
  and some new  at-top windows."

You can find the file overhere

I try to reproduce their example (chapter 13) on audio signals but i have some questions.
Just like the example i use the Hann(ing) window. with a overlab of 50%
For reproducion i use python

Let say i have a typical Audio signal with a fs of 44100 Hz and a length of T = 5 sec.
I have a window of 0.1 sec(neglecting the nice length of N).
With the overlab i get an matrix of 100(Windows) X 4410 Samples.

I have two questions

Normaly i see just a single Spectrum plot (exept STFT). How come i from a my set of spectra to a single spectrum? Like what Audacity have
Averaging; summing; ... other
what is the impact of changes in time at the resulting spectrum. Let say using a (measured) sweeping signal?

Hope that somebody can help me now


texts: Identifying the boundary points of a shape based on the centroid

texts:
I have a set of binary 2D images with objects in white and their boundaries in black (attached example). I also have a list of centroids (x,y coordinate pairs) identifying all objects.

For each object, I am trying to identify all the x,y coordinates of that object's boundary (black pixels). Anyone have an idea on programming logic that can help achieve this?

I apologize in advance if this post belongs in another section. If anything is unclear I can clarify. Thanks.


texts: Design of 10th order high pass filter using 2nd order biquads with Matlab and further substitution on to TI AIC3204

texts:
I am involved in designing a 10th order high pass filter with cutoff frequency 300Hz.

My hardware AIC3204 has a 5 biquads of direct form I, 24bit coefficient
so I have chosen the FDA (filter design and anylysis) tool of MATLAB to design a 10th order filter and convert it to SOS sections 5 such and realize coefficients from it.

This is my procedure:

and realization of direct form I

Coefficients obtained as a file:

%
% Generated by MATLAB(R) 7.12 and the Signal Processing Toolbox 6.15.
%
% Generated on: 05-Aug-2013 15:26:23
%

% Coefficient Format: Hexadecimal

% Discrete-Time IIR Filter (real)
% -------------------------------
% Filter Structure : Direct-Form I, Second-Order Sections
% Number of Sections : 5
% Stable : Yes
% Linear Phase : No
% Arithmetic : fixed
% Numerator : s24,22 -> [-2 2)
% Denominator : s24,22 -> [-2 2)
% Scale Values : s24,23 -> [-1 1)
% Input : s16,15 -> [-1 1)
% Output : s16,11 -> [-16 16)
% Numerator State : s16,15 -> [-1 1)
% Denominator State : s16,15 -> [-1 1)
% Numerator Prod : s40,37 -> [-4 4)
% Denominator Prod : s40,37 -> [-4 4)
% Numerator Accum : s40,35 -> [-16 16)
% Denominator Accum : s40,35 -> [-16 16)
% Round Mode : convergent
% Overflow Mode : wrap
% Cast Before Sum : true

SOS matrix:
400000 000000 c00000 400000 7ab444 3b9018
400000 000000 c00000 400000 8bd4b8 377a90
400000 000000 c00000 400000 7404d3 34d7f8
400000 000000 c00000 400000 976d93 2b9955
400000 000000 c00000 400000 067eae d364fd

Scale Values:
77c3b6
77c3b6
6f5fe0
6f5fe0
6c9b03

Is my approach correct?

How can these higher order SOS filters be realised?


texts:
I'm trying to detect and classify non-speech sounds. Currently, I'm using a series of moving overlapped power spectrums from training sounds as the features I am looking for.

When I do analysis, I'm just computing the same amount of overlapped spectrums so that the number of features are the same. Right now the performance is not very good, it can only detect silence vs non-silence.

What techniques are there for this type of signal detection? One of my concerns is that for sounds of different lengths in the time domain would result in different lengths of feature vectors which so I can't use the same classifier, I'm stuck on this.


texts: oversampled coefficient for existing exponential smoothing

texts:
Say I have an exponential smoothing for certain $\Delta t$, $t_{i+1} = t_i + \Delta t$. In this sampling, I choose a particular $\alpha$ to filter signal $z_i$ like
$$
v_1 = z_0 \\
v_{i+1} = \alpha\:z_i + (1-\alpha)\:v_i
$$

and we have some sort of agreement as to what $\alpha$ to use.

Now, someone comes along and tells me that I am able to get, say, five times more samples in the same $\Delta t$ period. I need to modify the smoothing factor $\alpha$. It seems to me, intuitively, that the new factor, say $\alpha'$, that has the same discount effect for previous values but with five times more iterations should be
$$
(1-\alpha')^5 = 1-\alpha
$$

Is this correct? Is there any principled approaches to justify this?

Note: The formula above seems sensible in the sense that the original asymptotic variance (for a constant model)
$$
\mathbb{V}ar[v] \to \frac{\alpha}{2-\alpha} \sigma^2
$$
becomes
$$
\mathbb{V}ar[v'] \to \frac{\alpha'}{2-\alpha'} \sigma^2
$$
which, under the equation above, is actually smaller (I checked this). This makes sense as more data would give more precision for $v_t$ as estimator of a constant $z_t = k + \epsilon$, where $\epsilon \sim \mathcal{N}(0,\sigma)$.


texts: How does filter works in noise reduction?

texts:
On page 22 of the slide, the 1D array is [1, 1, 1, 1, 1], but the dots are uneven. Then why their values are the same?
What's the value of the point that the arrow is pointing at? Though it gives Moving average in 1D: [1, 1, 1, 1, 1]/5, what exactly is that value?


texts: Currently, I'm working on adaptive beamforming using LMS approach, so they change the value of the step factor adaptively in which one of the steps is to pass the weight vector through an alpha filter. SO I'm unable to get any appropriate texts on what it is. Can anyone help me out? Thanks in advance.


texts: Why does DPSK constellation shrink when noise is added?

texts:
I am generating a DQPSK waveform at complex base band with constellation points on the unit circle and when I add AWG noise the constellation shrinks.  The noisy constellation "blob" migrate inside the unit circle.  My question is why is this happening and is it supposed to happen or am I missing something?

My method of adding noise is:

Xnoise = X + sigma/2 * (randn(N) + 1j*randn(N))

where sigma is the overall standard deviation for the noise.  It's being divided by 2 since I'm using two separate randns for the real and imag parts and the two Gaussians added together give me the correct variance.


texts:
I'm reading "Digital Signal Processing", written by Michael Weeks. In section Representing a Digital Signal as a Sum of Sinusoids, there is this Matlab code that I cannot understand. (code given below)

What I don't get is what does the term inside cos argument 1/Xsize mean (in part %Do the sinusoids as discrete points only, I guess it is fundamental frequency, but how can we conclude it). And why is the whole function divided by Xsize.

Same thing with smooth0, smooth1, smooth2... I also don't get this smoothing process.

Thank you for any explanations, or links to helpful stuff.

%sum_of_sins.m
%Show a random signal as a sum of sins
%

%Make our x signal
x=round(rand(1,8)*10);
Xsize=length(x);

%Get FFT of x
X=fft(x);
Xmag=abs(X);
Xphase=angle(X);

%Show the freq-domain info as sum of sinusoids
%Find the IFFT (the hard way) part 1
n=0:Xsize-1;
%Do the sinusoids as discrete points only
s0=Xmag(1)*cos(2*pi*0*n/Xsize+Xphase(1))/Xsize;
s1=Xmag(2)*cos(2*pi*1*n/Xsize+Xphase(2))/Xsize;
s2=Xmag(3)*cos(2*pi*2*n/Xsize+Xphase(3))/Xsize;
s3=Xmag(4)*cos(2*pi*3*n/Xsize+Xphase(4))/Xsize;
s4=Xmag(5)*cos(2*pi*4*n/Xsize+Xphase(5))/Xsize;
s5=Xmag(6)*cos(2*pi*5*n/Xsize+Xphase(6))/Xsize;
s6=Xmag(7)*cos(2*pi*6*n/Xsize+Xphase(7))/Xsize;
s7=Xmag(8)*cos(2*pi*7*n/Xsize+Xphase(8))/Xsize;
%Redo the sinusoids as smooth curves
t=0:0.05:Xsize-1;
smooth0=Xmag(1)*cos(2*pi*0*t/Xsize+Xphase(1))/Xsize;
smooth1=Xmag(2)*cos(2*pi*1*t/Xsize+Xphase(2))/Xsize;
smooth2=Xmag(3)*cos(2*pi*2*t/Xsize+Xphase(3))/Xsize;
smooth3=Xmag(4)*cos(2*pi*3*t/Xsize+Xphase(4))/Xsize;
smooth4=Xmag(5)*cos(2*pi*4*t/Xsize+Xphase(5))/Xsize;
smooth5=Xmag(6)*cos(2*pi*5*t/Xsize+Xphase(6))/Xsize;
smooth6=Xmag(7)*cos(2*pi*6*t/Xsize+Xphase(7))/Xsize;
smooth7=Xmag(8)*cos(2*pi*7*t/Xsize+Xphase(8))/Xsize;
%Find the IFFT (the hard way) part 2
my_sum_of_sins=s0+s1+s2+s3+s4+s5+s6+s7;
smooth_sum=smooth0+smooth1+smooth2+smooth3+smooth4+smooth5+smooth6+smooth7;

%Show both discrete points and smooth curves together
xaxis1=(0:length(smooth0)-1)/20; %for 8 points
xaxis2=(0:length(s0)-1);

figure(1);
subplot(4,1,1); plot(xaxis1, smooth0, 'g', xaxis2, s0,'r*');
subplot(4,1,2); plot(xaxis1, smooth1, 'g', xaxis2, s1,'r*');
subplot(4,1,3); plot(xaxis1, smooth2, 'g', xaxis2, s2,'r*');
subplot(4,1,4); plot(xaxis1, smooth3, 'g', xaxis2, s3,'r*');

figure(2);
subplot(4,1,1); plot(xaxis1, smooth4, 'g', xaxis2, s4, 'r*');
subplot(4,1,2); plot(xaxis1, smooth5, 'g', xaxis2, s5, 'r*');
subplot(4,1,3); plot(xaxis1, smooth6, 'g', xaxis2, s6, 'r*');
subplot(4,1,4); plot(xaxis1, smooth7, 'g', xaxis2, s7, 'r*');


texts: Digital to analog aliasing or mirror query... DAC can output negative frequency?

texts:
Using a clock Fs = 1 MHz.

The Digital to Analog (DAC) can make frequencies upto 500 KHz.

500 kHz to 1 MHz is an alias? Or is it called a mirror?? Is aliasing a concept only on the ADC and sampling process.

Does -500 to 0 exist as an alias or mirror too... But surely a DAC can't make negative frequencies? Texas Instruments tutorial on DAC has the attached screen shot showing a DAC outputting a negative frequency.

Is anything different for a DAC with complex samples such as on an ADC complex sampling allows frequencies upto Fs instead of Fs/2...!

Block diagram in this link


texts: Is the value of a discrete time signal 0 when the index is a non integer value?

texts:
Is it safe to assume that if the index of discrete signal is not an integer, then the value of it is 0? For example is the following true:

If we have $x[n] = 1 + (−1)^n$ does $x[3/4]=0$?

The TA in my Digital Signals class is saying that this notion is correct, however the general consensus from what I've seen from Google is that $x[3/4]$ should be undefined, not zero.


texts:
I have an x-axis which is in logarithmic scale representing frequency, I would like to have NumPoints on this axis that are equidistant on the log scale, I have the following variables:

Fmin = 100
Fmax = 4000 or 8000
NumPoints = 10

What formula should i use to calculate where the NumPoints-2 points between Fmin and Fmax should go? (Fmin and Fmax should each have a point on them)

Additionally, when i switch from Fmax = 4000 -> 8000 i would like to keep the equidistant points already calculated between Fmin->4000 and add extra points between 4000 and 8000.

Summary

Generate NumPoints between FMan -> Fmax(4000), equidistant on a log scale.
Change Fmax -> 8000
Generate more points between 4000->8000.

Many thanks in advance

Andy


texts: How to filter out everything but a single frequency in the time domain?

texts:
I'm new to signal processing and would like some insights about the best way to filter simple data without being too computationally intensive.

I have an audio signal and I want to extract a single frequency (21khz) from it.
This frequency represents whether something is on or off.
I figured a simple amplitude threshold would do the trick to guess the on or off state but I can't think of a good way to single it out so I can threshold it.

I thought about doing it in the frequency domain but using the FFT seems a bit overkill.

I'm sorry if this is obvious but I'm not familiar with signal processing.


texts: Approximating the fourier coefficients from a discrete time signal

texts:
Suppose I have a discrete time signal $x_t$ sampled with a frequency $f_s$.  I know that if I take the discrete fourier transform of the signal and compute the power, I can easily (by visual inspection) determine which frequencies are the most important ones in the signal.  I know that the signal is the superposition of several sine and cosine funtions, but I want to determine the amplitudes of each of these functions; i.e. the coefficients $a_n$ and $b_n$ in front of the sine and cosine functions, respectively.

Is there a way to estimate these fourier coefficients of a discrete time signal?  How can I approximate them?  Is there a way to estimate them using only the information from the power spectrum from discrete fourier transform?


texts: How Discrete sequence could have more than one Frequency

texts:
I'm trying to understand Fast Fourier Transform in Detail to find out what exactly the frequencies when dealing with discrete sequence,

Here is what I've done,

First I've taken a Sinusoidal wave with 1Hz Frequency

A = 4;       %Amplitude

Fs = 8;      %Sampling Frequency 8Hertz
Ts = 1/Fs;   %Sampling Rate = 0.125

f = 1;       %Frequency of Wave = 1Hz
t = 1/f;     %Time period = 1 Second

n = 0:Ts:(t);  %{0,0.125,0.250,0.375,0.500,0.625,0.750,0.875,0.100}

x=A*sin(2*pi*f*n);

Now, If I plot it,

subplot(2,1 ,1);
plot(n,x);

The values of the sampled points are ,

Generated Sample's Amplitudes = {0,3,4,3,0,-3,-4,-3,0}

% Sinewave Period = (Samples/Period)*(Time/Sample)
% Sinewave Period = (8)*(0.125)
% Sinewave Period = 1sec
% Reciprocal of 1sec => 1Hz <-- Original Frequency

Now let's take its FFT by manually giving discrete sequence as input,

FFT divides your Sampling frequency into N equal parts and returns the strength of the signal at each of these frequency levels. What it means is you are dividing frequencies from 0 to 8(Fs) into 8(No.of Samples) equal parts.

F = fft([0 3 4 3 0 -3 -4 -3 0]);

and this is true.

But what if I take the FFT of completely Random Sequence, like,

fft([40 2 8 31 6 8 -4]);

Have a look at its Frequency Plot,

I've reading a book and found,

  Sinewave Period = (Samples/Period)*(Time/Sample)
  Freqeuncy = 1/Sinewave Period

In Random sequence I mentioned above have total of 7 samples, but What it its period ? What it is the time between each Sample in this signal since it is totally random ?
How could this sequence represents more than 1 frequency ?


texts: Why is the rectangular window called 'rectangular'?

texts: In what way does it have a rectangular shape? Does it have something to do with a polar-coordinates graph?


texts: Problem implementing deconvolution to recover an Impulse Response

texts:
I’m new to DSP programming and I’m trying to learn a bit about convolution and deconvolution and FFTs.  I have a project where I am taking a signal (a sine sweep) and convolving it with a shorter Impulse Response.  Then I take the convolved signal and deconvolve it with the original signal to recover the IR. I’m writing this in C using the Accelerate Framework’s vDSP functions on OS X. The output from the convolved stage is as expected, though scaled as discussed below, but the output from the deconvolve stage doesn’t match the original IR.

In the convolve stage I get a length for my FFT, N, as close as possible to double the length of the IR like this (because the vDSP_fft_zrip() function takes a power of 2 parameter for the FFT length[1]):

vDSP_Length log2_N = ceil(log2(irLengthInSamples * 2));
UInt32 N = pow(2.0, log2_N);

I pad the signal out with 0s to be a multiple of N, and pad the IR out with 0s to length N. I iterate through the signal, taking N/2 samples and padding out to length N with 0s, FFT both this padded signal chunk and the padded IR, multiply the results, and IFFT back to the time domain.  I scale the results by multiplying by 1/2N to compensate for the scaling introduced by the forward and inverse calls to vDSP_fft_zrip() [2].  Then I overlap-sum each iteration’s results in to an output array of length signal+IR.

The convolved output signal seems fine, except that it is has a peak loudness of around +10dB (the input signal is at -12dB and the IR has a peak of -15dB).  This seems weird, but I don’t know enough to know if this is expected or not.  So I normalise the convolved output to 0dB.  Normalising or not doesn’t make any significant change to the output of the deconvolve stage..

For the deconvolution stage, I figure the IR length to be the convolved signal length minus the original signal length, and create an FFT length like this:

irLengthInSamples = (convolvedSamplesCount - signalSamplesCount)
vDSP_Length log2_N = ceil(log2(rLengthInSamples));
UInt32 N = pow(2.0, log2_N);

I pad the convolved signal out to be a multiple of N, and pad the original signal to the same length.  Then I iterate through them in chunks of N length.  N samples of the convolved signal and N samples of the original signal are each FFT’d and the frequency values for the convolved signal are divided by the frequency values of the original signal. The results are IFFT’d, scaled again by 1/2N and summed into an output array of length N.

But the output does not match the original IR.  The image below shows the original IR waveform on top and the deconvolution output on the bottom.

One issue I'm aware of is that because the original signal is padded at the end with 0s, the last iteration through the deconvolve loop includes division by 0, producing NaNs.  I’ve been handling this by replacing NaNs with the equivalent samples from the convolved signal before summing them, but I suspect I shouldn’t be getting into this situation in the first place.

Can anyone point out where I'm going wrong?  As I said, I'm new to DSP programming so I suspect I may be making a fundamental mistake somewhere.

[1]
https://developer.apple.com/library/Mac/documentation/Accelerate/Reference/vDSPRef/index.html#//apple_ref/c/func/vDSP_fft_zrip

[2] https://developer.apple.com/library/mac/documentation/Performance/Conceptual/vDSP_Programming_Guide/UsingFourierTransforms/UsingFourierTransforms.html#//apple_ref/doc/uid/TP40005147-CH202-15952


texts: Need to batch detect, measure, calc DPI for a consistently placed ruler in large set of technical images

texts:
I have a large set of photographs of pieces of rocks. In each photo there is a 4 inch ruler bar placed next to the rock, consistently on the left near the edge, see example:

Over 10 years the photographers moved in and out, and used different file resolutions.

I need to normalize all of them to the same DPI before I can stitch them together.

I have approx 10,000 to process...

Thank you in advance and any thoughts?

R


texts:
I have a raw signal which, if interpreted correctly with various 'tuning' parameters set to their optimum values, can be seen to consist of a relatively small (but a priori unknown) set of discrete frequency components. With the tuning parameters set at sub-optimum values, the power spectrum is spread out - each frequency component is broader or, in the very poorly-tuned case, there can be many 'false' frequency peaks. Some example plots would be:

Good tuning:

Poor tuning:

Awful tuning:

What I'd like is to be to able to auto-tune by identifying a figure-of-merit which is highest for the 'good tuning' case, lowest for the 'awful tuning' case, and somewhere in the middle for the 'poor tuning' case. If I knew a priori that there was a single frequency component, this would be fairly straightforwrad but I haven't been able to think of a good appraoch when the number of components is unknown.

Is there a standard approach to this problem that I'm unaware of?


texts: Topological skeleton matching techniques

texts:
What are the most common and best topological skeleton matching techniques?

Suppose I have skeletonized object and corresponding 2D model of this object. What are the next steps to match pattern? What are skeleton descriptors?

If someone could give code examples, reference to some open source projects using skeletonization and matching I would be grateful.

I want a method that will work also when skeleton is lack of some part of it due to bad object detection, but any suggestions are appreciated.


texts: How to remove ECG artifacts from EMG data?

texts:
I'm new to signal processing and try to analyze EMG data from pectoralis major and other respiratory muscles. Unfortunately, there are strong ECG artifacts in all recordings and I don't know how to remove them from my data.

My data looks like this:

In my experiment, there are two expected EMG-events, that should be at around second 2 and 8 of the recorded data:

I'm working with python and matlab and couldn't find code-examples for this specific problem.

My sampling rate is 4000 Hz. Here is an example of the EMG-data.

Thanks a lot for your help!


texts: Frequency response of system with feedback and feedforward co-efficients?

texts:
For seismological application, I am playing with an elliptical filter, and once I have both sets of feedback and feedforward co-efficients, how do I make it so that I can plot the frequency response of the system? Can I also use the same technique to make the frequency response for a bessel?

I know that I can take the FFT for an FIR filter and I can get its transfer function, but for a non-FIR, is there a way also using the FFT?


texts:
I'm trying to understand PSD, and, it's functions.
So far I have carried out the following:

Segmented a signal with NFFT = 256 and hop_size = 128
Windowed each of these segments (Hamming)
DFT of each Window
Taken the first half of the resulting matrix (n/2+1)

From what I have read so far, the algorithm can be best described as the following:
We take the squared magnitude of the LENGTH NFFT, we calculate this by: mag = (bin.re * bin.re + bin.im * bin.im). This gives the magnitudes of each of the points in the DFT bin.
Q1: These are "averaged" to form Pxx Pxx is a bin of size NFFT/2+1 which I assume store the averages, but, do these store the averages for each of the bins? Because I don't quite understand:
If I have a resulting 2D matrix containing values:
a = [[1, 2, 3, 4, 5, 6, 9, 8],
     [2, 5, 8, 9, 7, 8, 9, 7],
     [4, 5, 6, 4, 7, 8, 9, 8]

I then take the "average" of these.. I.e. (1+2....., n)/NFFT/2+1. This is only going to give one value, for each of the bins?
OK, so now onto Scaling. Can we therefore scale to the Frequency? If so, do we scale by Fs * window_size
EDIT:
I don't think my last question made that much sense..
So far I have a 2D vector containing 146x128..
block1 = [1, 2, 3, ...... n] (where `n` is 128)

block2 = [0, 5, 6, ...... n]

.....

block146 = [1, 4, 5, .... n]

Now, if I calculate the average magnitude of each of these blocks, i.e. sum(sqrt(re*re+im*im))/128 this will give me the averages for each block (a vector containing 146 samples).
For each of my samples in the blocks do I therefore divide each of these by the average magnitude for that particular block? I.e.
block1 = [0, 1, 2, ...... n]
average = (0+1+2)/128 = 0.58 (for example)

result = [0/0.58, 1/0.58, 2/0.58.... n]

Therefor my resulting vector will still be a 2D vector.
Does this make sense?
EDIT:

1 - What type of signal are you trying to process? I.e: What type of application is it? Is it a unidimensional signal, like Audio sampled at 44.1Khz? Or is it a multidimensional signal like an image or video?

I'm trying to process a Audio signal.
What I have done so far is:
Taken a 1D input vector, this vector is then split into blocks (of size 256 with an overlap/hop of 128 this gives me a total of 146 blocks with each containing 128 samples. These samples have been multiplied by the Hamming Window and then a DFT has been passed through.
These blocks contain the resulting values after Windowing and DFT has taken place.
2 - Where are you performing these calculations? Matlab, Octave, python, or some other?

I am performing these calculations using C++
3 - When you say 2D vector (maybe could be less confusing to call this a Matrix), What does the numbers inside mean? what are the columns and what are the rows?

The columns and rows contain the DFT results of the Hanning windowing of each block at 256/2 = 128
Essentially, what I'm attempting to do is create a spectrogram. Currently, I can plot the spectrogram with magnitudes of the values, i.e. (re*re+im*im) however, instead of plotting the magnitudes, I want to plot the overall power spectrum (PSD) so I can determine where the power is mainly within the signal.
If I do this using matplotlib I can get the following results:

So in theory, instead of showing the magnitudes which is what I'm currently doing, I want to show the PSD (like in the graph). I looked at the matplotlib source code and this is what was given:
result, windowVals = apply_window(result, window, axis=0,
                                  return_window=True)
result = np.fft.fft(result, n=pad_to, axis=0)[:numFreqs, :]

result = np.conjugate(result) * result

# for PSD
result /= (np.abs(windowVals)**2).sum()

result[1:-1] *= scaling_factor

# where scaling_factor is either 1 or 2

To me, the above code looks like they are taking the squared sum of the WindowValues (Which is Hamming) and dividing each value from the result (which is the resulting DFT) and finally multiplying by the scaling factor.
Does this look correct?


texts: maximum output of a LTI system within linear limits

texts:
In book , 'fundamental of signal and system'by M.J ROBERT it is written that

  Since no practical system can ever produce an unbounded response, strictly speaking, all practical systems are stable. The ordinary operational meaning of BIBO instability is a system described
  approximately by linear equations that would develop an unbounded response to a bounded excitation if the
  system remained linear. Any practical system will become nonlinear when its response reaches some large
  magnitude and can never produce a truly unbounded response. So a nuclear weapon is a BIBO-unstable system
  in the ordinary sense but a BIBO-stable system in the strict sense. Its energy release is not unbounded even
  though it is extremely large compared to most other artificial systems on earth

For a given LTI system, what parameter of system along with input which  determines the maximum magnitude of response after which it becomes non linear and how to calculate this maximum magnitude of response mathematically?


texts: BPSK and QPSK demodulation computational complexity

texts:
I wanted to ask about the real operations of BPSK and QPSK demodulation. How can we calculate it?
I mean for example if I have a received symbol +0.6, then I need to demodulate it to be 0 or 1. what's the computational complexity required for that. same for QPSK.


texts: Physically understanding autoregressive model (really basic question)

texts:
I would like to basically understand what an autoregressive model is used for (so I don't really attempt maths in the answers).

I just started a signal processing course and the model was introduced.

This is what I understood but I don't think I understood it well :

We have $n-1$ samples of a signal and we want to guess what the $n$'th will be.

With Young Walker, we have an approximation of the $n$'th sample that is : $\tilde{x}[n]=\sum a_k x[n-k]$

But $\tilde{x}[n]$ is just an approximation of $x[n]$.

So we have : $x[n]=\tilde{x}[n]+\epsilon$ where $\epsilon$ is the "error" I make when I use $\tilde{x}[n]$.

The autoregressive models assumes that $\epsilon$ is a white noise with average zero (and this makes sense because there is no reason in our model to have more often $\tilde{x}[n]>x[n]$ than $\tilde{x}[n]<x[n]$ ).

Did I understand the physical meaning of the model well ?

Thanks !!


texts:
I have done windowing and  fft on a signal but when I try to recover original raw signal ,I am unable to do it .Can anybody help me.
 How to take inverse fft of windowed and callibrated fft data?
Thanks in advance....


texts:
I am learning about space-time block coding and I am trying to understand why the rank criteria is a good measure of diversity gain. I know that we want to maximize the distance between codewords $X_i, X_j$, and I understand that $G_{ij} = (X_i - X_j)^H (X_i - X_j)$ is "bigger" when the two codewords are further apart, but i don't see how $rank(G_{ij})$ measures this matrix's "bigness."

Why does rank measure codeword detection error? It seems like we would want to consider the size of the values in $G_{ij}$, but this measure doesn't do that. Is there some eigenvalue stuff going on behind the scenes that I'm not seeing?

Thanks for any and all help!


texts: Can I use BRISQUE to compare different filtering techniques for the same acquired image?

texts:
BRISQUE compares your image with a pre-learned model with opinion scores. I am not sure about this but would image resolution affect the result of BRISQUE?
Moreover, if I have 2 filters and I would like to compare the results of using either filter to get the better result, can I use BRISQUE to quantify the better filter?
Additionally, if I have a 2-step filter, should I compare the result from each step with the previous image by using PSNR; that is step 1 against original and step 2 against step 1? or should I just apply the final result into BRISQUE?
Thanks to who can help me understand this better!


texts: AM-AM plot (input power vs output power) for power amplifier

texts:
I have modelled a power amplifier using weiner's model in matlab.
But when I finally plotted the input vs output power plot I got a plot that grows linear , then reaches maxima and then starts falling. As far as I know it should saturate after certain input power. Could someone tell me the reason for such behaviour? The input signal I am using is 20MHz LTE signal.


texts:
I'm looking at ways to improve the effective resolution of DACs. It seems that element mismatch (i.e. integral non-linearity) is the main contributor to distortion in modern DACs. Apart from calibrating current sources and trimming resistors -- what signal processing solutions exist to reduce distortion in DACs (that improves the (effective) linearity)?

To give a few criteria:

target rate should be around 100kS/s
Need 20 bit ENOB, best I can find 16 bit ENOB
Both requirement for 20 bit accuracy in DC, and low distortion in dynamic usage


texts:
I aquire typically 2D time traces which I process by a 2D Fourier transform. The aquisition is done line by line. First, I let the signal evolve for t1, then an action is performed that possibly changes its frequency and during t2 I sample the signal again in increments of dt:
    |  <<<----->>> | ------->
start       t1     A   t2

Using that scheme, I correlate the frequencies during t1 with those during t2.
However, my signal typically lives near the diagonal in the 2D FFT like this:

I wonder whether the sampling could be adjusted to reduce the large areas in the 2D FFT that do not contain any information. Hopefully this would allow to reduce the aquisition time. Is there any sampling scheme, that allows to sample around the diagonal in a 2D FFT? It would kind of mean that the delta frequency between time period 1 and time period 2 are assumed to be small.


texts:
I am working on balancing an air-spindle. For the unbalance analysis I use an accelerometer (NI device). I have the voltage signal from the accelerometer corresponding to the vibration of spindle at a particular frequency (rpm) saved in an excel file. To analyze the unbalance from this vibration signal I use the fft function in MATLAB. My data is sampled at a sampling frequency of $100,000\textrm{ Hz}$. I am using the same example code given in the fft documentation. The result of fft is as shown.

.

The present signal consists of signals of various frequency. How can I filter this result in order to get only the signal of frequency equal to my rotational frequency ($40\textrm{ Hz}$). I would need this signal to calculate the vibration phase and magnitude by comparing it with the tachometer signal. My MATLAB code looks like this:

%For vibration analysis of signal without any trial mass.

filename = '2400RPM.xlsx';
sheet = 1;
xlRange = 'C40:C516039';
x = xlsread(filename,sheet,xlRange);
T=1/100000;
L=length(x);
Fs=1/T;
t=(0:L-1)*T;
Y = fft(x);
mag1 = abs(Y/L);
mag = mag1(1:L/2+1);
mag(2:end-1) = 2*mag(2:end-1);
ph1 = rad2deg(Y/L);
ph = ph1(1:L/2+1);
ph(2:end-1) = 2*ph(2:end-1);
f=Fs*(0:(L/2))/L;

%PLOTTING RESULTS
%--------------------------------------

subplot(2,2,[1,2])
plot(t,x);
title('Vibration Signal: 2400RPM');
xlabel('Time (seconds)');
ylabel('Amplitude (voltage)');

subplot(2,2,3)
plot(f,mag);
title('Magnituge Plot');
xlabel('Frequency (Hz)');
ylabel('Amplitude');

subplot(2,2,4)
plot(f,ph);
title('Phase Plot');
xlabel('Frequency (Hz)');
ylabel('Phase (degree)');

Any help is much appreciated.


texts:
Does anyone know how does the "Songify" app algorithm work?

There are 2 inputs:

speech (or amateur singing), and
underlying music.

Somehow the speech is altered and mixed into the music. Which DSP algorithms are needed to achieve this effect?

Pitch-shifter?
Time-stretcher?
Fundamental (F0) frequency detection?
Auto-tune?
Else?

What would be the steps?


texts: I'm trying to automatically detect if an image is a collage vs a single photograph. I'm not too concerned with difficult cases of artistic collages. What I'm trying to solve is rectangular collages like below. I've tried edge detection (canny) + vertical and horizontal sobel filtering + line detection (Hough transform) to try to identify perpendicular lines but am getting too many false positives. I'm not very good at image processing so any input would be welcome. Thx!


texts: Parameter identification for PI controller

texts:
I have a PI temperature controller being used in experiments, which I am also trying to simulate. However, using the proportional gain and integral time as used in the experiments gives different outputs from the experiments.

Is there a way to determine the k_p and T_i of the controller using only the measured input and output temperatures? A linear regression on the difference between output and input temperatures as a function of the error and the integral of the error gives unrealistic results.

The (possibly incorrect) estimation code in MATLAB I used is:

error = T_target - T_in(1:end-1);
integ = cumsum(error.*diff(time));
ctrl_input_exp = T_out(1:end-1) - T_in(1:end-1);
fit_model = @(a,b,x,y) a*x + a/b*y ;
fittedmodel = fit([error,integ],ctrl_input_exp,fit_model);
fit_coeffs = coeffvalues(fittedmodel);
k_p = fit_coeffs(1);
T_i = fit_coeffs(2);


texts:
I want to implement 8x8 DCT and 8x8 KLT matrices to the 8-length vectors of 256x256 Lena image (e.g. each row of image there is 32 vectors 256/8 = 32 and for all rows 256x32 = 8192). I do the eigen analysis for finding KLT matrix in MATLAB as:

co = corr(I); % I is Lena image
co = co(1:8,1:8); % 8x8 autocorrelatin matrix
[V,D] = eig(co); % eigen analysis
eigval = diag(D); % eigen values
[desc, ind] = sort(eigval,'descend'); % sorting eigen values for optimum KLT
eigvec = V(:,ind); %sorted eigenvectors = 8x8 KLT matrix
y = transpose(eigvec*transpose(I(t,m:(m+7)))); % KLT matrix*8-lenght vectors-- t=1:256 and m=1:8:256 iterations of for loop
xtilda = transpose(inv(eigvec)*transpose(y)); % inverse KLT matrix*basis restricted vectors
MSE(k) = MSE(k) + immse(I(t,m:(m+7)),xtilda); % MSE between restricted vector and original vector, k iteration of for loop
MSEfor32vec(g) = mean(MSE); % average error for one row=32 vectors, g iteration of for loop

In the same way I calculated MSEfor32vec of 8x8 DCT matrix using dctmtx command.

When I got the result, I was expecting KLT had less error; but DCT had less error. In the most of signal processing books, it is concluded that KLT must have less error.
What is my mistake or if my solution is true what is the point that I miss in the books?
I tried to explain my question in the best way, please ask me if it is not crystal clear..


texts: How can I make a piecewise signal from vertical matrix?

texts: I want to write a general Matlab code to express this finite signal, x(t), in terms of elementary functions. I don't want code to plot it, I want a general code to extract (ramp and step) equation by using a vertical matrix (2 column and multiple rows ),   take this picture, for example.


texts: Measure object planar displacement on slight moving or vibrating plane

texts:
I'm working in an application where I'm tracking an object 2d displacement on a given plane and the camera is already calibrated (intrinsic) and the lens distortion has been corrected.

In order to get the object displacement measurements I'm thinking to calculate/find the homography between the two planes (world and image).

I'm assuming that as long the object movement remains within the calculated plane everything will be fine, but now turns out that the plane might move/vibrate slightly (~ +-5mm), would I still getting good results? or is there another better way to do this (calibration) on a moving/vibrating plane?

A quick setup sketch:


texts: I need to insert an underwater acoustic channel model to an existing code that compared between OFDM and GFDM

texts:
The acoustic channel model that I have will output the channel impulse response. However, my signal is modulated in frequency domain (by doing fft). Hence, I want to obtain a frequency response of the CIR. Question :

Can I perform FFT on the CIR which give me frequency response and then just multiply my signal with it?
If that is correct, is the diagonal of the multiplication will be my signal after passing through the channel?

 H=fft(h,sys.N);    %sys.N = total data symbols h= CIR
 Sig =H.*tf_ofdm;   %tf_ofdm = input signal
 Signal=diag(output);  %output signal

I am doing FFT with the total data symbols because the CIR has random size every time it is being used.


texts: Detecting tennis courts in aerial images?

texts:
Possible Duplicate:
  How to find tennis courts in aerial imagery

I am trying to detect tennis courts that are present in aerial images ..

  I have the following image:

  I tried color image segmentation on it but no success it gives a bad
  result :

What techniques should i apply for the same please suggest i think Hough transform or watershed could be used however watershed causes over segmentation and the results i get are not satisfactory

Tried using adaptive thresholding:

Some more things that i tried Connected components :

Output:


texts: Can Temperature Data be Predicted Using Adaptive Filter (Such As LMS) Algorithm?

texts:
I am working on a project which requires me to implement adaptive filter as a predictor.
I have just started on adaptive filter and I intend to use least mean square algorithm for weight adjustment.

How can I predict future values from this system ?

Any help would be beneficial for me.
Thanks.


texts: Does sampling ~> Nyquist frequency capture harmonics?

texts:
In a debate on the value of 24b/192KHz consumer audio (using a good brick wall filter, minimal jitter), a friend posed the argument:

  Nyquist never properly dealt with harmonics, which change sound
  pressures by riding a higher frequency on a lower frequency "carrier",
  increasing the propagation of the higher frequency and lending some
  extra punch to the lower frequency.

A post from ComputerAudioPhile.com poses the same:

  So let's say you have a flute that produces a tone at 14kHz. It may
  then produce overtones or harmonics at 28kHz, 42kHz, etc. If say the
  28kHz overtone is sufficiently strong, and you truncate at redbook
  sampling frequency (corresponding to a 22kHz signal), then you might
  get an artifact at 22kHz - (28-22kHz) = 16kHz, which, if you are young
  enough, might be audible.

My Nyquestions are: How does this actually work? Which papers should I read?


texts: How do I know quantitatively if the correlation of two time series is significant?

texts:
I computed the correlation coefficient of two time series of daily observations, x and y, but noticed that the more sampling points I used in the calculation, the lower the value of the correlation coefficient, until it reaches saturation at very long time.

It looks that the correlation coefficient is related to the number of points and it's unable to set a fixed threshold to the correlation coefficient. So, how can I know quantitatively if the correlation is significant?


texts: Plane Settings of the Matched $z$-transform Method

texts: I've come across that the matched $z$-transform maps poles of the $s$-plane design to locations in the $z$-plane. My question is, what is the $s$-plane and what does this mean? I'm aware that the variable $s$ can often be used to denote the complex plane but the fact that this has been used in conjunction with the $z$ variable has confused me slightly.


texts: Should I use ideal or non-ideal filters for offline filtering?

texts:
I've got an offline signal that I want to high-pass filter. Should I use a Butterworth filter, or could I use the fact that the whole signal is known and use an ideal (step) filter?

Using a high-degree Butterworth filter is, I think, practically the same thing as using an ideal filter, and a higher degree means a better filter if there's no implementation and processing cost. Could the sharp change in impulse response cause a problem, though?

The signal is a bioelectric signal that is almost periodic, and I've got 100 periods or so.


texts: Convolution of Signal with a Gaussian Filter / Kernel

texts:
Following up on Analytical Solution for the Convolution of Signal with a Box Filter, I am now trying to convolve a Gaussian filter with the sine signal by hand.

My method is to use the definition of convolution and attempt to integrate:
\begin{align*}
  \overline{\phi} &= \phi(x) * h(x) = \int_{-\infty}^{+\infty} \! \phi(x') h(x - x') \, \mathrm{d} x' \\
  \Rightarrow \overline{\phi} &= \int_{-\infty}^{+\infty} \! \sin(x') \left( \frac{6}{\pi \Delta^2} \right)^{1/2} \exp(-\frac{6 (x - x')^2}{\Delta^2}) \, \mathrm{d} x' \\
  \overline{\phi} &= \left( \frac{6}{\pi \Delta^2} \right)^{1/2} \int_{-\infty}^{+\infty} \! \sin(x') \exp(-\frac{6 (x - x')^2}{\Delta^2}) \, \mathrm{d} x' \\
\end{align*}
At this stage, the integration seems impossible by hand (e.g., integration by parts).

I also tried moving to wave space by taking Fourier transforms and instead using multiplication:

\begin{align*}
  \mathscr{F}\{\phi(x)*h(x)\} &= \mathscr{F}\{\phi(x)\} \cdot \mathscr{F}\{h(x)\} \\
\end{align*}

I get the Fourier transform of sine as $\sqrt{\pi/2} i (\delta(k - 1) - \delta(k + 1)$, but am not sure how to multiply this with the exponential and how the inverse Fourier transform will work.
Am I missing something clever and/or elegant? Is such a solution possible? I don't have a good understanding of the Dirac delta and how to multiply it with an exponential in wave space.


texts: Isn't the rect pulse filter implicit at the transmitter?

texts: I've heard about shaping the symbol with a rect filter at the transmitter, but why? Isn't this just implicit from the fact that it's going to be transmitted as a symbol truncated to the symbol period regardless? Or is that simply what they're referring to by shaping it with a rect filter i.e. isolating the symbol to that window. Am I right in thinking it's just the default. Also does the receiver extend the signal as if it were infinite when performing the fourier transform and therefore the rect pulse shaping at the receiver is simply the receiver not doing that?


texts: What is DAB modulation in signal generators?

texts: I am using R&S signal generator and for generating a DAB signal there is an option for mentioning the modulation level in %. For example, we can generate DAB modulation 50% . I can understand that for AM radios, we mention modulation in %. What does this modulation in % mean for DAB or T-DMB ?


texts:
Can someone please explain how to determine if a system is invertible or not. The particular systems that I am looking at are:

$y(t) = \cos \left( x(t) \right)$ - I believe this is non-invertable because of the periodic function

$y[n] = nx[n]$ - I think this is invertable and the inverse is $x[n]/n$

$y[n] = x[4n + 1]$ - Is the inverse $x[1/4n - 1]$?

$y[n] = x[n - 2] - 2x[n - 8]$ - I do not know even how to begin

I am really confused with systems... did not understand a single thing in the lecture today, and now reading the book ("Signals and Systems", Oppenheim) I am getting frustrated. Is there an algebraic procedure for determining the inverse of a system?

Please help.


texts: How can I generate offset QPSK symbols from QPSK symbols

texts:
I am trying to generate Offset-QPSK modulated symbols. But I am facing some difficulties. I know how to make QPSK symbols but I am unable to figure out at what stage I have to bring in changes to make it OFFSET QPSK.

The following are the steps I did:

Generated a stream of 1s and 0 s
I have paired at 2 consecutive bits and mapped it to one among the integers 0,1,2,3.
Now I map these integers to $(1+j), \ (-1+j), \ (-1-j), \ (1-j) $ following grey code based ordering.

I know that these are the steps for QPSK. But I am not sure If I need to generate OQPSK symbols at which step should I make changes and what are the changes?

Any help is appreciated.


texts: Nyquist Maximum data rate formula for PCM

texts:
The Nyquist maximum data rate formula for a binary PCM is given by

$$C = 2B\log_2L$$

I'm not very sure what "$B$" is here. Is it the bandwidth of the signal being sampled or is it the channel bandwidth? Also, is "$L$" the no. of quantization levels or is it the no. of M-ary symbols used for baseband transmission?

I'm also not sure about what it means when we refer to "Bandwidth of a PCM system"? Are we talking about the channel bandwidth or the bandwidth of the PCM signal itself? I looked up these things on internet and there are different explanations at different places.

Can someone please clarify this or at least point me to a reliable source where it is explained without any ambiguity! Thanks!


texts:
Consider the simple first-order low pass filter, described by

$\tau \frac{d \mathcal{O}}{dt} + \mathcal{O}(t)=\mathcal{I}(t)$

Considered as a linear system (ie $\mathcal{L} \mathcal{O} = \mathcal{I}$), $\mathcal{L}$ has transfer function $\frac{1}{1 + i \omega \tau}$ (up to maybe some constants, minus signs etc etc depending on convention). By transfer function, I mean $\tilde{R}(k)$ such that if $\tilde{\mathcal{I}}$ denotes the Fourier/Laplace transform of the input, then $\tilde{\mathcal{O}}(t) = \tilde{R}(t)\tilde{\mathcal{I}}(t)$. Questions:

1) Is the transfer function the 'same thing' as the frequency response? The reference textbook I have (Signals and Systems by Oppenheim & Willsky) talks of the frequency response of the 1st order LPF $H(i\omega) = \frac{1}{1 +i \omega \tau}$ which as far as I can tell amounts to something very similar.

2) If we solve the LPF ODE for a sinusoidal input $sin(\omega t)$, then we get an expression for the output amplitude $A(\omega) = \frac{1}{\sqrt{1+\omega^2 \tau^2}}$. How is this related to the transfer function/frequency response?

Supplementary information/question: I'm actually a mathematics student in the situation of having to learn a lot of signals processing very quickly this summer. Are there any textbooks written out there which explain signals and systems in the perspective of a maths student? As far as I can tell, most books seem to pitched towards engineers (and also use $j$ instead of $i$), and are a little different to what I'm used to - I don't want to learn lots of things twice from two different perspectives.

Thank you very much for you time.


texts:
I'm trying to implement a solution that would, to some extent, evaluate a picture telling what are the chances that it was upscaled from the smaller image.

My approach is as follows:

Take a picture of unknown origin (scaled or not)
Perform sharpening using some technique which sharpens only evident edges (1)
Extract edges using Difference of Gaussians
Measure entropy of resulting image

Then downscale the image and upscale it back to the same size and compare entropies.
OR
Then upscale the image and downscale it back to the same size and compare entropies.

Does it sound reasonable? What technique should I use as (1)? Also, maybe I should do it in small steps so I don't introduce too many artificial points? I mean if the image was upscaled (preferably instantly, to target size) it won't matter a lot - but it the image weren't upscaled this incremental improvement will be better for the picture than taking it and upscaling instantly?


texts: What audio effects, filters, distortions, etc. create a "vinyl" effect?

texts:
I want to make any song sound like it's being played on a gramophone record in the 1920s. What specific filters would I apply to make this happen?

I'm looking for technical details, not some magical program that does it for me. I'm trying to create a programming interface that does this, so a user interface doesn't work. I'm a Math major with understanding of FFTs, but I don't know all the lingo.


texts: minimum usable 5G cellphone signal level?

texts:
I'm a programmer (not and EE) working on a project to simulate coverage and capacity for 5G cellphone signals at 26 GHz.  But I've done enough path loss calculations for terrestrial and satcom radio to question what the minimum received signal level for 5G cellphone operations will be.

I've found a paper specifying that for 5G signals > 6 GHz, the channel bandwidths are 50, 100, 200 and 400 MHz.  That same article lists a typical 5G cellphone receiver noise figure is expected to be around 9 dB.  This leads to MDS (Minimum Detectable Signal) levels of ~ -88, -85, -82, -79 dBm.

One article I saw article suggested a required fade margin of about 7 dB.

What I have not seen is something like BER/SNR curves for the different MSC (modulation and coding) schemes.  Maybe more importantly I haven't seen Packet Error Rate vs SNR curves vs MCS, or any indication of what PER / signal received signal level is required to allow a 5G cellphone to provide a usable user experience?

The genesis of my question is as follows.  One person suggested one could have usable capacity with -5 dB SNR. I question whether the cellphone could provide a usable user experience at this level.  Put another way, what would be a reasonable receive signal level to consider an area has 5G cellphone coverage?

Any insight, or pointers to other sites or papers will be greatly appreciated.

Thanks,
Don


texts: Are there any open source libraries for Adaptive noise cancellation?

texts:
I'm creating a chat application where people can input text via speech and I need to implement noise cancellation using Adaptive noise cancellation technique. I'm using dual microphones for this purpose.
Is there any open source library available to implement adaptive noise cancellation? or any hardware solution?


texts: Is this a kind of aliasing error and how to make correction?

texts:
I use a Discrete Fourier Transform to have a representation in the frequency domain:

Notice that, both the real and the imaginary line are softly reaching zero on the left, from 0.5 Hz to 0 Hz. This is a right function.

Subsequently, I wish to multiply the above complex frequency function with another frequency function: DFT*TF, where TF is in the form

The result appears an undesired shift of the imaginary line (and of the module, as a consequence) instead of the previously observed reduction to zero of the above mentioned lines. This shift is a problem because of causing wrong results to the following signal processes.

How could we give a theoretical explanation what kind of problem it is and what have been so far explained about such cases?

We may say that it happens due to the boundary conditions of zero out of the sampling period (the interval I apply the DFT is from 0 to 2047 sampling points, I plot only the part from 0 to 3.5 Hz below) and drives to this shift (see on the left) which is an aliasing error.

Have you ever heard something about such a case?

A practical explanation I could give to this is that, we cannot avoid this phenomenon when multiplying two complex numbers (functions herein) where the imaginary part of (at least) one of them is reduced to zero and is low but not lower than the real part reduction to zero. For example, see below I attach indicative arithmetical values for which the first seven imaginary parts, being a little larger than the real ones, causes a great problem in the following methodology.

The correction I thought is to process the imaginary parts and reduce them to values at least equal to the real ones. Then all the following results works right !
Well, I 've tried this process and works but I cannot be sure myself before asking the experience of others.

What do you think? Could you please indicate me something from books or a useful link?


texts:
I have a signal that I want to make it sound like a whisper. This is probably better than using a voice conversion system, but I was just want to do some experimenting before.

I was thinking maybe try to reduce the frequency of the signal? Maybe downsampling? Does anyone have a idea how to get closer to a whisper/unvoiced signal from a voiced signal?


texts: Cross-correlation - Why is there a complex part after FFT/IFFT when deleting the mirrored part of the spectrum?

texts:
I want to detect a special shape in my time series and I apply an matched filter using cross-correlation to increase the SNR.

e = conj(fft(shape,2048));
f = fft(signal,2048);
g1 = real(ifft(e.*f));

However, when deleting the second half of the FFT results, because of periodicity, then my g2 still has a small complex part and the result is less good in terms of SNR.

_e = e(1:length(e)/2);
_f = f(1:length(f)/2);
g2 = real(ifft(_e.*_f));

Could you explain me why there remains a complex part in g2?
And is there any easy method to improve the signal again after deleting half of the spectrum? Or is not advisable at all to discard the second half?


texts: Is there a mathematical method to determine if noise is Gaussian?

texts:
Is there a mathematical method to determine if a signal's noise is Gaussian?

The only way I know so far is to analyze the histogram and layover a Gaussian distribution to visually determine if the distribution is Gaussian. I would like to know if there is a mathematical way to determine if the noise is Gaussian and how accurate the result is.


texts: Slight crackle with overlap-add frequency-domain convolution

texts:
I'm trying to make an FFT audio filter using overlap-add but there's some slight rhythmic distortion/crackle in the output. I have an irSize (impulse response size) of 512 samples and a blockSize of 512. The overlap is 512 samples. Since fftSize >= blockSize + irSize - 1, fftSize is 1024 samples. I'm using FFTS for the FFT so the output size of forward_real (fftBlockSize) is 1026.

Here are my steps:

// copy input
for(i = 0; i < blockSize; i++)
    fftBuffer[i] = inBuffer[i];

// set rest to zero
for(i = blockSize; i < fftBlockSize; i++)
    fftBuffer[i] = 0;

FFT::forward_real(fftSize, fftBuffer, fftBuffer);

// complex multiplication
for(i = 0; i < irSize + 1; i++)
{
    convBuffer[i * 2] = fftBuffer[i * 2] * irBuffer[i * 2] - fftBuffer[i * 2 + 1] * irBuffer[i * 2 + 1];
    convBuffer[i * 2 + 1] = fftBuffer[i * 2] * irBuffer[i * 2 + 1] + fftBuffer[i * 2 + 1] * irBuffer[i * 2];
}

FFT::inverse_real(fftSize, convBuffer, fftBuffer);

// overlap-add
for(i = 0; i < blockSize; ++i){
    outBuffer[i] = fftBuffer[i] + parts[i];
    parts[i] = fftBuffer[i + blockSize];
}

Here you can see the little jump in the output every 512 samples. This is the source of the distortion.

Any ideas? I've been struggling with this for days. It seems like either I'm doing the complex multiply or the overlap add slightly wrong. But I can't for the life of me figure it out. It seems like I'm doing the theory right.

Thanks.


texts: Algorithm for smoothing the output of an object detector operating on a video?

texts:
Please could you point me towards an algorithm that takes a series of object detections performed on a frame by frame basis as input and outputs a filtered series of object detections in which the filter exploits temporal information to enhance the confidence and accuracy of the raw detections.

So for example, I would expect that a series of very low confidence detections of a particular class that forms a coherent trajectory across 10 frames would give an output of increasingly higher confidence over time - if this object is being consistently detected at a confidence of 5% then it is probably really there. Similarly, an object that has been detected in the middle of a single frame at a confidence of 15% but not in any previous frames is probably a false positive and should be filtered from the output or have it's confidence score reduced.

I would expect such an algorithm to retain and consider the past N frames and then perform some sort of multi-hypothesis energy-minimisation process?


texts:
I'm working on a sound card based OFDM system and ran into some problems:

How can I perform  DAC on the real and imaginary parts of the IFFT? I think they are real numbers instead of 0 and 1. Thanks.


texts: How can I shift this signal to it's midpoint in order to decode it

texts:
I'm wondering if there's a simple way to decode this pulse signal as I'm reading it in. I'm thinking the simplest way to decode this is if i can shift the whole signal down so that it's centered around 0. Then if my pulse goes above 0, I know it's a 1 and it'f it's below zero, i know it's a zero. Figures below to see what i'm trying to do. Please note that my sampling frequnecy $Fs = 8Hz$, my pulse width is between 1-2 seconds, and come in pairs of 2. these pairs are spaced about 20 seconds apart. There is also a 3 pulse header which denotes the start of the message, with the first pulse being wider than the other pulses.

if I know the peak value of the pulses, then this is obviously just taking my signal and subtracting half of the peak, $d(t) = r(t) - peak/2$. The problem is this peak amplitude is going to vary, as is the noise level. If i try to just subtract a running average, then the noise part of my signal will be centered around 0 as well, which then my decision won't be a simple above/below zero decision. I've plotted subtracting the mean in figure 3 below. My signal is $d(t) = r(t) - runAvg(past 4 samples)$

It seems like there should be an easy way to filter this, either in the time or frequency domain, I'm just not thinking of it. Thanks for your time!


texts: Tell a recording of Martian wind from a recording of Earth's wind

texts:
Perseverance Rover's SuperCam Records Wind on Mars, sol 11
(Credit: NASA/JPL-Caltech/LANL/CNES/CNRS/ISAE-Supaero)

How do I interpret an image of a spectrogram of an audio wind signal?
(Credit: user1068636@dsp.SE)
Looks similar, isn't it?
I see a glimpse of challenge in question #74103. Even if these are unrelated sound recordings, is it possible, examining only audio, tell a recording of Martian wind from a recording of Earth's wind?
To ward off a prompt redirection to space.SE or elsewhere: what help (if any) DSP can offer to researchers of the Martian atmosphere in analysis of audio recordings, in view of the above?


texts: How to know if a audio file is real lossless using its spectrogram?

texts:
I need to know if a certain audio file is real lossless and not a transcode (i.e. lossy converted in lossless, but lossy at the end). I was told there was a way to do this by creating a spectrogram of the file and then checking something else. The problem is that, since I am not well versed in audio processing, I don't know what else to check.

I would like to learn how to identify this fake and true lossless files using a spectrogram (since, as a Linux user, I found a program which creates them easily). If you want to give me a hand with the file in question, here it is:

P.D.: I'm not completely sure if this question belongs to this site. I put it here since is a site about audio, but if not just tell me and I will migrate it were it belongs.


texts: I capture signal (sound) in 44100hz and I need get response if there is peaks at amplitude, actually. Is this possible? How I can do this in real-time?


texts: Matlab Filter designer not working, how come?

texts:
Before reading any further, to give you on some insight on the output level of the oscilloscope picture's
the ~340mV green signal is normal. If you know me I posted a question as to why its 340mV but for sake of simplicity 340mV is normal in this case. So attenuation is not being seen here.
trying to design some digital filters directly from matlab to be implemented in the STM32H7 using the CMSIS DSP library
I tried first doing a butterworth low pass filter with some criteria I made listed in the picture

Converted it to Direct-Form 1 and into second - order sections. Then generated to a .h header in single precision form as I am working with floats and not doubles.
Here are the coefficients
float32_t iir_coeffs[20] = {0.344617784f, 0.689235568f, 0.344617784f, 0.2994394898f, -0.6779106259f, // Biquad Stage 1
                            0.265586704f, 0.531173408f, 0.265586704f, 0.2307691127f, -0.2931158841f, // Biquad Stage 2
                            0.2259309888f, 0.4518619776f, 0.2259309888f, 0.1963121295f, -0.1000360623f, // Biquad Stage 3
                            0.2090389729f, 0.4180779458f, 0.2090389729f, 0.1816346198f, -0.01779049635f // Biquad Stage 4};

Once the coefficients where obtained, all I had to do in code was change the state variable length to 4*4 = 16 and number of stages to 4 as this is a 4 stage biquad filter implementation.
However this doesnt work! I have no idea as to why? There's no attenuation @ 20kHz should be -3dB down and at 40kHz should be a nice -100dB down but the picture says otherwise.
Oscilloscope pictures

CODE:
    #define ARM_MATH_CM7

#include "main.h"

#include "arm_math.h"

void init_Clock(void);
void init_I2S(void);
void init_Debugging(void);
void init_Interrupt(void);
void init_SpeedTest(void);

int32_t RxBuff[4];
int32_t TxBuff[4];
uint8_t TC_Callback = 0;
uint8_t HC_Callback = 0;

char uartBuff[8];
float32_t iir_coeffs[20] = {0.344617784f, 0.689235568f, 0.344617784f, 0.2994394898f, -0.6779106259f,
                            0.265586704f, 0.531173408f, 0.265586704f, 0.2307691127f, -0.2931158841f,
                            0.2259309888f, 0.4518619776f, 0.2259309888f, 0.1963121295f, -0.1000360623f,
                            0.2090389729f, 0.4180779458f, 0.2090389729f, 0.1816346198f, -0.01779049635f};

float32_t iir_mono_state[16];

float32_t inSample[4];
float32_t outSample[4];

arm_biquad_casd_df1_inst_f32 monoChannel;

void DMA1_Stream0_IRQHandler(void) {

    if (((DMA1 -> LISR) & (DMA_LISR_TCIF0)) != 0){
        DMA1 -> LIFCR |= DMA_LIFCR_CTCIF0;
        TC_Callback = 1;
    }

    else if (((DMA1 -> LISR) & (DMA_LISR_HTIF0)) != 0){
         DMA1 -> LIFCR |= DMA_LIFCR_CHTIF0;
         HC_Callback = 1;

    }
}

int main(void) {

    init_Clock();
    init_I2S();
    //init_Debugging();
    init_Interrupt();
    //init_SpeedTest();
    arm_biquad_cascade_df1_init_f32(&monoChannel, 4, iir_coeffs, iir_mono_state);

  while (1)
  {

      if (HC_Callback == 1){

         // GPIOA->BSRR |= GPIO_BSRR_BS3_HIGH;

          for (int i = 0; i < 2; i++){
              inSample[i] = (float32_t)RxBuff[i];
          }

          arm_biquad_cascade_df1_f32(&monoChannel, inSample, outSample, 2);

          for (int i = 0; i < 2; i++){
                TxBuff[i] = outSample[i];
            }

          HC_Callback = 0;

      } else  if (TC_Callback == 1){

        //  GPIOA->BSRR |= GPIO_BSRR_BR3_LOW;

          for (int i = 2; i < 4; i++){
              inSample[i] = (float32_t)RxBuff[i];
            }

                  arm_biquad_cascade_df1_f32(&monoChannel, &inSample[2], &outSample[2], 2);

                  for (int i = 2; i < 4; i++){
                        TxBuff[i] =  outSample[i];
                    }

          TC_Callback = 0;

      }

  }

}


texts: How to calculate an All-Pass filter quantization coefficients

texts:
Given

$$H(z) = \frac{z^{-1}-0.8}{1-0.8z^{-1}}\text,$$

does the filter stay an All-Pass filter after quantization of coefficients?

If so, how can I prove it mathematically?