texts: What is the minimum phase shift for Quadrature Amplitude Modulation (QAM)?

texts:
I'm a bit of a noob here, looking for a simple formula or just a table which can tell me the absolute minimum phase shift angle possible for different variations of QAM. Particularly QAM 16, 64, 256 and 1024. If the answer is zero (is it?), then what is the minimum phase shift possible in each case other than 0?

Additionally, what is the limiting factor which governs the rate at QAM can switch between different phases? In other words, what is the maximum rate at which QAM can switch between different phases, and how is that determined for a particular device? Is there a relation to frequency of transmission (say a 1 GHz signal), or are frequency of transmission and phase-switching rate completely independent?


texts: Why edge sharpening produces high frequency?

texts:
I have a low-resolution image in which the high frequencies are missing. When I apply an edge sharpening filter some of the missed high frequency is recovered.

I am wondering why this edge sharpening process in the image domain produces new high-frequency information in the frequency domain? Is this new information reliable?


texts: cepstrum analysis to get fundamental freuquency

texts:
I am trying to find the fundamental frequency of a bearing fault.This is my code

c2=cceps(abs(Signal_fft_hilbert(2:250)));
plot(freq_s(2:250),c2)

And this is the cepstrum plot in the image. I have plotted the frequency instead of time. Is that right? And I am not able to identify which should be the fundamental frequency. Theoretically it should be somewhere around 100-123.but I am getting many prominent peaks.
Please help


texts: Why does SNR have an impact on the bit rate?

texts: I have some confusion regarding the impact of SNR on the bit rate. For example, if I have a QPSK-OFDM system, then my bit rate will be 2bits mutiplied by the number of sub-carriers of the OFDM modulation over the symbol time. How can I account for the SNR in this case?


texts: Scan an Auditorium, Count People, and Display Open Seats

texts:
I'm looking for any recommended approaches to be able to digitally process a room full people, like an auditorium or a movie theater and output the following information:

Goals:

How many people are in the room
Locate unoccupied and available seating
Display the available seating to ushers, or people attending late, on an iPad or TV outside the auditorium. Similar to viewing airplane seat occupancy online.

Sensors I'm considering:

LiDar Scanning
Many ceiling (IR) cameras looking straight down (or perpendicular to the seating if the seating is inclined)

Challenges: Be able to take accurate enough measurements when:

The lights are on
The lights are off or in low light
People are standing
People are sitting
Seating is a long bench, not a chair

Constraints:

Individual sensors for each seat isn't ideal, as we need to count people when they are standing as well.

Thoughts on LiDar:

I like the thought of scanning the room with LiDar to develop a 3D Map from which I can determine the number of prominent heads to count, and distance/location of each head to identify a seat that is taken or open.

Are there any affordable (under $10,000) LiDar scanners that make this easy?

Thoughts on Top Down Infrared (IR) Cameras :

The auditorium seats 700 people and has a balcony. If the cameras are positioned in a top-down perspective, we would need to install about 22 cameras. It would be nice to have less of an installation overhead.

Also, I'd like to respect the audience and not look down shirts.

Thoughts on 1 or 2 Infrared (IR) Cameras Viewing the Crowd from the stage:

This could work for counting faces (using OpenCV or other Computer Vision library) but would make it difficult to tell what seats are open and available, especially when people are standing.

Images of the Auditorium:


texts: Relationship between input and output sequence in Hartley transformation

texts:
As you know that Discrete Hartley transformation is related to the discrete Fourier transformation, $i.e$, assuming we have a vector $X = [x_0,x_1,\ldots,x_N]$, its Hartley transformation is equal to $H(X) = Real(FFT(X)) - Imag(FFT(X))$. where $H$ denotes the Hartley transformation.

I wonder, if I want the output of the Hartley transformation equals to a vector of length $N$ whose all elements are $1$, it means $H(X) = [1,1,\ldots,1] $, what supposed to be the input $X$? I means I need to formulate the relationship between the inputs and outputs.


texts:
In order to understand the behaviour of the butterworth (lowpass) filter I generated a "spectrum" consisting of 1's. I then went to time domain (ifft), applied the filter and transformed back (fft). I chose the window (maximum) frequency to be one. So i expected that the windowed spectrum should be equal to the actual spectrum of ones.
Instead I got almost the spectrum, but at some point I got a huge line (I expect it to be spectral leakage?!). Also, the values are slightly moved up... Unfortunately I haven't understood how to solve this problem.

Here a sample source code from which I started:

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

wavelength = range(10000)
spectrum = [1]*len(wavelength)
filter_order = 3 #2
Wn = 1
inter = np.fft.ifft(spectrum)
b,a = signal.butter(filter_order, Wn, btype='low', analog=False)
inter_w = signal.filtfilt(b, a, inter, method='gust') # filtered
spec_w = np.fft.fft(inter_w) # filtered spectrum

plt.plot(wavelength, spectrum, label='spec')
plt.plot(wavelength, spec_w, label='spec_w')
plt.legend()
plt.show()

And here a small plot. As stated I don't understand, why "spec_w" is (i) bigger than one and (ii) there is a peak that shouldn't be there.

Filter_order 3:

Filter_order 2:


texts: I've heard in various literature that band limited channels use pulse shaping filters. By the way, In OFDM it use a cyclic prefix to overcome ISI, so I wonder if OFDM does not use pulse shaping filter.


texts: Mistake or not - Fourier Series of x(2t+3)

texts:
I have a couple of resources I have from my university I had being checking and I found this:

Find Fourier Series coefficients of x(2t+3). x(t) is continuous and periodic by T.

I see this solution:

But the 3/2 is seemingly wrong. Am I right? It supposed to be 3, not 3/2. Or am I missing something? They claim that:

Please let me know if this resource is wrong or I am having the mistake and it shall be 3/2 some why.


texts: Plotting Real Amplitude of Sine Wave in FFT

texts:
Consider a sine wave having an amplitude of 9 and a frequency of 0.3 Hz. I wish to perform an fft and plot the frequency on the x-axis and the real amplitude (i.e. 9) on the y-axis. I am using the following MATLAB code:

Fs = 10;
data = xlsread('Signal.xlsx');
Y(1)=0;
Y = fft(data);
N = length(Y);
freq = 0:Fs/N:Fs/2-Fs/N;
freq = freq';
amplitude = abs(Y(1:floor(N/2)))/floor(N/2);
plot(freq,amplitude);
xlabel('Frequency [Hz]');
ylabel('Amplitude');

When running the code, an amplitude close to 9 is obtained at a frequency of 0.3 Hz. In reality, I have a sinusoidal signal of a rotating motor shaft. I am measuring the angle using an encoder. The data can be found at:

http://www.dropbox.com/s/pe3g44b48ugauqp/Signal.xlsx?dl=0&m=

I know that the amplitude of the sine wave should be about 0.6 m but when conducting an fft, it is indicating that the amplitude is around 0.4 m. I am sampling at 10Hz and have about 185 000 data points. When trying to reduce the data, the amplitude of the sine wave is approximating the desired one i.e. 0.6 m. As far as I know, the more data points you have, the better will the resolution be when conducting an fft. So why am I getting the opposite? Can someone please help me? Thanks.


texts: Is it possible to encrypt an audio wave? NFL Example

texts:
In the NFL, quarterbacks receive playcalls from coaches over their helmet's wireless interface.

Someone mentioned how occasionally, these radios will pick up interference from airplanes, and that frequently the helmets lose communication.

One thing I wonder about is if an opposing team's coaches could pick up what was being communicated between the offensive coordinator and the quarterback.

And then I wonder, well, why wouldn't there just be an encryption scheme between the coach and the quarterback.

A chip on the coach's side would take his voice, encrypt it, send it to the quarterback's helmet, in which a matching chip would decrypt it.

Obviously there are tons of other applications, military, etc.

But then I wonder if the encrypted signal would be distorted with all this noise, and if that distortion would completely disrupt the decrypted signal.

Because if you change even a bit in an encrypted signal, it would obfuscate the resulting signal when it was decrypted by the quarterback's helmet.

Are there any methods for this kind of "loose encryption"?

There are "human" encryption schemes. Like NFL coaches could change the name of their plays from game to game. This would keep it known to only the QB and the coach.

But I guess I was wondering if there was a mathematical approach.


texts: How do I add AWGN to an I and Q representation of a signal?

texts:
I have a wireless communication system that I am simulating in Matlab. I am performing some watermarking through slightly adjusting the phase of the transmitted signal. My simulation takes the original I (inphase) and Q (quadrature) values and adds in the watermark. I then have to simulate the resulting bit error rate after being transmitted. For now I just need to add varying amounts of thermal noise to the signal.

Since I have the signal represented as its I and Q channel it would be easiest to add AWGN(additive white Gaussian noise) to the I and Q directly. One thought was to add noise to both channels independently, but my intuition tells me that this isn't the same as adding it to the signal as a whole.

So how can I add noise to it when it is in this form?


texts: Help Understanding Convolution Filter Formulation

texts:
I'm reading Computer Vision: Algorithms and Applications wich is available online as a PDF and on Chapter 3.2 page 111 it introduces convolution operators for images giving the formulation:

$g(i, j) = \Sigma_{k,l} f(i − k, j − l)h(k, l) = \Sigma_{k,l}f(k, l)h(i − k, j − l)$

since $(i,j)$ are pixel coordinates $f$ is the pixel intensity function for the image we're convolving and $h$ is the function for the convolution matrix it makes sense to me that $g(i,j)$ is equal to the first sum expression but I can't wrap my head around how this is equivalent to the second sum expression. If someone could explain this I would really appreciate it.


texts: Sampling of a band-limited analog signal: DFT and aliasing

texts:
I saw this question on one of the sites related to DFT:

  The analog signal $x(t)$ is band-limited to $40\textrm{ Hz}$. Suppose the signal is sampled at the rate of $100\textrm{ samples/second}$ and that at this rate $200\textrm{ samples}$ are collected. Then $200$ zeros are appended to the $200\textrm{ samples}$ to form a $400$-point vector. Then the $400$-point DFT of this vector is computed to get
  $X[k]$ for $0 \leq k \leq 399$.

  Which DFT coefficients are free of aliasing?
  The DFT coefficient $X[50]$ represents the spectrum of the analog signal at what frequency $f$?
  (Give your answer in $\textrm{Hz}$).

The answer's provided were:

  All of the DFT coefficients are free of aliasing. The sampling rate is more that twice the maximum signal frequency.
  The DFT bin width is $100/400$ or $0.25\textrm{ Hz}$. The $50^{\rm th}$ DFT coefficient corresponds to the frequency $50$ times
  $0.25\textrm{ Hz}$ or $12.5\textrm{ Hz}$

I'm not really sure if this is right because when you append zeros you are upsampling and the sampling rate becomes $400\textrm{ Hz}$. So when you take a $400$-point DFT the bins are seperated by $1\textrm{ Hz}$.

Please let me know if I am right or not. If I am wrong please explain the answer to me.

Jose.


texts:
I've been working at this problem for a while now, and can't seem to come to a solid conclusion - is this system time invariant?

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

My reasoning for the system being time invariant is that it is clearly a convolution integral. Time shifting the input will shift the output.

But, it is not a normal convolution integral. The top bound is only to $t$ rather than to $\infty$. This is all well and good if the system is causal, because for any $\tau$ greater than $t$, the output would be zero. But because there is no unit step $u(t)$ clearly defined in the transfer function (like $e^{-9(t-\tau)}u^\tau(t)$), one cannot make a conclusion on the causality of the system. So the question at hand is, does shifting the input also shift the bounds of the integral?

So what do you think? Can anyone prove if the system is time invariant as given?


texts: Digital Phase Modulation baseband or passband?

texts:
Say I want to transmit messages using PSK:
I send the message
$$s_m(t) = \text{Re} \left [g(t) e^{\frac{j 2 \pi (m-1)}{M}}e^{j 2 \pi f_c t} \right]$$
where $f_c$ is the carrier frequency. Now my question is,

is this a baseband representation or a passband?
So is $f_c$ the center frequency of a certain channel? Or would we need to modulate $s_m(t)$ to the channel frequency?
So then if we sent $s_m(t) \text{cos}(2 \pi f_b)$ where $f_b$ is the center frequency of the channel we are communicating on, at the receiver we would need to convert the modulated signal back to its low pass equivalent $s_m(t)$ so that we can apply a detection algorithm to demodulate the signal?


texts: How to apply discrete filters to a signal

texts:
Let's say I have a signal like x[k] = [-20 -50 -30 50 30 -60 60 -60 60 10 5 10 5 5], and I want to apply a lowpass and a highpass filter to this signal (separately). For example the impusle response of the filters are as follows:

Lowpass: h[k] = [-1 2 6 2 -1], k = -1,0,...,3

Highpass: g[k] = [-1 2 -1]; k = -1, 0, 1

How can I calculate the first four signal values after applying these filters?


texts: Help me understand the phase of an FIR filter

texts:
I'm going over an exercise of designing an simple FIR filter, I have the solution in front of me, but I struggle to understand some parts of it.

I'm asked to have an FIR filter with only 3 coefficients.

I have reached this form:
$$ H(\theta ) = (2\alpha_0 \cos(\theta)+\alpha_1)e^{-j\theta} $$
where $\theta$ is the frequency variable (DTFT).

The magnitude is easy:
$$ \left | H(\theta ) \right |=\left | 2\alpha_0 \cos(\theta)+\alpha_1 \right | $$

But I struggle with the phase, it seems easy: $\phi(H(\theta))=-\theta$ , but I guess this is wrong ? why ?

The solution that is given is:

$$\phi(H(\theta)) = -\theta +\beta$$
$$\beta = 0 \text{ for } 2\alpha_0 \cos(\theta) + \alpha_1 > 0$$

$$\beta = \pi \text{ for } 2\alpha_0 \cos(\theta) + \alpha_1 < 0$$

EDIT:

I think I just answers figured it out, if that expression is negative we can write it as positive with a phase of π. What happens if $\alpha_1$ is larger than $4\alpha_0$ thus the expression is always positive ? does $\beta =0$ ?


texts:
I combined a chirp with a CDMA and I would like to know how to find the data rate. To begin, I spread the datas with the chirp and after I spread the previous signal with the PN code.

My bandwidth is $B$, the PN length is $L$ and the chirp time is $T_u$. For me, the data rate (BPSK modulation) is $D=\frac {1}{(L/B)T_u}$. Is it correct?


texts: Frequency slows faster when it's decreasing

texts:
I'm sure there's a simple explanation but I can't discover it. Consider two frequencies, a and b. a is higher than b. I can create a wave with both frequencies. But when I create a wave with frequency decreasing from a to b, the frequency decreases to even slower than frequency b. Consider the following MATLAB code.
timeVals = 0:0.001:1;
sourceFreq = 8;
freqPulse = linspace(1,.5,length(timeVals));
sourceActivity1 = cos(2 * pi * (sourceFreq .* freqPulse .* timeVals));

freqPulse = linspace(.5,.5,length(timeVals));
sourceActivity2 = cos(2 * pi * (sourceFreq .* freqPulse .* timeVals));

plot(sourceActivity1); hold on; plot(sourceActivity2)

Now, compare the two sourceActivities. The end frequency of sourceActivity1 is even slower than 4. And the frequency at the end of the wave is slower than sourceActivity2. This can be determined using visual inspection alone, or with spectrograms.


texts: Is this a universal relation between signal power and period (frequency)?

texts:
I am Fourier analyzing at a bunch of signals of equal length and find that $$\frac{d\ln({E[P]})}{d\ln({PT'})}$$ is constant across the dataset, where $T$ is a vector of the periods (inverse of frequencies) of each signal, and $P$ is the vector of the power corresponding to each of those periods.  $E[P]$ is the mean power of the given signal.  I include a graph to illustrate.

Should I expect this relation in any signal?  Or does this point to something unique about the signals I am dealing with?


texts: Harmonic Product Spectrum from FFT output to the fundamental frequency

texts:
I'm trying to do the HPS algorithm on my FFT output, but I'm stuck here.
My signal is from a bass (cable), 16bits, 48.000Hz.

I split in time domain the array of the whole record into multiple arrays of 24.000 frames (miniBuffer[24000]).

I'm applying a Hamming window once it's split, like this:

miniBuffer [m] = miniBuffer [m] * 0.5 * (1.0 - Math.cos(2.0*Math.PI*m/24000));

Then, I compute FFT on each array.

Finally I try the HPS:

 double mag[] = new double[miniBuffer.length]; //Saves magnitude of the fft values

 double m_max0 = miniBuffer[0];

                    for (int i=0; i < miniBuffer.length / 2 - 1; i++) {
                        double real = miniBuffer[2*i];
                        double imag = miniBuffer[2*i+1];
                        //Gets magnitude
                        mag[i] = (float)Math.sqrt(real*real + imag * imag);

                        if (miniBuffer[i] > m_max0 && i>0) {
                         m_max0 = miniBuffer[i];
                        }
                    }

                 int i_max = 0;
                 double m_max = miniBuffer[0]; //max
                 m_max = m_max0;

                 double sum [] = new double[miniBuffer.length];
                 int fund_freq = 0;

                 //HPS

                 for(int k = 0; k < 24000/48 ; k++)
                 {
                     sum[k] = miniBuffer[k] * miniBuffer[2*k] * miniBuffer[3*k];
                     // find fundamental frequency (maximum value in plot)
                     if( sum[k] > m_max && k > 0 )
                     {
                         m_max = sum[k];
                         i_max = k;
                     }
                  }
                  fund_freq = i_max * 48000 / 24000;
                  System.out.println(fund_freq);

The values of the max magnitude are the frequency that is recording the program, but when i apply the HPS, for example, to a 220Hz sound, the HPS returns me 26 or 30.

I think that this values come from the frequencies limiter that doesn't works (I want to cap before 37Hz and after 440):

                 double hz = ((double)( miniBuffer.length * 2)) /48000;

                 for(int z = 0; z<(37*hz); z++) {
                     miniBuffer[z] = Double.NEGATIVE_INFINITY;
                 }
                 for(int z = 0; z>(440*hz); z++) {
                     miniBuffer[z] = Double.NEGATIVE_INFINITY;
                 }

If I delete this, HPS returns me 0 in every output.

So:

Is the window correctly applied?
Is the HPS a good algorithm for bass pitch detection? (Low Frequency)
What could i use for limit my values in a right way?
How to fix my HPS algorithm?
Some other advice?

Thank you!


texts: Inverse Fourier transform - porting from MATLAB to Python

texts:
I am porting a script from MATLAB to Python, but I am failing when it comes to the inverse Fourier transform.

The function in MATLAB (ifft) includes a 'symflag', which treats the data as conjugate symmetric and ensures that the output is real. However, the equivalent function in numpy does not have a similar option, and therefore my outputs are different.

The 'symflag' clearly covers up for some of my mathematical inadequacies, and I would be grateful for assistance in resolving this issue. My aim would be to have a solution in Python that closely matches the solution in MATLAB.

In Matlab

Y = [complex(1), complex(2), complex(3), complex(3), complex(2), complex(1)]

y = ifft(Y, 'symmetric')

y = 2.33    -0.50   -0.16   0   -0.16   -0.50

In Python

Y = np.array([1, 2, 3, 3, 2, 1], dtype='complex')

y = ifft(Y)

y = ?

Many thanks in advance.


texts: Low PAPR performance for Monochromatic frequency signals

texts:
I understand what is Monochromatic frequency signals from here, but could somebody kindly give a brief explanation about "why does a monochromatic frequency signal result in poor PAPR (Peak to average Power Ratio) performance"?.
(Note- topic for achieving Good PAPR(constant Envelope) for Radars)


texts: Matlab FFT not producing symmetric spectrum

texts:
I am plotting a FFT of a sampled RC pulse but my resulting spectrum isn't symmetric - it's offset.

pulse = rcosdesign(.5, 6, 100)
T = .0001
ft = fft(pulse);
ft = fftshift(ft)
ft_mag = abs(ft);
freq = 1/(T*length(pulse))*(-length(pulse)/2:(length(pulse)/2-1))

plot(freq,ft_mag)

What's going on?


texts: Beginner LTI system Fourier transform question

texts:
This is a question I feel too stupid asking my professor about. I'm having a mental block remembering how this works even though I think I understood it at one point:

I know the following properties:

$$x(t) {\longrightarrow}\boxed{\textrm{LTI System}}{\longrightarrow} y(t) = x(t) \star h(t) \longleftrightarrow X(j\omega)H(j\omega)$$

$$x(t) = e^{(j\omega_0 t)} \overset{\mathcal F}{\longleftrightarrow}X(j\omega) = 2\pi\delta(\omega-\omega_0)$$

So why is this true:

$$x(t) = e^{(j\omega_0t)}{\longrightarrow}\boxed{\textrm{LTI}}{\longrightarrow} y(t) = e^{(j\omega_0t)}H(j\omega)$$

instead of this:

$$e^{(j\omega_0t)}{\longrightarrow}\boxed{\textrm{LTI}}{\longrightarrow} y(t) = 2\pi\delta(\omega-\omega_0)H(j\omega)$$

I know I'm missing something here or have some fundamental misunderstanding, but I can't seem to catch what it is. I'm taking a DSP course, but it's been quite a while since I took basic signals and systems. If anyone could help me out I'd really appreciate it.


texts:
Background

I am working to identify and isolate each human limb of a known person, in pose, in an image which is relatively noisy.  It should also be noted that the image is a snapshot extracted from a video (which can be utilized in this task).
The end result ideally would be a bunch of polygon estimates of each body limb segment (i.e. torso, head, neck, upper arm, lower arm, hand, upper leg (thigh), lower leg, and feet/shoe).  I currently have results that allow me to find the contours of the image, though these include materials that are prevalent in the background (i.e. its not a clean image of only a human).

Note(s)

1). I am currently using opencv to implement the task, so any answers that can be directed towards that API are greatly appreciated, though I will happily accept any general solutions that answer the question.
2). If you feel the question is lacking in clarity, please comment as to why.  I truly feel this question would add value to the community if answered completely.

Question:

How can I create polygon estimates of each body part/limb that is present in an image which always contains one person?


texts: Intuition for how a Fourier transform handles signals where the frequency varies with time?

texts:
I created a discrete signal sampled at 44.1kHz that is 330Hz for 1 second, 360Hz for 0.5s, and 390Hz for 0.25s.  I did an FFT transformation of this, and got the magnitude graph below:

I don't understand how this magnitude information (combined with the phase information not shown) can reconstitute the original signal.  I know it does -- I'm not asking for a proof.  I'm hoping someone can supply the intuition for how that strange jagged FFT image ends up reconstructing the original signal.


texts: KNN method for different values of K on a handwritten digit data set

texts:
We're supposed to use KNN (K Nearest Neighbor) method for different values of K to classify a handwritten digit data set.

The problem is, this is the first time I want to do a project like that in Matlab. Could someone please explain the normal steps I should do for such problem? What values of K should I use? I read some articles on KNN method and have a rough idea about how the method works but I need help to do this and to be able to go through the following problem we should do after this.


texts: As I know, convolution is defined as $f(x)*g(x) = \int_{-\infty}^{+\infty}f(\tau)g(x-\tau)d_{\tau}$, but what if we want to convolve $f(2x)$ and $g(3x)$? It should be like $f(2x)*g(3x) = \int_{-\infty}^{+\infty}f(2\tau)g(3x-\tau)d_{\tau}$ or $f(2x)*g(3x) = \int_{-\infty}^{+\infty}f(2\tau)g(3x-3\tau)d_{\tau}$ or anything else?


texts: Is jointly wss (wide sense stationary) a transitive relation?

texts:
I've been try to either prove or find a counter-example to the idea of jointly-wss being transitive.
In other words: does ($x$ and $y$ are jointly wss) $\wedge$ ($y$ and $z$ are jointly wss) imply that $x$ and $z$ are jointly wss?
Obviously it boils down to only asking about the cross-correlation condition, so one can ask:
Does $\forall t, \Delta t : C_x,_y(t, t+\Delta t)=C_x,_y(0, \Delta t) \ and \   C_y,_z(t, t+\Delta t)=C_y,_z(0, \Delta t)$ imply that $\forall t, \Delta t : C_x,_z(t, t+\Delta t)=C_x,_z(0, \Delta t)\ $?
My basic intuition is that this is not the case, but I cannot find an appropriately pathological set of signals...Nor have I managed to prove transitivity.
Any help would be very much appreciated!
Thank you.


texts: Converting Analog Filter into Digital Filter, why Bilinear Transform?

texts:
What's the advantage of using the Bilinear Transform?
$$H_d(z) = H_c(s)\bigg|_{s=\frac{2}{T_s}\frac{z-1}{z+1}}$$
When you can just use this equation?
$$H_d(\omega) = H_c(\Omega)\bigg|_{\Omega=\omega/T_s}$$
In other words, why does bilinear transform exist? These two equations look almost the same to me...What are the tradeoffs between using one equation verses the other?  Is there a case where you would use one verses the other?


texts:
I'm looking for a suitable explanation of the circumstances in which the LPC error polynomial for a discrete time process x[n] is replaceable with an error polynomial categorized under the AR model? I found this book which states that LPC reduces to AR if the error becomes predominantly white noise(i.e by increasing the number of previous samples in the summation on the RHS of the prediction error equation: $$e[n]=\sum_{i=1}^N a_nx[n-i]+ x[n]$$ Is this the only condition or am I missing something out?

Also, I can't seem to figure out why the complex conjugate of the AR optimal coefficients is taken when moulding an AR process into the LPC form. in the first picture(Th 5.1) note the coefficient derived is $C_n$ and not Cn(complex conjugate). But in Eq 5.5 coefficient used is Cn

I apologize for any technical terminologies I might be messing up and things I haven't attentively read. Being relatively new to this part of the subject, any edits are appreciated. Thank you.

Chapter 5 of this is what my queries pertain to https://authors.library.caltech.edu/25063/1/S00086ED1V01Y200712SPR003.pdf


texts: Properties of DTFT to Infer the Inverse DTFT of Altered Data

texts:
Given a signal $ x \left[ n \right] $ and its DTFT $ X \left( {e}^{j \omega} \right) $.

Which property of the DTFT allows you to easily compute the inverse DTFT of $ \frac{4 X \left( {e}^{j \omega} \right)}{\pi} - 2 $?


texts: Guidance/Brainstorming for a mapping/classification problem

texts:
I'm quite new to machine learning/data mining and I'm struggling to find the correct path for my problem and would appreciate some guidance or criticism of my proposed solution i.e. is there a better/simpler algorithm for the problem?

The Problem

I have a number of features that describe a particular type (label) of wave (frame of audio) at a predetermined level 'v'. I want to be able to identify the level of an unknown wave and distinguish it from other types of waves that fall under the same higher level category.

Assumptions

A group in a test set should be in increasing order of level v
The type of wave in the group should be the same and known

Proposed Solution

Stage one: Level Selection

For a given type of wave compute the features at each level for N number of samples
For each level calculate the mean/median of each feature the N samples to create a feature vector for each level.
Normalise the feature set by subtracting the empirical mean and dividing by the variance.
Take the Euclidean/Manhattan distance of an incoming vector with the feature set and choose the closest level.
For a group with assigned levels, compare levels with neighbours and report negative differences (should be ascending)  or large differences.

Stage two: type selection

Take the Euclidean/Manhattan distance of an incoming vector with the
feature set for each type at a specific level or maybe across all levels choose closest type.

Extension of Problem

Features evolve over time as well as level

Proposed Solution

Repeat the stages of the above solution for each frame.

Thanks for any help

*Update
I cannot guarantee that the levels v are equivalent across the data I can only guarantee that the order is increasing. i.e. Sample A may have 5 levels v= 1,..,5 and they correspond to {1,..,5} and sample B has 10 samples v = 1,2,..10  and they correspond to {.5,1,1.5,...,10}. How can I capture this without knowing the relationship between levels and identify those which do not follow this pattern. Pleas let me know if this is not clear


texts: Simulating spatial perception - with cosine wave based sound - in MATLAB

texts:
I'm trying to create cosine wave, one for the right channel and another for the left. The one on the left is to be moved in phase to simulate change to the spatial perception of the tone. A delay in time to the left side makes us think the sound comes from the right, and since time is converted to phase in a cosine I am working with the phase.
I wish to use a $500\textrm{ Hz}$ cosine and a $2\textrm{ mSec}$ signal. MT ultimate goal here is to have 9 sounds to simulate the locations around a person's head.  1-4 being left, 5 the center and 6-9 the right.
This a snippet of the code responsible for this:

t = [ 0 : 1 : 2000 ];   % Time Samples
f = 500;    % Input Signal Frequency 500Hz
fs = 44100; % Sampling Frequency

x =  cos(2 * pi * f / fs * t);  % Generate Sine Wave

y =  cos(2 * pi * f / fs * t - DELAY);  % Generate Sine Wave

Y = [x,y];

audiowrite(['file' num2str(j) '.wav'], Y, fs);

The issue I'm having is that no matter what values I try for DELAY the resulting file sounds just like any other, I cannot hear any change.
What am I doing wrong?


texts:
I've recently started experimenting with DSP, specifically, understanding digital signals that are generated by some small applications I am creating. For this quest, I've decided to use The Scientist and Engineer's Guide to Digital Signal Processing. While the provided material is beyond exceptional, the more I read the more confused I become as to how I could apply different forms of DSP in my "computer based" experiments.

Here is what I am currently working on:

I have a capacitative sensor. When the sensor is stretched, the capacitance increases. Contrary is true when it contracts. Image below displays this characteristic:

An interesting observation I noticed is that when I stretch the sensor, while bending it, my signal is buried in noise. This is evident between 800 and 1000 samples in the above photo. Because I am experiencing this issue, I want to uncover the stretch/contraction of the sensor from this noise; hence my goal of studying DSP.

An interesting comment made by the author, is that when ever we deal with Digital Data we will always want to analyze our Time Domains using DFT. The most efficient algorithm to do this today is FFT. I've also concluded ( high level ) that using the mentioned algorithm is ideal as it will give me a sense of what "sin waves" generate the "digital wave" I am presented with. Hence, I should be able to parse out "sin waves" of interest to re-construct missing points of interest hidden in noise.

Now, while I understand that the change to the frequency domain can tell me that "a spike has occurred", what I am really interested in is re-constructing my wave to be less noisy. Hence, I'd like to derive out a consistent wave form between 800 - 1000, alike I have between 400 - 600.

Questions

Since my understanding is still fairly low, is DFT and FFT really the solution to my problem?
Would it be logical to take the FFT , filter out outliers that are generated and cause noise, and re-construct the time domain signal back ( with the results that were acceptable ) using iFFT? That should, in theory, give me back a time domain with less noise, no?
Is there a better section of DSP that I should read that can help me analyze the decouple noise from interesting data in a time domain?


texts: Testing whether a process is a Wiener process

texts:
Ideally I would like links to code implementations (eg. Matlab ) or book references, but I would appreciate suggestions on various methods.

We start with sampled process $X_{t}$.

A straightforward way is through repeated normality tests:

a. Test for normality of $X_{t}$ using KS test

b. Independence of increments: we test whether the product $X_{T/2}(X_{T}-X_{T/2})/\sigma^{2}$ is close to a standard normal, where $\sigma^{2}=(T/2)^{2}$ .

c. Joint normal for increments $Y_{n}=(X_{t_2}-X_{t_1},...,X_{t_n}-X_{t_n-1})$: we divide the possible values of $Y_{n}$ into $m$ cells and denote $O_{j}:=$# samples that fall into cell $j$. Then the statistic $\sum \frac{(O_{j}-E[O_{j}])^{2}}{E[O_{j}]}$ should be approximately a $\chi^{2}-$distribution.
Maybe testing for quadratic variation=$t$ and martingale property (Levy characterization)?
Some spectral characterization for WP?
The other link is testing for fractional WP, which is more involved.
Turning it into a test for White noise since it is the "derivative" of WP. So maybe taking finite difference for WP and doing white noises tests for it:
$$(X_{t+\Delta t}-X_{t})/\Delta t.$$


texts: Book recommendations on Gabor filter and Fourier series

texts:
I'm starting to learn about Gabor filters and Fourier series. I need to make a presentation on Gabor filters in a few months, so I need quality references for the presentation.

Does anyone have any suggestions on introductory books, useful articles or other similar literature which I may use as references for theory on Gabor filters and Fourier transform?


texts: When computing mAP for object detection, how many detections should one consider?

texts:
I am trying to write some code to evaluate the MS COCO style mAP (mean average precision, average computed at the category level) at different IOU levels in the context of object detection with a faster-RCNN type model. Fixing a given category, here is how I understand the pseudocode in order to get the recall, precision tuples assuming I have a dict as in python with the structure initialized as:
eval[category][c_val][iou_val] = {"true_positives":0} # for each iou value
eval[category]["num_detections] = 0

Pseudocode:
Set a max number of detections N
for each test image
  for each detection in order of confidence value (c_val):
    get the ground truths of the same category for this image
    get the ground truth with the largest IOU, call it bb with iou:=max_iou
    add a new confidence value in the dict if c_val is not already a key (see **)
    for confidence value c_val_ less than or equal to c_val
    eval[category][c_val_]["num_detections"] += 1
    remove bb from the ground truth list to prevent multiple detections
    for iou_val in iou_vals = [0.50, 0.55, 0.60, 0.65, 0.7, 0.75, 0.80, 0.85, 0.9, 0.95]
       if max_iou is >= iou_val
            for each c_val in the eval dict less than or equal to c_val
               eval[category][c_val][iou_val]["true_positives"] += 1

** (with the same dict entry initialized as the confidence score immediately below it in the dict if one exists)
A Faster R-CNN model can output as many detections as there are region proposals, which is a tuned hyperparameter (assume that non-maximum suppresion has been applied both for the region proposal network output and for detection output). For instance suppose an image has 5 boxes that are detected separately with high IOU and high confidence by a faster R-CNN model with num_region_proposals=300, and the remaining 295 boxes with very low IOU and very low confidence values. If you include all of these in the computation of the mean average precision then this will lower your score dramatically by increasing the number of false positives with some increase in recall.
On the other hand, you may have the scenario where for an image with a lot of objects you have quite a few low confidence value predictions with high IOU at the "back of the list" of the confidence-ordered detections.
My question is, with this approach, how many detections should I consider per image both to compute mAP?
I am imagining in practice (not for evaluating metrics, but for actual use of the model) you would simply set a confidence threshold, but I'm not sure if this is correct either.
For instance there might be a min number of detections even if the confidence threshold isn't met so that at least you have some kind of output since a model with low confidence scores could end up rarely outputting anything at all, which is obviously useless. Any insights appreciated.


texts: impact of lombard effect on language identification

texts:
I have collected samples for 2 different languages. Now i need to extract MFCC features and identify which language using wave files.

I need to do classification using R studio and perform an analysis on RR,EER,etc and finding out which classifier gives better results.

Can someone help me to proceed with this.


texts: Common symbols or standards used for DSP block diagrams?

texts:
When creating high level block diagrams of DSP or signal processing, what symbols are typically used?
Are there any standards? For example its common to see gain to be a triangle. Whilst for a low pass filter, I have seen a few ways.
Assuming an absence of standards, whats a practical way of finding/referencing symbols? Was thinking there must be some reasonable comprehensive software packages, say like Simulink, that would have made an intelligent attempt at creating symbols. Or worse, review various DSP books? Can anybody recommend an approach or resource? In an ideal world, an open source project set of .svgs!

(source: researchgate.net)


texts: Given a set of lines, find only those who are parallel (perspective)

texts:
I have an image which includes straight borders which I need to detect:

The borders are thick, which causes hough transform to detect multiple lines for each border, as can be seen in the following image:

In order to find the 'true' lines, I want to find all parallel lines (i.e. find the lines which converge into a vanishing point). Does OpenCV (or any other library for the sake of this manner) contains such a functionality? (I'm using python, though I can port c++ scripts as well)

Thanks in advance


texts: Using ROC curves for comparing the performance of SIFT and SURF

texts:
I want to compare the performance of SIFT and SURF against some standard image set.

After a bit of research, I found that ROC curves are one of the best ways to do this task.

In order to plot ROC curve TP rate and FP rate are needed.

Output of SIFT and SURF are detected keypoints. How exactly can I generate ROC curves from those keypoints ?


texts: How are time resolution and signal bandwidth  related?

texts:
I am confused by the dual concepts of time-resolution and bandwidth. Often I will hear that a pulse-compressed radar application 'doesnt have enough BW' for some specific time resolution that is sought.

Isnt the maximum time resolution simply the reciprocal of your sampling rate?

How are those concepts related?


texts: What is the ideal type of barcode for paper tickets?

texts:
I can use the following type of barcodes in my project:

Code 39
Code 128
QR Code
Data Matrix
PDF-417

They will be printed with standard office printers and with boca printers. It should also be possible to show them on smartphone screens.

They will be read with webcams or Windows tablets. It would also be helpful I could buy an USB barcode reader or something similar to use with this codes.

The data in the code will be text and numbers, at least 10 characters.

Which barcode type is most suitable for this situation? The most critical factor is the fault toleration, this has to be as low as possible on the mentioned media.


texts:
I want to compare a bunch of depth images coming from Kinect and eliminate the similar ones. Those images present posture of a single user sitting on the chair (depicted in).

My idea is to create a function which will return the difference in range [0,1] between two postures. This means, I want to compare only a posture for given two images (a grey region). For example, if I pass images to my function, the result will be 0 (because postures are the same, but not at the same position on the picture).

Hence, I need to modify the following code (and find something to replace "correlation"):

a = imread('image_user_depth_000041.jpg');  %first img
b = imread('image_user_depth_000042.jpg');  %second img
a = RGB2IND(a,16);
b = RGB2IND(b,16);

c = corr2(a,b);           %finding the correlation
if c==1
 disp('The images are same') % display
else
 disp('the images are not same')
end;

Do you have any suggestions?
My regards and thanks!


texts: What Does 'Zero Order Hold' and 'First Order Hold' Mean?

texts:
While studying the Image Magnification in spatial domain, I have come across this definition of Image Magnification by Replication:

  Replication is a zero order hold where each pixel along a scan line is repeated once and then each scan line is repeated.

And the definition for Image Magnification by Interpolation is given as:

  Linear interpolation is a first order hold where a straight line is first fitted in between pixels along a row. Then the pixels along each column are interpolated along a straight line.

Can you please explain the terms 'zero order hold' and 'first order hold' in layman's terms, so that I could understand these two definitions? Thanks.


texts:
I have simulated a phased array antenna. I have also simulated a point source. I don't get how to calculate pseudo spectrum vector without using the position of the source. Algorithms such as Capon and Bartlett use the position of the source for calculate the auto- correlation matrix which is further used to calculate pseudo spectrum. How is the angle of arrival being estimated if the source position is required to run the algorithm in the first place?

Here is the code:

M=6;

sig2=.1;

th1=-3*pi/180;

th2=3*pi/180;

a1=[1];

a2=[1];

a=[1];

for i=2:M

a1=[a1 exp(-1j*i*pi*sin(th1))];

a2=[a2 exp(-1j*i*pi*sin(th2))];

end

A=[a1' a2'];

Rss=[1 0;0 1];

Rrr=ARssA'+sig2*eye(6);

for k=1:180;

th(k)=-pi/6+pi*k/(3*180);

clear a

a=[1];

for jj=2:M

  a = [a exp(-1j*jj*pi*sin(th(k)))];

end

P(k)=real(1./(conj(a)*inv(Rrr)*a.'));

end

figure;

plot(th*180/pi,10*log10(P/max(P)),'k')

grid on

xlabel('Angle')

ylabel('|P(\theta)| (dB)')


texts: Does Zero Padding Distort the Spectrum of a Signal?

texts:
It's said to "sample the DTFT", revealing what "DFT fails to see". And I fail to see how this sampling isn't distortion.
The "spectrum" aims to provide the sinusoidal frequencies comprising a signal. If we're getting a nonzero distribution from 1 to 63Hz for a pure 1Hz tone, that's by definition different.
Further, adding zeros changes the signal; who is to tell that these zeros didn't occur naturally as a part of it? If they did, the spectrum must look different - and it does. That it mathematically happens to be equivalent to sampling a related but different altogether transform is only a coincidence.
What's the deal?


texts: How to compute properties of a song like key, bpm?

texts: How to compute the key and BPM of a piece of music? Is the Fourier transform necessary? I tried to approach this issue from the music theory angle and I found that I get stuck at trying to understand the terminology.


texts: Application of the time-shifting property in case of Fourier-Transform of cosine

texts:
Time-shifting property: $x[n-n_d] \xrightarrow{\mathscr{F}} e^{-j\omega n_d} X(e^{j\omega}) $
Fourier-Transform of cosine-signal: $\cos(\omega_0n) \xrightarrow{\mathscr{F}} \frac{1}{2}(\delta(\omega - \omega_0) + \delta(\omega+\omega_0)) $

Combining 1. & 2. together, I am getting:
$\cos(\omega_0n - \frac{\pi}{2}) \xrightarrow{\mathscr{F}} e^{-j\frac{\pi}{2}}\frac{1}{2}(\delta(\omega - \omega_0) + \delta(\omega+\omega_0)) $, but instead the Fourier-Transform of

$$\cos(\omega_0n - \tfrac{\pi}{2})$$

is

$$\cos(\omega_0n - \tfrac{\pi}{2}) \xrightarrow{\mathscr{F}} \tfrac{1}{2}\delta(\omega - \omega_0)e^{-j\frac{\pi}{2}} + \tfrac{1}{2}\delta(\omega+\omega_0)e^{j\frac{\pi}{2}}$$

Can anyone tell what I'm doing wrong here?


texts: How is multiplexing achieved in spread-spectrum modulations like CSS?

texts: I understand why it doesn't interfere with narrowband communication systems but how do different clients communicate in a system like LoRa. Is it time orthogonality like TDM?


texts:
suppose I have a sample of a snare and that snare is used in a song,¿ there is an algorithm or tool that detects the sound of the snare and subtracts it, that is to say that cancels its phase or eliminates it?.

the result would be the song without the snare sound.

this could also apply to (accordion trumpets or any other instrument)


texts:
There are many descriptions of how to turn a 2D image into a 3D one, however I want to do the opposite, in particular to a ball. As an example, consider the following ball:

If only the (relatively) slow change in intensity due to the light could be removed, the ball would look 2D.

My first approach was to try get a low frequency version of the original, and divide through by that image. A simple way to do that is to blur the image. Here is a sample result using that approach:

This does the job of flattening the light, but there are some problems:

There is a light 'halo' around sharp edges.
Large flat patches (e.g. the black patches) lose their uniformity in the middle.
The edges of the ball are affected by the background during the blurring (there's a dark ring around the ball, particularly noticeable at the bottom right corner).

I've tried mucking about with filters (e.g. bilinear) but haven't really found anything that works. I've also tried to use wavelets (a frequency based approach makes sense to me), but those approaches tended to distort the fine detail, which is very important.

Any ideas on how to do this are greatly appreciated!


texts: How to verify and plot expression for sampled signal is correct?

texts:
Given the signal $x_a(t)=4cos(2\pi\times40t+\pi/3)+10cos(2\pi\times160t-\pi/6)$, I am to sample it at $f_s=200Hz$ and find the expression for $x[n]$
My process:
$$x[n]=x_a(nT)=x_a({n\over f_s})=4cos(0.4n\pi+\pi/3)+10cos(1.6n\pi-\pi/6)$$
and due to aliasing:
$$x[n]=4cos(0.4n\pi+\pi/3)+10cos(0.4n\pi+\pi/6)$$
How do I verify that the expression for the discrete-time signal is correct?
What I've tried so far:

A1 = 4; A2 = 10; f1 = 40; f2 = 160; th1 = pi/3; th2 = -pi/6; fs = 200;
dt = 0.0001;
t = 0:dt:0.2;
x_a = A1*cos(2*pi*f1.*t + th1) + A2*cos(2*pi*f2.*t + th2);
plot(t, x_a);
hold on;
n = 0:0.2*fs;
x_n = A1*cos(0.4*pi.*n + pi/3) + A2*cos(0.4*pi.*n + pi/6);
stem(n/fs,x_n,':', 'LineWidth', 1.5);
hold off;

And I get the following plot:

So it seems like the discrete signal's values match those of the continuous signal.
Is plotting both signals and checking if the sampled values match the right way of verifying?
I'm still wrapping my head around sampling so any additional information that can help me understand the process and the outcome better is more than welcome.
Also, it seems like there's no way to properly reconstruct the signal with the given sampling frequency so I'm assuming the point of this exercise is just to test my knowledge of sampling and this is not a practical way of sampling, correct?
Thank you!


texts: doesn't OFDM inherently deals with ISI? why cyclic prefix is needed?

texts:
As far as I can understand, the motivation to OFDM and multi carrier communication in general was alot due to the ISI caused by multi-path which is equivalent to frequency selective channel.
Now, by using OFDM, we send our symbols over sub-carriers, thus each symbol in the frequency domain is affected by approximately a constant channel response.
Then, why is there an aditional need for cyclic prefix? doesn't using sub-carriers enough for dealing with the ISI?


texts: Restore RGB Values from Luminance Value?

texts:
I am not sure, but can we get RGB (Red-Green-Blue) values from calculated luminance value for each pixel?

L = R_irradiance*.265 + G_irradiance*.67 + B_irradiance*.065


texts: Problem implementing KL expansion with square-exponential kernel: output just looks like Gaussian

texts:
I am trying to implement the Karhunen Loeve expansion for a 1-D Gaussian random field with a square-exponential kernel.

Specifically, I know that a Gaussian process has a KL expansion $\hat{U}=\sum_{i-1}^{N_{KL}} \sqrt{\lambda_i}u_i(\mathbf{x})\xi_i(\theta) $, where $\xi_i$ are independent, center-normalized Gaussian variables, and $\lambda_i$ and $u_i$ are the eigenvalue/eigenfunction solutions to the Fredholm equation $\int_\Theta K(\mathbf{x},\mathbf{x}')u_i(\mathbf{x}')d\mathbf{x}'=\lambda_iu_i(\mathbf{x})$.

For the case of a square-exponential kernel of the form $K(\mathbf{x},\mathbf{x}')=\sigma^2\exp(\frac{-(x-x')^2}{2l^2})$, This source gives the solution $\lambda_k=\sqrt{\frac{2a}{A}}B^k$ and $u_k(x)=\exp(-(c-a)x^2)H_k(\sqrt{2c}x)$, where $H_k$ are $k$th order Hermite polynomials, $a^{-1}=4\sigma^2$, $b^{-1}=2l^2$, $c=\sqrt{a^2+2ab}$, $A=a+b+c$, and $B=b/A$.

I am now trying to apply this to generate a Gaussian process for a domain length of 1000 units, with a grid spacing of 1 unit, and correlation length of 20 units. Because random variables in a KL expansion are drawn from a unit-normal distribution, I interpreted that as $sigma^2=1$. My MATLAB code for this is below:

% define domain:
x = linspace(0,999,1000);

% define statistical properties:
correlation_length = 20;
variance = 1;
mean = 0;

% helper variables for eigenvalues/functions:
a = (4*variance.^2).^-1;
b = (2*correlation_length.^2).^-1;
c = sqrt(a.^2 + 2*a*b);
A = a + b + c;
B = b/A;

% set arbitrary truncation point to 20 eigenfunctions:
Nkl = 20;
% plot 4 realizations:
U = zeros(4,1000);
for i = 1:4
   for k = 1:Nkl
       U(i,:) = U(i,:) + sqrt(kth_eval(k, a, A, B)) .* ...
           kth_efunc(k, a, c, x) * normrnd(0,1);
   end
end
figure;
plot(x, U);

% eigen value/vector calculations:
function e_val = kth_eval(k, a, A, B)
    % return scalar value of kth eigenvalue
    e_val = sqrt(2*a/A) * B.^k;
end

function e_func = kth_efunc(k, a, c, x)
    % return 1-D vector of values taken by the kth eigenfunction
    % over the domain x
    e_func = exp(-(c-a)*x.^2).*hermiteH(k,sqrt(2*c)*x);
end

This gives me an output with the following appearance:

Which seems incorrect to me, as I want to get a process that is statistically similar to the following:

With this code, I can also plot the $k=1,2,3$ eigenfunctions, giving the plot:

1 has a plot of the first $k=0,1,2$ eigenfunctions, as shown below for $a=1, b=3$:

When I plot the first 3 eigenfunctions with my code with the same a and b, I do get a visually similar results:

However, even this still generates problems for me, as when I attempt to realize a Gaussian process as with the code above and normalized random variables, I seem to just get the same symmetric shape re-scaled by a random factor, rather than random shapes that are statistically similar:

If anyone knows what's causing the discrepancy between the results of my code and what I am expecting, I would be grateful to know.


texts: Calculation of eigendecomposition of a signal in its Fourier domain?

texts:
I want to find the eigendecomposition of a 3-dimensional discretely sampled signal $X$, where each sample $X_{i,j,k}$ is treated as a vector $\langle i, j, k\rangle$ (with the origin at the middle of the signal) and with an associated weight $X_{i,j,k}$. (I need to figure out the rotation that best aligns one such sampled 3D grid with another, hence the eigendecomposition.)
Since I'm working with the Fourier transform of $X$, i.e. $\mathcal{F}(X)$, I wanted to see if it was possible to calculate the eigendecomposition directly in the Fourier domain.
My initial thought was that $N$-dimensional rotation in the signal domain (for $N \gt 2$)  results in the same rotation in the frequency domain -- so the eigenvectors should be directly correlated. However, I assume there must be some sort of rotational offset between the eigenvector basis in each of the two domains, since calculating eigenvectors in the frequency domain will produce vectors dependent upon the  magnitude of each frequency, whereas calculating eigenvectors in the signal domain will produce vectors dependent upon the position (phase) of values.
Questions:

Is there any way to compute the eigendecomposition directly in the frequency domain?

Is there any shortcut for computing the eigendecomposition as described, i.e. treating each signal-domain sample as a vector or point $\langle i, j, k\rangle$ with weight $X_{i,j,k}$, without having to create a large matrix listing all the indices $i$, $j$, and $k$ of each point in the signal, with their associated weight?


texts:
I'm very new to signal processing, but was asked to implement a filter function for Butterworth low pass filter for given order, cutoff frequency and sample rate.

After reading some articles I think i figured out what I have to do is:

Calculate the poles of the digital transfer function H(s)
Use bilinear transformation to get the  poles of the analog transfer function H(z)
Write difference equation with y(k) = ...

For now I implemented the calculation of the poles, which seems to work:

     public class ButterworthBase
  {
    private const double Gain = 1; // Gain for Butterworth

    public ButterworthBase(int order, double cutoffFrequency, double sampleRate)
    {
      // calc digital cutoff frequency
      double wc = 2 * Math.PI * cutoffFrequency;

      var poles = new ImaginaryNumber[order];

      // calc poles TODO: calc only (order) n / 2 poles => mirror real axis to get the other n/2 poles
      for (int k = 1; k <= order; k++)
      {
        // poles[k] = wc * Math.Exp( i * exponent);

        double exponent = (Math.PI / (2.0 * (double)order)) * (2.0 * k + (double)order - 1.0);
        double real = Math.Cos(exponent);
        double imaginary = Math.Sin(exponent);
        poles[k - 1] = new ImaginaryNumber(wc * real, wc * imaginary);
      }

      // bilinear transformation of poles:
      var transformedPoles = new ImaginaryNumber[order];

      for (int k = 1; k <= order; k++)
      {
        var transformedPole = new ImaginaryNumber(0, 0);

        transformedPoles[k - 1] = transformedPole;
      }
    }
  }

  public class ImaginaryNumber
  {
    public double Real { get; }
    public double Imaginary { get; }

    public ImaginaryNumber(double real, double imaginary)
    {
      Real = real;
      Imaginary = imaginary;
    }
  }

I'm struggling at the transformation, I know the transfer function is
s -> 2/T (1-z^-1)/(1+z^-1)  where T = sampling period.

Can anyone help me please?


texts: Why can't this system be adequately represented using a z-domain transfer function?

texts:
According to this question and answer the following system cannot be adequately captured by a z-transform transfer function.
$$y[n] = y[n-1] + F_{\psi}(y[n-1)) + F_{\phi}(x[n-1])$$
where $F_{\alpha}(z)$ is a first order high pass filter of the form
$$F_{\alpha}(z) = \frac{\alpha (1 -z^{-1})}{1-\alpha z^{-1}} $$
The answer states that

The problem is that there's a pole-zero cancellation that snuck right by me and everyone else. It's evident in the left-hand side of (1), where the derivative of yk is the subject of the equation.

So the reason that you can't solve this problem as stated using the final value theorem is that you cannot adequately represent the system using a transfer function. There may be some way to save this within transfer function notation, but I just tried and failed at the first step, so I'm going to do it in state-space

What limitations of the z-transform (or others) require that this system be analyzed using alternative methods? What features of systems in general pose the same difficulty and why?


texts:
I have signal. I do Fast Fourier transform on it and now I have this output.

I want to delete the other except two that have high altitude. Can you help me ?

My f sample is 2500.

My complete time is 10s.

My time rate is 0.0004s.


texts: Received Morse Code signal-to-noise ratio?

texts:
I have some digital recordings of some received over-the-air CW broadcasts of known plain-text (W1AW code practice) at known WPM code speeds, but in moderate to heavy RF noise and fading.

Can I describe a S/N ratio for the Morse Code in these recordings?  If so, how would I calculate this S/N ratio?  What bandwidths should I use for the signal and for the noise?  Should I use recordings with or without the radio receivers narrow-band CW filter enabled?

If possible, I would like to use these S/N numbers to try and plot the decoding error rates versus the S/N ratios for various "demodulators" (including both software decoders, as well as humans at different experience levels).


texts: Can linear transforms of vector space be seen as LTI systems?

texts:
Linear transforms of vector spaces has the linearity (i.e., homogeneity and superimposability), which is shared by LTI system. There are also shared concepts such as eigenvectors/eigenvalue...

I am wondering, can linear transforms (of vector spaces) be seen as LTI systems? If not, why? If yes, in particular, are there counterparts in vector spaces for the concept of Dirac $\delta$ and $h(t)$ in LTI systems, where $\delta$ represents all possible inputs (e.g., from frequency space point of view), and thus $h(t)$ characterizes the LTI system? If these two counterparts exists in Linear transforms, what's the counterpart for convolution?

A little background: I had this question recently as I am studying linear algebra (starting from some basics) ...actually I first read some books on DSP/DIP a couple months ago, and then I find out that I need to learn some basics of linear algebra (as well as other branches of math), otherwise most of the DSP/DIP literature are foreign to me...in other words, I am also new to the field of DSP/DIP...so I beg your pardon that my question may be a bit fuzzy.

Thanks.


texts: Is there an analogy of the Fourier-decomposition in the Laplace space to decompose a signal to a few components?

texts:
I have a signal from which I know, that it is the sum of a few, exponentially decaying components. I want to find these components.

If it would be a sum of some sinusiod waves, it would be easy to Fourier-transform it, and then find the Kronecker-deltas with some heuristics. It is because the Fourier-transform of a sinusiodal signal is a $\delta$.

If the signal would be the superposition of some damped oscillators, as it is asked in this question, the problem would be still easily solvable by a 2d fourier transform. If I understand it well, the trick is that we use the fourier space to decompose the decaying signals. I think it would work only if the oscillators would have a different decay time constant, if they belong to different frequencies.

However, my signal is not from dampened oscillators, it is a simple decaying signal without any oscillation, making this question not a dupe.

My first naive try was to Laplace-transform it, and then do like in the Fourier case. It does not work, because $\mathbb L \{ae^{-bt}\}=\frac{a}{s-b}$. First, it is singular, making its digital processing problematic, but the major problem is that I can't see any easy way to find the components in the result.

Maybe Laplace is not usable for that, or it should be done with Laplace, but somehow differently?


texts: Best way to detect steps and slopes in a signal

texts:
what is the best way of detecting larger steps and slopes in a signal?
(as shown in the pictures, 1. to be detected signal, 2. good signal)
I thought about some kind of sliding window analysis.
Thanks for help.


texts: DFT and then IDFT does not provide the same signal

texts:
I'm new at Fourier Transforms. I'm using AForge.Math FFT/DFT algorithm (C#). Said that I have this situation:

My signal:

$$
1.4 + sin(2\pi t) + 0.4sin(5·2\pi t)
$$

Sampling: 100 samples each second.

Here is the spectrum. The DFT finds the frequencies of my signal: 1Hz and 5Hz (and the constant component: 0Hz).

Here is the inverse transform. As you can see the result is similar in shape to the original but obviously something is happening there.

My questions:

What parameters can I change to get better results.
Should I expect to completely be able to regenerate the signal in time domain from the spectrum?
Can the IDFT be used as a signal generator? It's very easy to create the peaks at the desired frequencies.
Maybe I need to go to the books, but, why there is always a mirrored frequencies in the DFT and how should I interpret them? I don't have any frequencies at 95Hz nor 99Hz. Is it a flaw of the DFT?
Why the initial point is not mirrored?
The amplitudes of the peaks in the spectrum are not correct: the first one should be 1 and the second 0.4. I've heard that the amplitudes in a spectrum are not important, is that truth, if so why? Anyway, I think it's very useful to know what is the amplitude of the sinusoids, is there a way to do that?
Can I throw away the symmetric part?
If so, can I throw away the almost null values till the first frequency from the middle to start? (in my case from 50Hz to almost 5 Hz).

EDIT:

As pointed here I needed to, first keep the real/imaginary data from the direct transform and, second, adapt that data because I'm using an complex inverse DFT.

Here are the results:

In cyan/purple : Re/Im parts

In red: final result.

The X spacing is wrong but that's a story for another day.

Thanks everyone.


texts: Deriving Time-Series Data from PSD when the Inverse Fourier Transform doesn't converge

texts:
So I'm trying to get some sample time-series data from pink noise (PSD: $S(f) = 1/f$). However, when I try to evaluate the Inverse Fourier Transform integral

$\int \frac{1}{\omega} e^{j \omega t} dt$

from negative infinity to positive infinity, I get a non-converging integral. I tried a Taylor Expansion, but I'm running into the same issue. Is there some other way around this?


texts: What Are Less Computationally Demanding Alternatives to the Viterbi Decoder?

texts:
What are less computationally demanding alternatives to the Viterbi Decoder?

Ideally what I would like is a list of the most commonly used approximate methods, along with brief pros and cons.


texts: Design of a Butterworth lowpass filter in MATLAB

texts:
I'm using the Signal Processing Toolbox in MATLAB to design a Butterworth low-pass filter. I'm told that my filter has been giving some unexpected results. In particular, when the values from this filter are differentiated (i.e. to calculate velocity from a position signal), the velocity values are coming out a little too high. However, with my limited experience in the field of Signal Processing, it's not clear exactly how the filter is failing, or indeed whether there is fact a problem at all. Perhaps the filter is somehow artificially raising the absolute value of the signal? Below is a MWE of the code I have written, based on the Signal Processing Toolbox, commented to try to explain each step. My question is: is this a simple case of a (correctly-implemented) low-pass filter or is there a better solution I might try? Note that my (true) input data tend to have NaNs throughout; hence I include here some code to interpolate those before feeding into the filter.

function filteredData = testfilter(inputData)

%% Generate an example signal
inputData = filter([1,1],1,randn(1000,1));

%% Set filter parameters
dataSamplingRate_hz = 1000;
order = 4;
cutoff = 90;

%% Apply filter
nyquistFrequency = dataSamplingRate_hz/2; % find the Nyquist frequency
filterCutoff = cutoff/nyquistFrequency;

[b,a] = butter(order,filterCutoff); % define the filter

%[b,a] = besself(order,cutoff/nyquistFrequency); % maybe a Bessel filter would be better to use instead???
filteredData = nan(size(inputData)); % preallocate resources
for i = 1:size(inputData,2) % for each column of inputData
    timestampsOfNans = isnan(inputData(:,i)); % find the timestamps of NaNs
    inputDataInterpolated = interpolatenans(inputData(:,i)); % replace NaNs with interpolated data (filters can't handle NaNs)
    filteredData(:,i) = filtfilt(b,a,double(inputDataInterpolated)); % filter the data (n.b. filtfilt() requires doubles)
    filteredData(timestampsOfNans,i) = NaN; % replace the NaNs back into the vector
end

%% Plot the 'before and after' signal
figure
hold on
subplot(2,1,1)
plot(inputData)
subplot(2,1,2)
plot(filteredData)

function data = interpolatenans(data)
% Interpolates NaNs in a vector by approximating with the data either side of the gap

nans = isnan(data); % find nans
t = 1:length(data);
data(nans) = interp1(t(~nans),data(~nans),t(nans),'linear');

The above code produces the following plot, which looks - to my untrained eye - to be appropriate. Is this the case?

(I recognise that at this stage, I do not have a specific problem to address here, as I do not yet understand why my code is producing elevated values. If a specific problem is found with this code, I will adjust my question to reflect the underlying issue)


texts: Designing an allpass IIR filter with arbitrary phase response

texts:
could you tell me step by step the algorithm to design an arbitrary phase response IIR allpass filter design ?

I know Matlab uses a "brute force" algorithm to find an arbitrary group delay response but how do they do that?


texts:
Spatial moment
  $$
m_{pq} = \sum_{(x, y)\ \in \mathbb R} x^p y^q I(x, y)
$$
  The order of each moment is $p+q$.
  Central moment
  $$
\mu_{pq} = \sum_{(x, y)\ \in \mathbb R} (x - \bar x)^p (x - \bar y)^q I(x, y)
$$

What transformation are the central spatial moments $\mu_{pq}$ invariant to that the spatial moments mpq are not?


texts: VHF Artifact Contaminating Electrophysiological Sleep Signals

texts:
I am trying to remove an artifact from a VHF transmitter (programmed at a frequency of 148535; 1.5sec between 200ms pulses; 1.7sec peak to peak) from a sleep recording (polysomnography recording with electroencephalogram, electromyogram, electrooculogram, and electrocardiogram sampled at 500Hz) of a wild animal. There is a large electrical artifact picked up independently by each of 9 electrophysiological channels generated by the VHF transmitter (a consequence of moving from the lab to the field, because we use these to locate our animals in the field). The biggest problem with the VHF signal is that it changes amplitude based on where the animal is (goes away - signal is attenuated - when the animal is underwater and the artifact reverses polarity from time to time when the animal moves).
I tried band-pass filtering the signals, to try to eliminate higher frequency signals (for example from 0.3 to 35 Hz for EEG and electrooculogram (EOG) and 0.3 to 75 Hz for electrocardiogram (ECG) and 10 to 100 Hz for electromyogram (EMG), and the signal is still there, just gets a bit warped depending on filter settings.
I've also run an independent components analysis in EEGLAB (increasingly standardized for EEG analysis) to see if it can recognize the VHF signal and extract it. If I train the algorithm on the entire dataset, it comes up with a decomposition that doesn't separate out the VHF signal. If I train the algorithm on just a section of the data, it fits that section well, but these ICA weights don't extrapolate well to the rest of the data. In some places, they are able to remove the artifact, but in others, they add it back in.
Please let me know if you have any ideas for what I could try. I am a biologist and do not have a ton of machine learning or programming expertise, but am coding in MATLAB where I have been running the EEGLAB toolbox.
Here is an example of the intermittent signal changing polarity and amplitude over time.


texts: Filtered signal does not follow my cut off frequency

texts:
I filtered my signal with low pass filter butterworth forth order with cutoff frequency of 50 hz. However when I compare the filtered signal with original one in frequency domain, it seems that the cut off frequency started from 25 hz instead of 50.

this is my matlab code and my data from here

%sampling frequency is 146

[b,aa] = butter(10, 50/146,'low');
data_filtered = filtfilt (b,aa,data);

did i make some mistake ?


texts: How to design digital filter from transfer function

texts:
I have two transfer functions and would like to implement an IIR with coefficients.

What is the process to get from my complex transfer function to IIR coefficients?

\begin{align}
F_W &=\frac{1+j\displaystyle \frac{\omega r}{c}-\frac 13\left(\frac{\omega r}{c}\right)^2}{1+\displaystyle \frac 13 j\frac{\omega r}{c}}\\
F_{XYZ} &=\sqrt{6}\frac{1+\displaystyle\frac 13j \frac{\omega r}{c}-\frac 13\left(\frac{\omega r}{c}\right)^2}{1+\displaystyle \frac 13 j\frac{\omega r}{c}}\\
\end{align}

These are the Gerzon/Craven transfer functions for Ambisonic B-Format audio


texts: Matlab filter design,through group delay

texts:
I have the measurements of a filter’s Group delay and S-parameters.
The S-parameters are of the following form, presented in a touchstone file.

  !Agilent Technologies,N5242A,MY49421489,A.09.33.09
  !Agilent N5242A: A.09.33.09
  Date: Thursday, March 22, 2012 19:50:06
  !Correction: S11(Full 2 Port(1,2))
  !S21(Full 2 Port(1,2))
  !S12(Full 2 Port(1,2))
  !S22(Full 2 Port(1,2))
  !S2P File: Measurements: S11, S21, S12, S22:
   Hz S  dB   R 50
  1450000000 -0.44925556 132.79056 -43.664959 42.970737 -43.609634 45.291161 -0.41757283 131.60133

The filter’s Group delay data are like those demonstrated below:

  !CSV A.01.01
  !Date: Thursday  March 22
  !Source: Standard
  BEGIN CH1_DATA
  Freq(Hz)    S21 Delay(s)
  1.45E+09    -2.02E-08
  1.45E+09    -1.32E-08
  1.45E+09    -1.77E-08
  1.45E+09    -1.70E-08
  1.45E+09    -1.56E-08
  1.45E+09    -1.36E-08
  1.45E+09    -1.20E-08

What I want to do is simulate the impact that the group delay will have on a particular waveform using MATLAB. I tried to use the fdesign.arbgrpdelay in order to insert my group delay data and somehow observe how that would impact on a waveform but I am getting the following errors:

Error using fdesign.abstracttype/superdesign (line 96)
Design options must be specified as a structure or as parameter-value
pairs.

Error in fdesign.abstracttype/design (line 11)
    varargout{1} = superdesign(this, varargin{:});

Error in allpassfilterarbitrarygrpdly (line 413)
 Hgd = design(hgd,'iirlpnorm','Weights','MaxPoleRadius',0.95);

I also tried to use fdatool but I couldn't find a way of designing a filter by changing its group delay. The group delay was flat in all the available designs.

Does anyone knows how I can use the Group delay measurements in matlab to simulate a filter through its group delay?


texts: Why is Frequency Shift Keying more immune to noise than ASK?

texts: Is it because noise manifests itself in the transmitted signal's amplitude?


texts: Finding Repetetion rate of ns pulsed waveforms

texts:
my application :
sensing a photo diode output and processing it further, the per-processed output would be a digitally converted pulse waveform with pulse width ranging from 1ns-150ns and pulse repetition frequency 1Hz to 50KHz,now i should find the repetition rate of the 1ns-150ns pulse

as sensing this kind of narrow pulse signals is difficult, my per-processing stage would expand input signal by a factor of 100 thus my signal would become a signal with pulse width 100ns-15000ns

to find pulse repetition frequency for which i thought FFT would do the job

problem statement:
my sampling rate would be 2MSPS - to acquire a 100ns pulse i require that much

so if i perform a 1024 FFT over 1024 samples i acquired i will not find the pulse repetition rate at all, in order to find the repetition rate i have to grab at least 1sec samples and do a very large FFT over it. which is practically foolish

so i am a bit confused in this situation how can i find the pulse repetition frequency of a 100ns pulse,through huge samples acquired, mean while i am of the idea to just using a pulse counter of micro controller.


texts:
So let's say i have this frequency response of a digital filter:

My question is how can i classify this type of filter ( low pass, high pass,...)?


texts: Measure of Separability for Classification Problems

texts:
Hello are there any methods, for a given set of features (possibly high dimensional) and labels (class 1 and class 0), to measure how "separable" the data is?
E.g., if the problem was 2 dimensional with 2 labels I would be looking for 2 distinct clusters with the classes separated linearly.
For more dimensions I am looking to (i) define some measure of separability (difficulty of the classification problem) and (ii) how to compute it.
Ideally this would be model independent so I wouldn't have to tune/fit an ML model to see how well it does before saying how easily the labels are separated.


texts:
I was discussing with a colleague with background in communication about white Gaussian (WG) channel noise.

He said noise is not added by the channel and it's just a misnomer. Noise, which is thermal noise, is actually added by receiver. Channel will just introduce fading, not noise. I was stunned, as I studied in many textbooks that channel add WG noise to the transmitted signal. Is this correct?


texts: Hf ionospheric channel model for large bandwidth

texts:
I know some models like the Watterson model for HF ionospheric channels but those are limited to narrow band frequencies.

Are there some models to bandwidth like 12kHz up to 24 kHz?


texts: spectral leakage for integral number of periods

texts:
I'm attempting to understand spectral leakage and read the following quote on wikipedia:

  Windowing a sinusoid causes spectral leakage, even if the sinusoid has an integer number of cycles within a rectangular window.

This confuses me, since I thought using an integral number of periods caused the leakage to disappear. Moreover, my attempts to quantify/simulate this corroborate my beliefs. For example, take the following sampled, 1Hz simple sinusoid.

import numpy as np

f = 1
ts = f / 3
fs = 1 / ts
t = np.arange(0, 5.1 * f, step=ts)
s = np.sin(2*np.pi*f*t)

with fft:

fft = np.absolute(np.fft.rfft(s))
fft /= np.sum(fft)
bins = np.fft.rfftfreq(len(t))

Now if I add an additional sample,

import numpy as np

f = 1
ts = f / 3
fs = 1 / ts
t = np.arange(0, 5.1 * f, step=ts)
s = np.sin(2*np.pi*f*t)

As expected, I get spectral leakage.

Is the Wikipedia quote incorrect, or did I misinterpret it?

Note: I think a better tag for this is spectral-leakage, but I don't have enough reputation to add it.


texts: How to produce color image using edge detected images?

texts:
Hi I am trying to produce an image which is a combination of multiple images such as in focus stacking. Now I have 6 photos and I want to produce a final image such that the final image uses blocks of individual images with maximum value of the block.
But I want to do edge detection of these 6 images first and based on the maximum edges produce a final image such that the final image has the maximum edges from the combination of all images. But the final image produced should be a color image and not in the edge detected form. Is it possible to do so?
Images can be accessed here


texts:
I am always confused about the processing gain in the receiver. Assume my receiver had the following:
$$\boxed{\text{LNA}}{\longrightarrow}\boxed{\text{Mixer}}{\longrightarrow}\boxed{\text{Filter}}{\longrightarrow}\boxed{\text{ADC}}$$

Does the filter in the analog section has any role to play with the processing gain?
I know if the ADC is 12 bit and 100 msps sampling its SNR is $$12\cdot6.02+1.76=74\rm \ dB$$
if I sample at 200 msps does processing gain increase?
If I am using FFT analysis the processing gain increases, but if there is no FFT how to increase processing gain in digital domain (by filtering)?
What is the significance of processing gain?


texts:
I'm trying to analyze GPS L1 C/A signal on MATLAB. I could generate the PRN codes(binary signals). After I add NAV Data to the PRN code using modulo 2, I need to modulate it using BPSK. I also could it(I am using IF_freq=20 instead of real frequenc=1.5GHz).

For getting the PSD graph of the modulated signal, I correlated it by itself and got FFT of the correlation. But my graph seems wrong, can someone explain why I am getting this graph?

Original spectrum:

My spectrum:

My MATLAB code:

prn_1_40ms = repmat(prn_1,1,40); %%PRN 1 for 40ms
prn_2_40ms = repmat(prn_2,1,40); %%PRN 2 for 40ms

[PSK_signal,org_data,time_bpsk] = BPSK_Modulation(prn_1);

correlated_sig=xcorr(PSK_signal,'normalized');

Fs=400;
PSD=abs(fftshift(fft(correlated_sig)));
freq = -Fs/2:Fs/length(PSD):Fs/2-(Fs/length(PSD));
figure;
subplot(2,1,1);
plot(correlated_sig);
subplot(2,1,2);
plot(freq,PSD);

function [mod_sig, org_sig, time_out] = BPSK_Modulation(data)
    %%For BPSK Modulation
    %%https://www.mathworks.com/matlabcentral/fileexchange/30582-binary-phase-shift-keying
    % Enter the two Phase shifts - in Radians
    % Phase for 0 bit
    P1 = 0;
    % Phase for 1 bit
    P2 = pi;
    freq_L1=20; %Instead of using L1 real frequency, we use lower frequency
    %to make the calculation easier and make the details more appear on the
    %graph
    freq_Samp=freq_L1*50; %Sampling frequency have to be at least double the
    %carrier frequency. Higher sampling, more resolution.
    f=freq_L1;
    t=0:1/freq_Samp:1;
    time=[];
    PSK_signal = [];
    Digital_signal = [];

    for ii = 1: 1: length(data)

        % The FSK Signal
        PSK_signal = [PSK_signal (data(ii)==0)*cos(2*pi*f*t + P1)+...
            (data(ii)==1)*cos(2*pi*f*t + P2)];
        % The Original Digital Signal
        Digital_signal = [Digital_signal (data(ii)==0)*...
            zeros(1,length(t)) + (data(ii)==1)*ones(1,length(t))];

        time = [time t];
        t =  t + 1;

    end
    mod_sig = PSK_signal;
    org_sig = Digital_signal;
    time_out = time;
end


texts: DFT method for a sequence defined by recursion

texts:
I encountered the following interesting computational problem in the field of computational statistical mechanics.

https://www.dropbox.com/s/8yimd9uy5u0jrdj/dftpr.pdf

thank you :)


texts: If a square wave is a sum of odd harmonic impulses, why is it continuous in the frequency domain?

texts: A square wave is a sum of sinusoids so surely it should be represented as individual discrete impulses in the frequency domain, where all other frequencies are 0. Why instead are those intermediate frequency components not 0, and form a continuous sinc shape? I know that the continuous fourier transform of $A\text{rect}(\frac{t}{\tau}) = A\tau \text{sinc}(f\pi\tau)$, but why is this the case when you think about it in the first perspective?


texts:
I'm working on image processing that involves facial features.

Where can I get a generic 3D model of a human face? (any format is fine as long as I can manipulate the data using C or Matlab)


texts: Correlation filter output range normalization

texts:
I'm developing correlation filters based image recognition.
I implemented MACE correlation filter in matlab:

training code:

D = diag(mean(abs(X),2));
% inv(A) * B = A \ B
XDX = ctranspose(X) * (D \ X);
h = (D \ X) * (XDX \ u);
H = reshape(h, size(I));

where X is the d.^2xN matrix of vectorized FFT2 transformed training images (images FFT2 transform spectra are vectorized by concatenating columns), u is the vector of image membership (1 for images to recognize and 0 for the rest of the samples), I is the dxd sample training image to reshape correlation filter h to H matrix.

testing code:

R = ifftshift(ifft2(I.*conj(H)));

where I is the dxd test image zero mean and unit variance normalized and H is the trained correlation filter.

I trained one correlation filter on 61 training images from which there is just 1 image to recognize with 1 in vector u and remaining images with 0's in vector u.

However despite reported results in the papers on correlation filters where correlation plane output is in range 0 ... 1 my results are up to 10e-4.

Is there any normalization typically applied to scale correlation plane output?

Besides I found that without conj(H) in the testing code there is no correlation peak for images to be recognized. I was unable to find in the papers that missing operator in the formula which I found at mathworks forum


texts: Which is the total energy of the product of two discrete energy signals

texts:
Assume that I have two signals with finite energy.

The first, $x_s$
\begin{equation}
E_s = \sum_{i=0}^{N} |x_s(i)|^2
\end{equation}

and the second, $w$
\begin{equation}
E_w = \sum_{i=0}^{N} |w(i)|^2.
\end{equation}

Then, which is the enrgy of the follwoing signal that combine the two ones as follows

\begin{equation}
E_s'=\sum_{i=0}^N |x_s(i) \cdot (1+K w(i))|^2
\end{equation}

In particular assuming $x_s$ and $w$ uncorrelated, is there a way to express $E_s'$ as fucntion of $E_s$ and $E_w$?

Thanks in adavance.

PS: I have already posted a smiliar question here
https://math.stackexchange.com/questions/1560821/which-is-the-total-energy-of-the-product-of-two-discrete-energy-signals


texts: Conceptual Questions on Colored Noise Process

texts:
I am having a tough time finding answers to some specific questions and finding references where there is information regarding Brownian noise or Red Noise. I'm referring to white and colored noises where white noise can be Gaussian or Uniform Noise where the power spectrum is flat. Along the same line we have colored noise whose frequency is $1/f^{\alpha}$ where $\alpha =1$ for pink noise and $\alpha =2$ for brown or red noise. Matlab Code to generate colored noise presents the code to generate colored noise by filtering white noise simulated using randn.
This question is inspired from a previous question asked here: Stationary vs non-stationary signals?
Shall be obliged for the answers to the  following specific questions. Please correct me wherever I am wrong.

Is brown noise stationary or non-stationary? If stationary then, the signal does not change with time. Then how come it appears to be random?

If a signal is corrupted with brown noise and pink noise respectively, how would the noisy signal's characteristics differ? I think since brown and pink noise samples are correlated, the resulting noisy signal's samples if it was uncorrelated when clean, would now become correlated? Not sure about this. It's important for me to know so that I can apply specific noise filtering techniques for correlated and uncorrelated signals.

An example of non-stationary process?

Do the terms "noise" and "process" mean the same?


texts: How to apply Butterworth High Pass Filter

texts:
I have a problem with applying Butterworth High Pass Filter to my data. I would like to print filter for Bx and By matrix. As you can see I have both positive and negative values,

  how to apply math.fabs() to Bx and By to get only positive
  values?

For my high pass filter I have those requirements:

Fc = 2 Hz

I would like to cut off values below 100 pT.

A part of my current code is:

plt.ylabel('Pico Tesle [pT]')
plt.xlabel('Time [ms]')
plt.grid()
plt.plot(time[51:-14], Bx[51:-14], label='Canal 1', color='r', linewidth=0.1, linestyle="-")
plt.plot(time2[1:-14], By[1:-14], label='Canal 3', color='b', linewidth=0.1, linestyle="-")
plt.legend(loc='upper right', frameon=False, )

And a chart:

UPDATE:
I have used this function to generate absolute values for Bx and By matrix.

plt.subplot(413)
np.absolute(fft1)
plt.plot(time[51:-14], np.absolute(fft1), color='r', linewidth=0.1, linestyle='-')
plt.grid()

plt.subplot(414)
np.absolute(fft2)
plt.plot(time2[1:-14], np.absolute(fft2), color='b', linewidth=0.1, linestyle='-')
plt.grid()

What I received thanks to that is that all my measurements (here are atmospheric discharges) are only in positive values (pT - picoTesla). First plot shows Canal 1, second plot shows Canal 3, and the third plot shows both Canals (Channels) combined.

No, I need (I guess) use High Pass Filter to cut off all measurements below 100 pT. Any ideas?


texts: Difference between real and complex impulse responses?

texts:
I want to know the characteristic differences between real and complex impulse responses.

Thanks, JK


texts: Estimating the Nyquist rate when simulating data

texts:
I want to find the power spectrum $\tilde{Q}(\omega)$ of a quantity $Q(t)$. The values of $Q$ are computed at discrete time steps so I have a series $Q(\Delta t)$, $Q(2 \Delta t)$, ... of values, but the calculation at each time step is independent rather than (for example) needing to know the value of $Q(\Delta t)$ in order to compute $Q(2 \Delta t)$. I then compute the power spectrum of $\tilde{Q}(\omega)$ by an FFT of the signal.

My main question is what is a good way to choose $\Delta t$ i.e. estimate the Nyquist rate of $Q(t)$ without wasting a lot of computing time?

I'm also wondering, given that the calculations at different times are independent, is there a smarter or more efficient way to find $\tilde{Q}(\omega)$ than generating a time-series and performing an FFT.


texts:
I looked at posts that discusses 3D kalman filter.
Kalman Filter to estimate 3D position of a node
Help with Kalman Filter implementation for estimating 3D position

Both from my understanding, both person were attempting the same thing, which is calculating 3D position based on accelerator readings. Yet their process for setting up the Kalman filter is completely different.

My own method is also different

These are my equation based on what I learned here, it treats acceleration as the U vector http://www.cl.cam.ac.uk/~rmf25/papers/Understanding%20the%20Basis%20of%20the%20Kalman%20Filter.pdf

Xk = AXk-1 + BUt
x_curr = x_prev + x_vel_prev * dt + 0.5*dt^2*x_acc
x_vel_curr = x_vel_prev + dt*x_acc

The sescond post seemed to have dropped  the U vector completely similiar to this example http://campar.in.tum.de/Chair/KalmanFilter#Literature.

While the first post has a different process equation based on wiki and it uses Ga instead of Bu https://en.wikipedia.org/wiki/Kalman_filter#Example_application.2C_technical:

X = FX_prev + Ga

This is what I did and it make sense I think:

X = [x,y,z,dx,dy,dz]

U = [ddx, ddy, ddz]

A = np.matrix([[1, 0, 0, dt, 0,  0],
               [0, 1, 0, 0,  dt, 0],
               [0, 0, 1, 0,  0,  dt],
               [0, 0, 0, 1,  0,  0],
               [0, 0, 0, 0,  1,  0],
               [0, 0, 0, 0,  0,  1]],
             )
B = np.matrix([[0.5*(dt**2), 0,           0],
               [0,           0.5*(dt**2), 0],
               [0,           0,           0.5*(dt**2)],
               [dt,          0,           0],
               [0,           dt,          0],
               [0,           0,           dt]])

H = np.matrix([[1,0,0,0,0,0],
              [0,1,0,0,0,0],
              [0,0,1,0,0,0]])
P = np.matrix([[10,0,0,0,0,0],
              [0,10,0,0,0,0],
              [0,0,10,0,0,0],
              [0,0,0,100,0,0],
              [0,0,0,0,100,0],
              [0,0,0,0,0,100]])

Q = np.matrix([[1,0,0,0,0,0],
              [0,1,0,0,0,0],
              [0,0,1,0,0,0],
              [0,0,0,1,0,0],
              [0,0,0,0,1,0],
              [0,0,0,0,0,1]])

R = np.matrix([[1,0,0],
              [0,1,0],
              [0,0,1]])

What I dont understand is, how come the previous 2 posts have completely different matrix? Is there a reason why? And is my approach correct?

Any input and suggestion is greatly appreciated


texts:
I am fairly new to studying communication systems.

When it comes to different digital modulation techniques, does the effect of an additive complex noise (a) introduced by the system, and (b) by the channel vary depending on the type of modulation used?

Moreover, is the noise introduced by the non-ideal system can be treated exactly the same as with the noise introduced by the channel (that is, the approach to work around and solve them are the same)?


texts:
I have developed a spectrum scope that plots signal vs. frequency starting from IQ signals.  I currently do not have a way to balance the IQ signals, so am looking at various ways to do so.  I have come across this article, which is reasonably easy for me to follow since I am fairly new to all DSP. The one question I have is concerning the notation of some of the equations:
For example, $a^2 = 2\langle t(i) * t(i)\rangle$. What does $\langle\cdot \rangle$ represent?  I can find no reference for these in mathematical symbol tables.


texts:
I have four .wav files and each contain bird chirps.  Given an input .wav file, I need to find out which bird it is.

I have some basic understanding of signal processing. I have used spectrogram to analyze my audio files and now I don't know how to make the frequency spectrum comparison to find out the solution.

Can someone please let me know the process with which I could find out the frequency of sound, bird chirps in my case, programmatically from the spectrogram? I am just a beginner, so I apologize if I said something which wasn't clear


texts: MATLAB: Fourier transform vs $\tt lsim$, results don't match

texts:
My (simplified) problem:
Suppose I have a signal $u$, which passes through system/filter $G$, which gives output signal $y$. Then I have a theorem that states:

If a signal $u(t)$, with Fourier transform $U(e^{j \omega})$ is applied to system $G$, then the Fourier transform of the output $y(t)$ is given by:

$$Y(e^{j \omega})=G(e^{j \omega})U(e^{j \omega})$$

I try to verify this in MATLAB, but something goes wrong.

Implementation:

$U(e^{j \omega})$ is obtained easily enough using fft(u).
For $G(e^{j \omega})$ I use freqresp(sys,$\omega$) (and build
$\omega$ in such a way that it is in the same format as the fft
results: [dc positive-freqs negative-freqs]). I verify this by comparing the result to the bode plot (see commented lines in script)

To verify I perform the inverse Fourier transform y = ifft(Y) and compare the obtained $y(t)$ to the lsim result, which is obtained with $y_{prime}(t)$ = lsim(G,u). Unfortunately these dont match. What am I missing?

clear
close all

G = tf([4700 4393 3.245e08],[1 7.574 1.202e5 0 0]);

f_sh = 1000;                                    %sampling frequency

Gd = c2d(G,1/f_sh);                             %plant discretization

t_end = 10;                                     %[s] simulation time end
t = linspace(0,t_end,t_end*f_sh+1);               %time vector
f_ref = 0.5;                                    %reference freq
u = sin(2*pi*f_ref*t);                        %reference signal

L = length(u);
dF = f_sh/L;                                    %frequency bin step

w = dF:dF:f_sh/2;                               %one-sided frequency vector in Hz

w_eval = 2*pi*[0 w -fliplr(w)];                 %frequency vector for freqresp, formatted to match fft results

H = freqresp(Gd,w_eval);                        %frequency response of system wrt freq vec

H = transpose(squeeze(H));                      %remove singelton dimensions

% bode(Gd) %should be equal to the semilog plot
% figure
% semilogx(w,20*log10(abs(H(2:(L+1)/2))))             %plot in Hz

U = fft(u);
Y = H.*U;
y = ifft(Y);                                    %frequency domain response

yprime = lsim(Gd,u);                              %simulation/time domain resonse

figure
plot(t,yprime,t,y)                           %y should equal yprime
legend('lsim response','fft(sys)*fft(ref) response')

The lsim results appear to have some integrator effect in them???


texts: Whats the difference between spatial and temporal resolution?

texts:
Iam trying to understand how super-resolution works. But i think i have not understood correctly the difference between the optical resolution (spatial resolution?) and the resolution i know from a simple signal. I mean, i can have a higher sampling rate to improve resolution. Does this also effect images in the same way? And what about aliasing? Is aliasing in images difference than in a 1 D signal?
Here is a nice paper from google where they apply super-resolution on google pixel camera. They write:
Super-resolution techniques reconstruct a high-resolution signal from
multiple lower resolution representations.
They use multiple pictures taken at once, and use pixel shifts resulting from hand motion ... that pixel shifts and aliasing in the signal is used with kernel regression and other algorithms to reconstruct a higher resolution."The input must contain multiple aliased images, sampled
at different subpixel offsets. This will manifest as different
phases of false low frequencies in the input frames"
Is there a difference in applying this technique with Aliasing and multiple frames on 1d signals? How can i understand subpixel shifts applied on 1d signal.


texts:
I'm slightly confused about baseband pulse shaping.
Let's assume I have a complex data vector in an arbitrary complex constellation (QAM for example). I would like to pass this complex vector through a pulse shaping filter (RRC or RC).

As far as I know RC/RRC filters have a real impulse response, thus I can generate a sampled version of the filter.
Am I correct to assume the filter is real ? Do I have to represent the filter as an analytic function (ie: $h_{RC}(t)=h_{RC}+j\hat{h}_{RC}$ ) before convolving my vector with it ?


texts: MATLAB Rayleigh fading and white gaussian noise

texts:
From the MATLAB code below where do these theoretical equations for Rayleigh fading and white Gaussian noise come from? Or how are they derived?

h = 1/sqrt(2)*[randn(nrx,ntx,N/ntx) + 1i*randn(nrx,ntx,N/ntx)]; % Rayleigh channel
n = 1/sqrt(2)*[randn(nrx,N/ntx) + 1i*randn(nrx,N/ntx)]; % white gaussian noise, 0dB variance


texts: Power Spectral Density (PSD) from autocorrelation

texts:
I have a 1D fractional Brownian motion (fBm) signal, $u(x)$, of size $N$,  generated through a random number generator with a gaussian mean, $\mu=0$, and standard deviation, $\sigma=\sqrt{N}$. I want to find the power spectral density (PSD) of said signal. Signal data, MATLAB-R2018a code, and citation is included in the Github repository (https://github.com/dustinma324/Buruglence) .

From "Numerical Recipes" by Press 2007,
$$ Corr(g,h)_{j} = G_{k}H_{k}^* $$
where $G_{k}$ and $H_{k}$ are the discrete Fourier transforms (DFT) of $g_{j}$ and $h_{j}$, and the asterisk represents the complex conjugate. Normalizing the above equation by $N^2$ returns the PSD.

I am having trouble understanding the difference between the order of performing DFT. I have two road maps in mind to get the PSD. The first being,

$$ PSD = fft\Big(u(x)\Big) \cdot fft\Big(u(x)\Big)^{*} $$

where the PSD is found through breaking up the auto-correlation function into the product of the Fourier transform and the complex conjugate of the Fourier transform (convolution) of the two signals. The second,

$$ R_{11}(r) = u(x)*u(-x)$$
$$ PSD = \bigg|fft\Big(R_{11}(r=0) \Big)\bigg| $$

where the PSD is found by finding the auto-correlation function of the signal first, then taking the magnitude of the Fourier transform of the auto-correlation function.

The dark blue line is the second method, and red is the first. By taking the $FFT$ of the auto-correlation function, the general shape is captured, but the latter method shows small amounts of energy accumulation at the higher frequencies. This violates the Schwartz inequality, since the inner product of to vectors cannot be larger than the product of their magnitudes.

Is there a specific mathematical reason as to why the latter method appears to carry more energy at the higher frequencies?

Here's my MATLAB code below for the two different methods.

Method 1 (Convolution)

n = length(x); %Nx
pwr = [];
meanU = mean(u(:,tavg_start:end),2);
for i = tavg_start:1:nt
   U_fft = fft(u(:,i)-meanU,n)/n;
   pwr = [pwr U_fft.*conj(U_fft)];
end
meanpwR = mean(pwr,2);

Method 2 (Auto-correlation function)

pwR = [];
n = length(x);
meanU = mean(u(:,tavg_start:end),2);
for i = tavg_start:step:nt
    U11 = double(u(:,i)-meanU);
    Ucorr = xcorr(U11); % Output will be 2*length(Ucorr)
    N = 2^nextpow2(length(Ucorr));
    R_fft = fft(Ucorr,N)/(N^2);
    pwR = [pwR abs(R_fft)];
end
meanpwR = mean(pwR,2);

I have not been able to find anything that explains my particular question. Any inputs/suggestions/discussions would be greatly appreciated.

UPDATE Feb 4th, 2020

Auto-correlation function is analogous to a low-pass filter, meaning low frequencies are getting through, and high frequencies are attenuated out (gradual loss) at a certain cutoff frequency. The attenuated frequencies (unresolved energy) is being aliased into lower level frequencies when performing the Fourier transform of the ACF, resulting in the slight increase.

A transition band was described in this link (https://www.ni.com/en-us/innovations/white-papers/18/anti-aliasing-filters-and-their-usage-explained.html). I believe for me this band ranged from $k = N/2$, Nyquist frequency, to $k=2N/3$, where Basu dealiased the same signal using the 3/2 rule in the Fourier domain. This band is said to cause aliasing in the signal, thus showing up in my graph above.

Technically both methods shows some form of aliasing. So are there different kinds of aliasing? One is observed to aliased over a range of wavenumbers, while the other shows a spike.

Thanks,

Dustin


texts:
I have an image as attached

The blue to yellow to red points are the points of interest the algorithm found, while the pink points are the radius per point. This maps pretty fine, but the issue I am having is that I need to find the area covered by this, but there are usually small holes, or when the direction changes, theres a bigger hole. How can I find the areas covered?

My vector contains x,y position of a point, radius r of how big the vessel is, and the direction o, stating in which direction the vessel orients. But I have no good idea on how to find the area in there.