texts:
I have tried to perform sinc interpolation (in 1D) with the following Matlab code:

Fs=8;
T=1/Fs;
t=0:T:(1-T);
f=1;
x=sin(2*pi*f*t);

up_factor=2;

%% Deduce sinc from Fourier domain

xp=[zeros(1,5) x zeros(1,5)];

Xp=fft(xp);

door1D=abs(xp>0);
sinc1D=fftshift(abs(fft(door1D)));

%plot(door1D);hold on;plot(fftshift(abs(sinc1D)))

%% Interp with sinc in spatial domain
x_up=upsample(x,2);
%plot(x,'b*');hold on;plot(x_up,'r*');
x_up_interp=conv2(x_up,sinc1D,'same');

figure;
plot(x_up_interp./up_factor);
hold on;
plot(x);
hold on;
plot(x_up,'r+');

It seems to work (except for ripples due to the Gibbs phenomenon I guess?). However, I worked this out in a "deductive" manner and I dont completely understand the parameters (period/frequency) of the sinc. The approach was to extract the sinc from the fft of the door function. Then use that sinc as if I had computed it beforehand and convolve the upsampled (not yet interpolated) 1D signal with it.

Can someone help me understand it better? How would I built this sinc ? e.g. from the sinc() function of Matlab. And for it to work, I have convolved with abs of sinc cf. conv2(x_up,sinc1D,'same'); , but this seems strange... can someone explain/develop/correct this ?

REM.:also it is probably badly scaled, but that is another detail


texts:
so, here is a very simple model.

The CCDE is given, but I was trying to derive it on my own and now I am stuck.
first of all, the reverse y[n] when goes through the delayed system, it turns to y[n-M].
then when it passes through the leaky integrator system,
$y'[n-M] = (1 - \lambda) * y[n-M] + \lambda * y'[n-M-1]$
combining two,
$y[n] = x[n] + \alpha * y'[n-M]$
$ = x[n] + \alpha * (1 - \lambda) * y[n - M] + \alpha * \lambda * y'[n-M-1]$
Now, I am stuck. Can anyone help me with it? Did I understand something wrong?


texts: Suppose that we have different signals (Pulses). I would like to study which signal has deterministic peak-to-peak distant (lag). For example A=[1 0 0 1 0 0 0 1 0 0 1] and B=[1 0 0 1 0 0 1 0 0 1] and C=[1 0 0 1 0 0 1 0 0 1 0 0 1]. C is best because it has 5 peaks with lag=2, then B is good because it has 4 peaks with lag=2. However A is not good because some times lag =2 some times lag=3. I am looking for a way to evaluate the clear lag between peaks for comparison. Furthermore, it must be prior to higher number of peaks in signal. Is it any way to do so ? Thank you.


texts: Frequency shift and phase shift (Doppler)

texts:
I'm trying to apply a frequency shift to a generated despreading code in order to find and track a broadcast signal CDMA. Expected doppler shift range of the signal from center frequency would be approx +/- 5KHz. Based on freq2 = c/(c-orbitspeed) * freq1.

I am wanting to shift the code based on equations, assuming data set is made of complex numbers.

N = sample size
imaginary j = (0, 1)           same as notation i
new sample bin k = fft(generated code)[k] * e(-1 * j * 2 * PI * shift amount / N * k)

this "* j" makes the power an imaginary number part
e() being the same as *10^power, 10 being a real number (10, 0j)
do I need to follow the complex^complex rule to evaluate the e() expression? Then use the complex * complex to finish the product??

void adjust_CodeDoppler(int shift) // of fft data, apply fft in place first on gen_code
    {
        complex power;
        complex e;
        complex multiplier;
        power.m_re = 0;
        e.m_re = 10;
        e.m_im = 0;
        for(int n=0; n<N; n++)
        {
            power.m_im  = (-2*PI*shift/n*N); //*j part makes this the imag part of power
            double ph = phaseAngleComp(e); //for (10, 0j) is always 0 = 0/10
            double mg = magnatudeComp(e);  //for (10, 0j) is alwyas 10, sqrt( 10^2 + 0^2 )
            multiplier.m_re = pow(mg, power.m_re) * exp(-1 * power.m_im * ph) * cos(power.m_re * ph + power.m_im * log(mg) ); //= 10^power real part
            multiplier.m_im = pow(mg, power.m_re) * exp(-1 * power.m_im * ph) * sin(power.m_re * ph + power.m_im * log(mg) ); //= 10^power imag part
            shift_gen_code[n] = multiplier * gen_code[n]; //using complex operator *
        }
    }

Seperately to affect phase shift in data, Is this done in time domain?? Can this be suffiecient to adjust phase offsets without changing a NCO/VCO on the quad mixer?
Based on equations: also assuming data is alread I / Q  A/D converted
    ph = phase angle
n = bin position, time domain?
Wc = expected center frequency
Dpd = desired phase offset at time []
adjusted_ph = ph[n-1] + Wc + Dpd[n]
//limit phase shift
if(adjusted_ph[n] > 2* PI){adjusted_ph[n] = adjusted_ph[n] - 2*PI;}


texts: finding frequency range and dominant frequency of a stored signal

texts:
I have sEMG signals, captured from commercially available device. the signals are stored in .tdms file format. i want to varify whether the captured signals are really sEMG (or simply EMG) signals or not?
typical frequency range of EMG signals is 5 to 500 Hz and dominant frequency is 50 -150 Hz. can anyone guide me how may i find this from a recorded signal, using either MATLAB or LabVIEW.


texts: How do you apply Kalman Filter to track a signal?

texts:
The example that I've seen on state estimation involves deriving the ABCD matrix of a physical system (i.e. falling object) and tracking that object.

I would like to use Kalman Filter for signal denoising applications (specifically EEG signal). How could I apply KF in this situation since ABCD matrix cannot be derived for a signal.


texts: How to compute the cross correlation of two fuctions

texts:
I am trying to implement Matlab's cross correlation function but I can't seem to replicate the results obtained when using Matlab's built in function "xcorr".

Documentation for xcorr can be found HERE.

Looking at the Matlab documentation it seems as though the cross correlation is implemented as

$$
  R_{xy}[m] =  \left.\begin{cases} \sum_{n=0}^{N - m - 1} x[n + m] y[n]
& m \geq 0\\ \\ R_{yx}[-m] & m < 0\\ \end{cases} \right\}
$$

Or equivalently as

$$
  R_{xy}[m] =  \left.\begin{cases} \sum_{n=1}^{N - m} x[n + m] y[n]
& m \geq 0\\ \\ \sum_{n=1}^{N + m} y[n - m] x[n] & m < 0\\ \end{cases} \right\}
$$

if x and y have indexes starting at 1.The result will then be C, where

$$
  C(m) = R_{xy}(m - N) \hspace{1cm} \text{for} \hspace{1cm} m = 1, 2,...,2N - 1.
$$

The implementation of this formula in Matlab is shown below:

function [result] = myXCorr(A , B)
%Implementation of the Cross Coorelation Function

N = size(A,2);
M = size(B,2);
result = zeros(1, N + M - 1 );
len = size(result,2);

for m = 1 : len
   arg = (m - N);

   if(arg < 0)
       negativeCondition = 1;
       limit = N + arg;
   else
       negativeCondition = 0;
       limit = N - arg;
   end

   for n = 1:limit
           if(negativeCondition == 0)
            result(m) = result(m) + A(arg + n) + B(n);
           else
            result(m) = result(m) + A(n) + B(n - arg);
           end
   end
end

end

This implementation does not produce the same results as Matlab and I can't seem to find out  what the error is.The plots of the autocorrelation's are shown below.

A = 1:1:10;
B = 1:1:10;

myResult = myXCorr(A,B);
mResult = xcorr(A,B);

lag = -9:1:9;

plot(lag, myResult);
plot(lag, mResult);

Autocorrelation using my function:

Autocorrelation using "xcorr":

Does anyone know what 'm doing wrong here? Any help will be appreciated.


texts: What is the proper way to filter out unwanted noise from accelerometers?

texts:
I'm a beginner in signal processing and have a hard time to filter out environmental noise from the floor vibration data collected using accelerometers.

I have tried using butterworth filter (IIR) and sinc function (FIR) along with some window functions. Yet, I do not see obvious change in the time domain plot nor in the frequency domain plot by just using above-mentioned low pass filter.

The frequency domain plot does show some changes when I use the filter along with the window function. But, when I use inverse fft of the filtered data, the magnitude of the original data is reduced. I am not sure if the filter/ window function is applied correctly.

fs = 1652 Hz
fc = 208 Hz

I'm not sure the right way to determine the cutoff frequency since I am not sure what is acceptable range for passband/stopband ripples.

Here is my sinc filter:

def fir_lowpass(data, fc, fs, nfft):

# Convert to normalized frequency
fc_nor = fc / (fs / 2)

N = nfft

n = np.arange(N)

# Compute sinc filter.
h = np.sinc(2 * fc * (n - (N - 1) / 2))

# Compute hanning window.
w = signal.hann(N)

# Multiply sinc filter with window.
h = h * w

# Normalize to get unity gain.
h = h / np.sum(h)

# Apply filter to data
data = np.convolve(data, h, 'same')

return data

Here is my butterworth filter:

def IIR_lowpass(data, fc, fs):

fc_nor = fc / (fs / 2)              # Normalize cutoff frequency

b, a = signal.butter(5, fc_nor, btype='low', analog=False, output='ba')

filt_data = signal.filtfilt(b, a, data)

return filt_data


texts: How do I convert this simple Laplace equation to Z-domain?

texts:
A basic model of coupled strings (eg. piano) is provided here as:

The principle is that it has two identical string simulations each formed by a delay line and LPF. The outputs of these are summed at the "bridge" in the center. The sum is multiplied by $-H_b(s)$ to get the bridge output, which is then subtracted from each of the string loops to simulate damping from energy lost to the bridge.

The bridge equations are:

$$ V_b(s) = H_b(s) \big( V_1^+(s) + V_2^+(s) \big) $$

$$ H_b(s) \triangleq \frac{2}{2+ R_b(s)/R} $$

Where $R_b(s)$ is the impedance of the bridge and $R$ is the impedance of the string.

So in order to implement this, I need to convert $H_b(s)$ (and/or $V_b(s)$) from a Laplace equation to a Z-domain equation.

I am starting to understand some of the principles of the Laplace and Z-domain but I have never converted anything before and I am not sure how to do this. How I get $H_b(z)$ for this usage?

Once I have $H_b(z)$, do I just multiply it by the sums of the two string outputs and then subtract that result from the string loops?

Also, why is the impedance of the string simply $R$ while the impedance of the bridge is $R_b(s)$? Is impedance of the bridge a Laplace function to imply that its impedance may vary with frequency? (Whereas the string impedance would be frequency independent.) If so, how might it simplify things to treat the bridge impedance as frequency independent too?

Thanks.


texts:
In' b.p lathi's book of systems and signal it is written that
"marginally stable systems have one important application in the oscillator, which is a system that generates a signal on its own without the application of an external input. Consequently the oscillator output is a zero input response "
By this statement I have two problem:

if let's say oscillator system is a simple L-C circuit then how can it produce output without input and if it does produce then isn't it a violation of linearity?

and if initial conditions are zero then how can L-C  circuits have zero input response? And then in that case how does it generates signal without initial conditions?


texts:
I've been trying to do this problem for the last few hours. Could someone show me the workings on how it is done? Not just the answer.

The figure shows the structure of a FIR filter where $A = 1.5$, $B = 0.69$ and $C = 3.0$.

If $x[n] = u[n]$, what is the value of $y[n]$ for $n = 20$?


texts: What is the correct length for obtaining a true linear convolution from DFT?

texts:
In the linear convolution of two equal length sequences M and N, the length of the output is length(A)+length(B)-1, and if we apply the DFT property of converting convolution into multiplication, the output is equal Max (length (M) or length (N)).
a) If there a simple way to predict how many edge points are contaminated by circular convolution if we were interested in extracting only the linear convolution section from DFT? Suppose, one does not want to do zero padding in DFT to obtain linear convolution.
b) Secondly, if we wish to do true linear convolution via DFT, should we use zero padding up to length(M)+length(N)-1. This is a figure from a PhD thesis obtainable from ResearchGate pg 18, why does it say if the length of DFT >length(M)+length(N)-1, then results are valid. Is the linear convolution not restricted to the length of length(M)+length(N)-1.


texts: Reconstruction of voice from distorted recordings

texts:
I would like to know how much of the sound of my voice getting through various types of walls can be reconstructed with easily obtainable software and algorithms.

My plan is to place a microphone on the other side of the walls I'm interested in and record the sound getting through. I would then apply reconstruction and try to understand my own speech. Since I am the one talking and I know what I was saying, this would be best case.

Are there ready algorithms, as standalone software, libraries or easy to implement in common software packages like Python, Matlab, Octave, ... (I'm talking about script-kiddie level of knowledge) that I can try to reconstruct offline the speech from the distorted recording?


texts:
I have chain contours representation:
- classic Freeman chain
- angle chain with distance (first: angle between neighbor points, second: distance between   them)

What are the best techniques to match them, and If it is possible figure out rotation of element?

For now I tested approach with FFT(isn't it overuse for short chains?), shifting and comparing
For Freeman chains Pairwise Geometrical Histogram, but it figures out rotation only with 45 degree resolution.

Any sugestions, codes, references will be appreciated.


texts: comb filter design in wireless communication

texts:
How can I implement comb filter in reducing noise in wireless communication?
I am new in signal processing and right now I am still learning about the comb filter. Can I use it to reduce/filter noise in wireless communication?


texts:
I have a set of 10 minute EEG signals that were sampled at 400 Hz and have 16 channels which corresponds to a 16x240000 matrix. These EEG signals belong to two different classes. I am trying to classify these 10 minute segments using a Neural Network, in particular a LSTM.

Since the size of the matrix is very large, even after I split them into time segments, I would like to first reduce the number of samples. My current approach for pre-processing is to use wavelet transform for denosing  and down sample to at least 200 Hz. This results in a 16x1200 matrix.

I was also looking at ICA as a feature extractor and reduce the size.

My question is, how do I tell which method is better suited for my task? Will downsampling the signal lead to a significant loss in information?

I will appreciate any suggestions. Thank you.

Edit:
 - The data corresponds to two stages of seizure:

Preictal: Right before the seizure
Interictal: in between seizure

-The data was captured from 3 different patients and using 16 electrodes, sampled at 400Hz.


texts: How to Average Complex Responses (and Justification)?

texts:
I am developing software that calculates the response of a system by comparing the FFT of input and output signals.  The input and output signals are divided into windows and, for each window, the signals are median-subtracted and multiplied by a Hann function.  The instrument response for that window is then the ratio of the FFTs of the processed data.

I believe the above is standard procedure, although I may be describing it poorly.  My problem comes in how to combine the responses from the multiple windows.

As far as I can see, the correct approach is to average the complex values, across all windows.  The amplitude and phase response are then the amplitude and phase of the average, complex value at each frequency:

av_response = sum_windows(response) / n
av_amplitude = sqrt(real(av_response)**2 + imag(av_response)**2)
av_phase = atan2(imag(av_response), real(av_response))

with implicit loops over frequency bins.

But I have been asked to change this to calculate amplitude and phase in each window first, and then average the amplitudes and phases across all windows:

amplitude = sqrt(real(response)**2 + imag(response)**2)
av_amplitude = sum_windows(amplitude) / n
phase = atan2(imag(response), real(response))
av_phase = sum_windows(phase) / n

I have argued that this is incorrect because averaging angles is "just wrong" - the average of 0 and 360 degrees is 180, for example, but the people I am working with responded by saying "OK, we will only display amplitude".

So my questions are:

Am I correct in thinking that the second approach is generally incorrect
for amplitudes too?
If so, are there any exceptions that may be relevant, and which may explain
why the people I am working with prefer the second method?  For example,
it looks like the two approaches will agree as the noise becomes small, so perhaps this
is an accepted approximation for low noise?
If the second approach is incorrect, are there any convincing, authoritative references that I can use
to show this?
If the second approach is incorrect, are there any good, easy to understand examples that show this for amplitude
(as the average of 0 and 360 degrees does for phase)?
Alternatively, if I am incorrect, what would be a good book for me to educate
myself better?

I have tried to argue that the average of -1 1 1 -1 1 -1 -1 should be zero rather than 1, but that was unconvincing.  And while I think I could, with time, construct an argument based on max likelihood estimation given a particular noise model, it is not the kind of reasoning that the people I am working with will listen to.  So, if I am not wrong, I need either a powerful argument from authority or an "obvious" demonstration.

[I tried to add more tags, but can't find relevant ones and can't define new ones as a new user - sorry]


texts: if we create a continuous signal from epoched data (say, EEG data with 100 epoches), what kind of problems it may cause( i am only aware of edge artifacts ) and how i can avoid them in analysis (say, power analysis)? Thanks in advance,


texts:
I have just a few questions regarding the rise time of filters.

A rise time seems to be measured by using a step input, with an input typically from 0 to 1. However this is what I cannot seem to find out...

-Does the rise time stay the same if input is from say 0 to 0.5 or some other arbitrary input?

-If not, how can I predict the rise time?

-If so, what happens if I input 0 to 0.5, hold at 0.5, and then step to 1? Does another rise time occur?

Thanks for any information!


texts: Is it possible that adding noise to a signal can increase detection possibility?

texts: I am simulating a feature detector in noisy environment which consist of AWGN Noise and Impulsive Noise. But I am getting a strange result as Signal with Impulsive+AWGN noise has better detection probability then with Signal with only AWGN. I know its wrong at some point. How Is it possible that signal with more noise like Impulsive noise has better detection possibility. Please share your experience.


texts: How can a changing signal be Fourier transformed?

texts:
Fourier transformation is used to split a periodic signal into frequencies, and calculate the phase and shift for each frequency. But what if we would like to record an audio, which is changing, for example, because someone starts to play with a new instrument?

I know that if the recording is 44100 Hz, then we record 44100 samples in each second.  But how is it Fourier transformed? The only way I can think of is that one second is divided into 25 segments, and we do the transformation to get the phase and shift for each frequency in each segment.


texts: Filtering a signal using Autoregressive (AR) filter and finding the coeff of AR filter using Yule Walker equation in MATLAB

texts:
I have a random signal x of 1000 samples and I've to generate y1 by filtering x using an autoregressive (AR) filter of order n (let say 4). I've tried the following code to implement the autoregressive definition (As in Autoregressive model only the past values of the model output, and the present value of the model input are used)

x = rand(1,1000);
a=0.1
M=4;
for i = 1:length(x)
sum=0;
y1(i)=0;
for j = 1:M+1
    if (i-j>0)
     sum = sum + a*y1(i-j);
    end
end
y1(i)=sum +a*x(i);
end

The problem is that, I need to multiply the previous output y1 and current input x with a=0.1, otherwise it gives an unstable filter which leads to infinity. Please clarify which mistake I'm making while filtering x using AR filter or I'm doing it the wrong way?

Furthermore after doing this step, I need to find y2 by adding some amount of additive white gaussian noise (AWGN) in y1

y2 = awgn(y1,25);

and then using x and y2, I have to find the coefficients of my autoregressive filter using Yule Walker equation for order 4. I've tried this

r = autocorr(y2,4)';
R = toeplitz(r);

w = inv(R)*r;   % as Yule Walker eq: w=R^-1*r

But it's not giving correct coefficients (or filter taps).
Please somebody help me if there's something I'm missing in understanding the question fully or making some mistake somewhere in the code?


texts: How to change the measured curve to be close to the target curve

texts:
I am new to Signal processing and want to implement for the measured curve from my experiment.
I have a measured curve (like skewed gaussian).
I like to change that measured curve to be as close as possible to the target curve (gaussian) (statistically and visually). Visually means, the target curve's width is abit longer than the measured curve when we the two curves are overlapped. Which signal processing should I use?
I like to attach a picture, but it is not allowed for the new person.
Thanks
thomas


texts: Using Least Squares for curve fitting in Matlab

texts:
I have a problem right now to solve. I have a Gaussian peak, which I need to divide into three components (three Gaussian distribution). For those three component Gaussian distribution, I already know the mean and standard deviation, if I want to do this by using least squares, where should I start with in Matlab?

Thanks


texts: Why is the first value in digital first-order IIR filter impulse response not the largest?

texts:
When I create a digital first-order IIR low-pass filter with scipy (code below), I get the following coefficients:

B: [ 0.1367  0.1367]
A: [ 1.     -0.7265]

The impulse response of this filter does not look like most text-book examples in that the first value is not the largest.

Why is this so?  Does it have to be so?

If I want to make an FIR filter to mimic such a first-order IIR low-pass filter, should it be a normal exponential decay shape, or does it need the first value "tweaked" in this manner?

import numpy as np
from scipy.signal import butter, lfilter
import matplotlib.pyplot as plt

b, a  = butter(1, .1, btype='lowpass')
print('B:', b)
print('A:', a)

x = np.zeros(1000)
x[0] = 1.

xf = lfilter(b, a, x)

plt.figure()
plt.plot(x,'o', label='impulse')
plt.plot(xf,'s-', label='response')
plt.xlim(-1, 10)
plt.ylim(-.1, .3)
plt.legend()


texts: How to gather similar objects in an image?

texts:
I am working in a traffic tracking app, I am using a background subtraction approach to obtain information about the moving vehicles. After some morphological operations I obtain blobs of the moving objects. In some cases more than one blob belong to the same object, e.g.

How can I gather the isolated blobs to track only a single object? what features can allow me the fusion of these blobs in a single object? Thanks


texts: What is the theoretic difference in the ways to compute the spectrogram?

texts: I have noticed that the spectrogram for a audio signal is often calculated in different ways when the result from the DFT is transformed into real numbers; some tend to compute $|k|$ or $|k|^2$ while others use the formula $Re(k)^2 + Im(k)^2\ \ $ for each DFT bin $k$. What is the theoretic difference between these and what should be considered as the standard (if any)?


texts: Remove background noise from audio signal

texts: I am looking for a python or matlab code to take an input audio signal, process it and remove any background noise other than the infant cry such as vehicle noise or a human talking noise and get the output as a pure cry audio signal free from any background noise and save the new file.


texts: Find step response for LTI system represented by the following impulse response?

texts:
(i) $ h[n]=\left(\dfrac{1}{3}\right)^nu[n]+\left(-\dfrac{1}{3}\right)^nu[-n-1]$

here's how i tried to solve :

since we know, step response = running sum of impulse response
i.e, $$s[n]=\sum_{k=-\infty}^{n} h[k] $$
we can write

  $$ s[n]=\sum_{k=-\infty}^{n}\left(\dfrac{1}{3}\right)^k\left[u[k]+(-1)^ku[-k-1]\right]$$
  $$s[n]=\sum_{k=-\infty}^{-1}\left(-\dfrac{1}{3}\right)^k +\sum_{k=0}^{n}\left(\dfrac{1}{3}\right)^k$$
  $$s[n]=(-\infty .......+3^4-3^3+3^2-3)+\dfrac{3}{2}.\left(1-\dfrac{1}{3}^{n+1}\right)$$
  $$s[n]=\left(-3+3^2-3^3+3^4......-\infty\right)+\left[\dfrac{3}{2}-\dfrac{1}{2}\left(\dfrac{1}{3}\right)^n\right]$$and since sum within parethesis is diverging therefore,
  $$s[n]=\infty$$
  but, answer in the book is given as $$s[n]=\left(2^{n+1}-1\right)u[n]$$

above s[n] denotes step response

please tell me where i'm doing wrong(or if i'm doing conceptual mistake)
,and provide solution if possible ....thank you.


texts: How to statistically quantify the coverage of features in the data?

texts:
I have an image. I find features on it using different methods. I want to quantify that which method performs the best. The creteria is how many features per unit area of the image are and how they are spread. More the features are spread, the better it is. How to visualize them.

So at the end the criteria is "how many features per unit area are found and how well are they spread all over the image"

It will be great if there are some suggestions that how to visualize the quantified results.

Thanks a lot.


texts: Sound source locator using multiple microphones — How to?

texts: I need to create a sound source locator using three microphones. I plan to start off by connecting three microphones to my windows PC, and then taking input from them using matlab to monitor their individual microphone outputs in real-time. How do I go about this? Can I just take a usb hub and connect three usb-microphones to the hub. Will this work? Does the sound card put in any constraints here? If not usb microphones, how else can I go about this? Can I use regular microphones with a mixer or something of the like?


texts: Is there an analogue of coherence between data sets related by a non-linear transformation?

texts:
Calculating the coherence (sometimes called magnitude squared coherence) between two signals indicates the presence or lack thereof of a linear transformation between the two signals.  Is there an analogue for signals which are related by a non-linear transformation?  Let's assume that the expected non-linear transformation is known.  It would be even better if the calculation could identify the non-linear transformation within some bounds, but that is probably just wishful thinking.

An example of coherence between ocean water level (due to tides) and ground water level measured in a well, taken from the Wikipedia article linked above.  This is an example of the coherence between two signals related by a linear transformation.


texts:
Branching off from the question [Mapping the value of a sample in a 2-D DFT to cycles/pixel], I have a few more questions related to 2D FFT of images.

I correct in assuming that the fundamental frequency is the image itself?
And one copy of the image is equivalent to 1 wave cycle?
The sampling frequency is the number of pixels in the image?
And If this is correct, how do I compare two distinct images?
Can I compare the sampling frequencies ( $\frac{1}{N_1}$ & $\frac{1}{N_2}$ ) and frequency peaks of one image with a second image ($\frac{1}{N_2}$)? ($\frac{1}{N_1}$ & $\frac{1}{N_2}$ are the dimensions of an image)

What I am trying to understand is - what the X & Y axis of a complex 2D FFT plot is? and how to compare information from 2 plots?


texts:
I collected vibration data (amplitude and time) on a component that was attached to an engine. Using MATLAB I plotted a spectrogram to see what frequencies it vibrated at.

The code:

windsize = 1000;
beta = 25;
overlap = 900;
thresh = -140;
spectrogram(a,                      ...
            kaiser(windsize, beta), ...
            overlap,                ...
            windsize,               ...
            'MinTreshold', thresh,  ...
            'yaxis', fs             ...
);

I am not sure how to interpret the results of the plot. Order analysis of the engine expected a maximum output of 100 Hz, where as here the strongest signals are at the higher frequencies and at high harmonics.

Have I done something incorrectly?


texts: How to express one image in terms of another one

texts:
I have two (black and white) images of identical size - let's say 128x128 pixels. I'm interested in expressing Im2 in terms of components of Im1 such that as opposed to specifying Im2, I can specify some values (less than number of pixels in Im2, otherwise what's the point) which, together with the knowledge of Im1 would allow me to construct an approximation of Im2. Let me demonstrate by giving you my first idea (which, spoiler alert, didn't work). In pythonish pseudocode:

# Singular Value Decomposition of Im1 and Im2
U1, S1, V1 = svd(Im1)
# Function to minimise
def fit_function(S):
    Im_fit = U1*diag(S)*V1
    diff = Im2-Im_fit
    return sqrt(mean(diff^2)) # root-mean-square difference
# Find S which fits Im_fit to Im2
Sfit = myLittleMagicSolver(fit_fun)

In other words; use singular value decomposition on Im1 and Im2. Then find numbers other than singular values of Im1 which together with U1 and V1 matrices approximate Im2. This way I could specify only 128 values - the main diagonal of the fitted S matrix.

This, however, does not work. My fitted images are nowhere close to their target of Im2. My question is then, is that a problem someone has tackled already? I am not fussed about the SVD/PCA approach. I just want to be able to express Im2 in terms of Im1.

My intended use is to train a neural network to recognize patterns in my particular dataset where one image is an input to the network, and multiple images are the output. This, of course, makes for a pretty hefty neural net. I, therefore, want to teach the network to recognize the components of the output images in terms of the input instead.


texts: why transmitting a long pulse its spectrum gets spread?

texts:
I'm transmitting an RF signal with a CC1101 at 440 MHz.

This signal is a constant of 1, so the spectrum should be a delta.

Using a SDR dongle, I've checked the spectrum and it's wider than a delta but also, after a while, this peak kind of turns in many peaks that move (it looks like sea waves travelling).

Any idea why this happens?


texts:
I am an experimental research engineer working on a Laser experiment. The details do not matter but due to practical limitations my data is influenced by the following transformation during data acquisition, and I was wondering if there is a mathematical method or an algorithm to "undo" its effect on the captured signal, that is to get the inverse.

I want to get the y in terms of s.
Thanks in advance


texts: Lower frequencies is not visible in FFT plot when adding into the original signal

texts:
I plotted a simple Cosine wave and After taking its FFT the frequency can be seen easily but after modifying the original signal to add more lower and higher frequencies, the higher ones are visible but the lower ones is not showing in the FFT plot,

Original Signal,

Amplitude = 4
x=A*cos(2*pi*f*n);

Frequency of Wave: 100Hz

Amplitude = 4

Sampling Frequency = 10000Hz

The 100Hz frequency (original signal frequency) is supposed to be plotted at point 1 of FFT, which is fine,

When adding another higher frequency into the original signal,

x= 1*cos(2*pi*500*n) + x ;

500HZ frequency is added into the original signal and supposed to be plotted at point 5 of the FFt.

Results in,

Which is fine, but when i am trying to add lower frequencies than higher they are not visible.

Adding 50Hz frequency to the original 100Hz Cosine wave,

what i think is 50Hz should be plotted at the 0.5 of the x-axis as it is half of the original frequency.

x= 1*cos(2*pi*50*n) + x ;

Results in,

Where is the 50Hz frequency ?


texts: Quadrature demodulation, homodyne detection, lock-in detection - what's the difference?

texts:
Quadrature demodulation

Homodyne detection

Lock-in detection

What is the difference between these terms? Are they all synonomous? In my mind they kind of are, so I'm never sure which to use.

I became familiar with this concept first through the use of lab devices called lock in amplifiers. However, homodyne detection seems to be the same thing. Quadradture amplitude demodulation seems to be the best term, since it describes what you're actually doing (I have no idea what the word 'homodyne' even means).


texts:
This questions is in conjugation with this one here!

Canny edge detector gives ids of pixels in an image. Not the locations of the edges. To be specific, after all it should be an edge between two pixels. Any implementation that actually gives arcs not pixels?

One solution i can make is that if i have a pixel, i can simply take the bottom edge and right edge for consistency but it might disconnect my feature.
Edit: Edge is referred to an arc between 2 pixels.
Something smarter?
Thanks.


texts: Filtering difference of correlated measurements

texts:
I have an application with two separated GPS receivers giving live positions and I'm deriving a heading/displacement from the vector between them.  Each set of position measurements is noisy and has dropouts but I do have a quality estimate. So far it's classic Kalman filter.

The relation between the two antennas isn't fixed, both are moving independently and generally one is moving at higher rate than the other.

But obviously some of the error is correlated between the two receivers, so do I filter each antennae location separately or the filter the displacement?
Or is there a cleverer alternative?

edit: As an example suppose you have a GPS on a boat and on a towed sonar array - and you are trying to track the relative position of the sonar receiver.

The general uncertainties on each antennae position are similar. But some errors will correlate between them - eg. if an atmospheric effect moves both readings 10m North this has zero effect on the difference but would effect any filter/average of each position.

Arguing against simply averaging/filtering on the displacement vector is that the motion of each receiver is different, the boat is relatively steady - the sonar bounces around in the waves. So the statistics of each if you have any sort of averaging filter are different.


texts: If we have two processes and both of them are ergodic. Does this mean that the joint proces is ergodic? Or other way around? If we have the dynamics for both components of the joint process what are the possible ways to show ergodicityof the joint process?


texts:
Hi I am attempting to develop a reasonable IQ balance mechanism for a quadrature signal coming from a software defined radio.I can balance out the amplitude and phase differences at one frequency quite well, about - 80dBm.  However, over the typical span of my spectrum scope (192khz), there are differences at different frequencies.  Now I have determined that the differences are quite linear.  I could get away with doing a linear regression on a few points taken over the frequency range. But..
I am correcting the I and Q signals before the fast fourier transform.  In other words, in the time domain.  How do I bring this to the frequency domain?  I have the real and imaginary amplitude and frequencies of course before I plot them.  Can I use the same equations on the frequency values?
Thanks


texts: Best strategy for sending digital signal over ultrasound

texts:
I'm interested in sending digital data over ultrasound.

My initial thought is that it should be first converted to BMC:

And then phase shift encoded (PSK):

I initially thought to use a Goertzel filter to decode it, but this runs into trouble: Extracting phase using Goertzel filter in Python

What would be a practical mechanism?

Is there a more intelligent way to encode the data, maybe using two frequencies and taking the relative strength at any moment in time?


texts: Why low-pass FIR Equiripple filter is designed with 3 dB of ripple in the pass-band and at least 60 dB of attenuation in the stop-band?

texts:
Please tell me, why low-pass FIR Equiripple filters are designed with 3 dB of ripple in the pass-band and at least 60 dB of attenuation in the stop-band
and not other values ?
I want to know are these values simply a convention?


texts:
In the literature, the instantaneous frequency for a signal $s(t)=e^{-j \phi(t)}$ is given by: $$f(t)=\tfrac{1}{2\pi}\frac{d\phi(t)}{dt}$$

This my problem: I have a signal $$u(t)=e^{-j \alpha_1 \phi(t)}+e^{-j \alpha_2 \phi(t)}+e^{-j \alpha_3 \phi(t)}$$ with $\alpha_1,\alpha_2,\alpha_3 \in \mathbb{Z} > 0$. How to find the instantaneous frequency for the signal $u(t)$?


texts:
This is a classical image segmentation problem: I need to make a visual measurement of particles.
I've been using watershed, kmeans and mean shift but it doesn't work well on this image. Could you please recommend me some other methods/open source code?

P/S: Any manual/semi automatic segmentation is also ok with me. I just need the correct segmentation in a reasonable not time consuming way.


texts: What equation predicts the amplitudes of harmonics from a square/triangle/sawtooth/pulse oscillator?

texts:
I have seen pictures like this which depict the shapes of amplitudes from the various common types of audio oscillators:

Similar pictures of spectra are shown here.
I am attempting recreating these with additive synthesis using sine waves, and I thus need to know what levels to set the component sine waves to.
I'm wondering if there are simple equations that can predict the level of a given partial/harmonic relative to a level of 1 for the fundamental for each type of wave.
I think that in theory these should all follow some sort of $y=\frac{1}{x^c}$ distribution, where $x$ is partial number. If so, what would $c$ be for each of these?
Assume that it is easy enough to just set the even harmonics to null when needed. I think the pulse will be hard to predict too. But I figure the active saw/triangle/square partials should have pretty simple governing relationships.
Any help is appreciated. Thanks.

Update:
In response to Matt's suggestion to look at the Fourier series, I did so, and I think I have the solutions for all but the pulse.
1) Triangle
Fourier series: https://mathworld.wolfram.com/FourierSeriesTriangleWave.html
Amplitude: $y=\frac{1}{n^2}$ for odd partials, even partials are zero
2) Square
Fourier series: https://mathworld.wolfram.com/FourierSeriesSquareWave.html
Amplitude: $y=\frac{1}{n}$ for odd partials, even partials are zero
3) Sawtooth
Fourier series: https://mathworld.wolfram.com/FourierSeriesSawtoothWave.html
Amplitude: $y=\frac{1}{n}$ for all partials
4) Pulse
Fourier series: https://lpsa.swarthmore.edu/Fourier/Series/ExFS.html#EvenPulse
This becomes complex once it's no longer a 50% duty cycle square and I'm not sure what that amplitude expression would be though I'd love to know.
Did I get that right and if so, any thoughts on the pulse?


texts:
Although using regularly the FFT algorithm to compute DFTs, I don't really understand how the phase part works.

e.g. in Matlab:

Fs=1e3;
t=linspace(0,1,Fs);
f=1;
x=sin(2*pi*f*t);
X=fft(x);
Xphase=angle(X);
Xmag=abs(X);

I know that "phase" can mean a shift (an angular) shift of a wave with respect to another. But I can't really say what the values in each point of Xphase mean. Can someone explain ? e.g. I was trying with this simple example of a pure sine wave (which shouldn't be dephased I guess?)

Xphase contains values between -3.1385 to 3.1416 so roughly from -180 degrees to 180 degrees... why?


texts: Compute output given input, transfer function and initial conditions

texts:
The problem statement is

Consider a causal LTI system whose transfer function $H(s)$ is given as $$H(s)=\frac{s+2}{(s+3)(s+4)}$$ Compute the output $y(t)$ for an input $x(t)=e^{-2t}u(t)$ when $y(0)=1$ and $y’(0)=0$.

The solution is given as $y(t)=5e^{-3t} − 4e^{-4t}$.
Here is my attempt:

Laplace transform left side and right side and consider the initial condition

right side is 0 , and left side is below

so i think answer is below but the prof's answer is not match with my answer.


texts: Wiener filter to estimate constant signal

texts:
I want to compare the performance of a Wiener Filter and the Kalman filer to estimate the value of a constant $d$ using mesurements corrupted by a white noise. That is, my measurements are of the form
$$x(n) = d + v(n)$$
where $v(n)$ have a normal distribution with mean $0$ and known variance $\sigma^2$.

Using the Kalman filter, I could put it on State Space form
$$d(n+1) = d(n)$$
$$x(n) = d(n) + v(n)$$
and solve the problem. But I am having difficults to set the problem so I can solve with the Wiener filter. My desided signal is the constant signal $x$. My filter input is the measurements $x$. But I have doubts if I am doing something wrong, because my estimated signal is not a really good estimative of the desired response. I used the following matlab code:

function test()
    n = 0:511;
    d = 10 * ones(1,512);
    v = 0.5*randn(1,512);
    x = d + v;
    w = WienerFIRFilter(x, d, 12);
    y = filter(w', 1, x);

    plot(x)
    hold on
    plot(y, 'r')
end

The function WienerFIRFilter is defined as following

function w=WienerFIRFilter(u,d,M)
    aux = xcorr(d,u,'biased');
    p = aux(1,(length(aux)+1)/2:((length(aux)+1)/2)+M-1);
    [U, R] = corrmtx(u,M-1);
    w=inv(R)*p';
end

Am I doing something wrong?


texts: Estimating pole radius of formant filter from bandwidth

texts:
I wish to design an all-pole formant filter by specifying frequency θ (between 0 and π radians for Nyquist) and bandwidth Φ such that the response of the filter at θ-Φ and at θ+Φ should be roughly 50% of the response at θ.

I start by specifying a pole at $p=[r,θ]=re^{jθ}$.

My question is this: How to estimate $r$ as a function of $Φ$?

Note: A fairly crude estimate will suffice for my purposes (vowel synthesis).

This is my approach so far:

Adding a conjugate pole, I construct a transfer function $H(z) = \frac{1}{p-z}\frac{1}{p^*-z}$

$$\frac{1}{H(z)} = (p-z)(p^*-z)$$

$$= pp^* -z(p+p^*) + z^2$$

$$ = r^2 -z(2r cos θ) + z^2 $$

The gain at frequency α will be $\text{Gain}(α) = |H(e^{jα})|$, so the gain at θ is as follows:

$$ \frac{1}{H(e^{jθ})} = r^2 -e^{jθ}(2 rcos θ) + (e^{jθ})^2 $$

$$ = r^2 -re^{jθ}(e^{jθ} + e^{-jθ}) + e^{j\cdot2θ} $$

$$ = r^2 -r(e^{j\cdot2θ} - 1) + e^{j\cdot2θ} $$

$$ = r(r-1) - e^{j2θ}(r-1) $$

$$ = (r-1)(r - e^{j2θ}) $$

So $\text{Gain}(θ) = |H(e^{jθ})| = \frac{1}{(r-1)(r - e^{j2θ})} $ as $0<r<1$. So far so good, nice and tidy!

But now it gets tricky. I require Φ such that:

$$ \text{Gain}(θ) = 2 \text{Gain}(Φ)$$

$$ \frac{1}{|(r-1)(r - e^{j2θ})|} = \frac{2}{|r^2 -z(2r cos θ) + z^2|} \text{where} z=e^{jΦ} $$

$$ 2|(r-1)(r - e^{j2θ})| = |r^2 -e^{jΦ}(2r cos θ) + e^{j2Φ}| $$

Now I should be able to split out real and imaginary components inside each modulus: $2|A+jB| = |C+jD| => 4(A^2+B^2) = C^2+D^2$

But this is starting to look very heavy. How would an engineer approach this?

Is there any way I can do it using iPython/numpy/scipy?


texts: Orthogonal Basis for a 2D Signals (Compressive Sensing)

texts:
I have a 2-D signal that is (1536x128) and that is sparse in the Fourier domain (after applying fft2).

I want to apply compressive sensing to recover the signal using fewer random elements, but I am not sure how to find the orthogonal basis, the DFT for 2-D signals. I have the code of how to apply compressive sensing for 1-D signals with length N, but I am not sure how to modify that for 2-D signals of length (NxM).

N = 256;                % length of signal
P = 2;                  % number of sinusoids
K = 64;                 % number of measurements to take (N < L)

% Generate signal with P randomly spread sinosoids
% Note that a real-valued sinusoid has two peaks in the frequency domain
freq = randperm(N/2)-1;
freq = freq(1:P).';
n = 0:N-1;
x = sum(sin(2*pi*freq/N*n).', 2);

% Orthonormal basis matrix
Psi = dftmtx(N);
Psi_inv = conj(Psi)/N;
X = Psi*x;              % FFT of x(t)

% Plot signals
amp = 1.2*max(abs(x));
figure; subplot(5,1,1); plot(x); xlim([1 N]); ylim([-amp amp]);
title('$\mathbf{x(t)}$', 'Interpreter', 'latex')
subplot(5,1,2); plot(abs(X)); xlim([1 N]);
title('$|\mathbf{X(f)}|$', 'Interpreter', 'latex');

% Obtain K measurements
x_m = zeros(N,1);
q = randperm(N);
q = q(1:K);
x_m(q) = x(q);
subplot(5,1,3); plot(real(x_m)); xlim([1 N]);
title('Measured samples of $\mathbf{x(t)}$', 'Interpreter', 'latex');

A = Psi_inv(q, :);      % sensing matrix
y = A*X;                % measured values

% Perform Compressed Sensing recovery
x0 = A.'*y;
X_hat = l1eq_pd(x0, A, [], y, 1e-5);

subplot(5,1,4); plot(abs(X_hat)); xlim([1 N]);
title('$|\mathbf{\hat{X}(f)}|$', 'Interpreter', 'latex');

x_hat = real(Psi_inv*X_hat);    % IFFT of X_hat(f)

subplot(5,1,5); plot(x_hat); xlim([1 N]);  ylim([-amp amp]);
title('$\mathbf{\hat{x}(t)}$', 'Interpreter', 'latex');

Thank you!


texts: Understanding the meaning of amplitude in FFT

texts:
I am recording data with a magnetometer of the background magnetic field in a building. I have applied the FFT algorithm to the data in order to look for the frequencies that appear in it. I would like to use this in order to identify (or at least make an educated guess) of the sources of the disturbances that I observe.

My question is: What is the meaning that I can attribute to the amplitude that I obtain from the FFT algorithm? Is there some unit that can be ascribed to it?

Looking at the formula for the continuous fourier transform (which I took from Wolfram Mathworld) :
\begin{align}
f(\nu)=\int\limits_{-\infty}^{+\infty}f(t)e^{-2\pi i \nu t} \mathrm{d}t
\end{align}
I do not really know how to accomodate the dimension of Tesla in there.

Thank you


texts: Confused with filtering linear chirp signal using band-pass filter

texts:
everyone. Recently, I am doing simulations about filtering a linearly chirp signal, and have been confused about the result. The signal was linearly chirped from 0 to 1000 Hz.
At first, the chirping rate is set to be 50 Hz/s. When the signal was filtered in time domain by a band-pass filter (Butterworth 500-600 Hz), the result was

--The first line of plot shows the signal

--the second line is the fft of the signal

--the third line is just the zoom in of the second line of plot.

We can see that the filtered signal corresponds to the pass band of the filter. 10 s corresponds to 500 Hz, and 12 corresponds to 600 Hz.

However, the the chirping rate is set to be 9850 Hz/s. the signal and the filtered signal was

since 500 ~ 600 Hz correspond to the time scale in 0.051 ~ 0.061 s (500/9850 ~ 600/9850). We can see the filter signal has been delayed and extended. Addition to that, we can see that the envelope of the filtered signal is oscillatory.

Is this normal or caused by improper parameter setup? Will I get the same result if the filter is an analog filter?

Any advice is greatly appreciated and thank you for your help.


texts: Proof of DTFT equal to DFT when signal is periodic?

texts:
I was using the Wikipedia page on the discrete time Fourier transform to understand the connection between DFT and DTFT. The following is claimed in the article - I was wondering if anyone had a proof or a source for the proof for the highlighted part?

Many thanks!


texts: Effect of number of data segments in Periodogram-based PSD

texts: In Welch or Bartlett method, original signal is divided into L segments, of D overlapping (D=0 in Bartlett method). Then FFT is done for each segment, and the result is the average of all segments' FFTs. Averaging reduces the variance. But apart from this effect, is there anything else to take into account when choosing the number of segments for a given signal?


texts: Cannot figure out the convolution operation in this problem

texts:
A linear system S has the relationship $y[n]=\sum_k {x[k]*g[n-2k]}$, k ranging from $-\infty$ to $\infty$, between its input $x[n]$ and output $y[n]$, $g[n]=u[n]-u[n-4]$.

Determine $y[n]$ when $x[n]=\delta[n-1]$.

I know that the convolution operation can only be applied when both the operands have the same value of $n$ and that :

$$
y[n]=x[n]*h[n]=\sum_k {x[k]h[n-k]}
$$

I don't understand how $x[k]$ and $g[n-2k]$ can be convolved with each other, when they do not have the same inputs. How do I perform discrete convolution on $x[k]$ and $g[n-2k]$?


texts: Question of Digital filter; stability and order

texts:
Below 1~6 are my question.

Shortcomings of IIR filter.
Mean of unstable. (Things that will happen when system is unstable.)
How to select the best order(n).
What happens when I raise order too much.
How can I know the maximum order or appropriate order.
How to determine stability of system in MATLAB.

I learn IIR filter's shortcoming is unstable. But I don't know mean of unstable. I want to know things that will happen when system is unstable and stable.
Additionally, I wonder the order of filter. I thought when I raise order, FIR and IIR filter will have more sharp transition zone(skirt?). It is true, then how much I raise the order? When I raise order too much, what happen will become? I used butterworth filter.


texts: Discretize process noise in Kalman filter

texts:
Reading P. Andrews et al. I see that it is very common to do the following approximation of the process noise covariance matrix:

$$Q_{k} = G_{k-1}QG_{k-1}^{T}\Delta t$$

so that the propagation becomes:

$$P_{k} = F_{k-1}P_{k-1}F_{k-1}^{T} + Q_{k}$$

however, when I try it in a simulation I need to scale it once more:

$$P_{k} = F_{k-1}P_{k-1}F_{k-1}^{T} + Q_{k}\Delta t$$

else the discretization is wrong - I am not sure why this happens.

The simulated process noise is by adding the following to the ground truth:

velocity_measured = velocity_true + sigma * np.random.randn(1)
position = position + velocity_measured * dt

so that the process noise before discretization becomes:

Q = sigma * sigma.


texts: Why the ideal ambiguity function (AF) for radar has the maximum in (0, 0) and zero otherwise?

texts: I was wondering why is the ideal AF has zero value in all the function except in (0, 0).


texts: Transfer function determination from input and output data

texts:
I have some input and output data that I believe adequately includes excitation of the important dynamics of a system. I know it is at most a 4th-order transfer function.

How can I identify the transfer function? I have Python available. (I have MATLAB but do not have access to the System ID Toolbox and need to limit my dependencies on MATLAB)

I know how to do least-squares fits, but I have no idea how to apply the idea to transfer functions, where using the absolute error in the transfer function doesn't make sense (relative error seems to be the appropriate thing to fit).

I'm vaguely familiar with ARX/ARMA/ARMAX approaches but they always seem to overemphasize the high-frequency response, because they solve for the impulse response.


texts: Compute absolute power spectrum in MATLAB

texts: I have EEG signals. Is there a way to compute the absolute power spectrum in MATLAB within a frequency band? I know I have to use the fft function but I can't find any details about the absolute power spectrum.


texts: How to form the common message for the 6G Rate Splitting scheme?

texts:
Recently, there have been some interest regarding the rate splitting scheme for 6G due to its higher rate capability
Short Tutorial on Rate-Splitting (Multiple Access) for 6G
This video states that rate splitting is based on multiplex user data into private and common part. For example if there are 2 user then the transmit signal is compose of 2 private signal stream and 1 common stream.
My question is that how to form this common stream for example when user'1 data is 1010 and user 2's data is 1101 ?


texts: OpenCV face recognition: Finding a best match

texts:
I am working on OpenCV2.4.2 C++ interface for face recognition functionality. The face recognition feature seems to be working fine on standard databases. (AT&T, Face Recognition Data, University of Essex, UK)

I am more interested in negative testing.

Here is what I did -

Identify clear front face images from the Internet. (single image/person,
different  image sizes)
Detect and extract faces using LBP cascade, convert to grayscale and normalize
the   histogram. Then, train the database with these images using LBP face recognizer.
Find a face which is not part of the database from the internet. Preprocess this
face image and give it as an input to face recognizer.

What I expect - The application should return the ID of similar looking face.

Results - But I am receiving absolutely ridiculous results. When given white male face as an input, I get the ID of black woman. I have tested this with multiple images but everytime the match bizarre. Gender, skin tone nothing matches.

All I want to do is when given an random image as an input (which is not part of the database), the application should at least return the ID of an image which has similar skin tone and gender. I am clueless where and how to get started on this.

Any help will be greatly appreciated.


texts: What is the difference between pitch detection and Onset detection?

texts:
According to wikipedia Onset detection:

  Onset refers to the beginning of a musical note or other sound, in
  which the amplitude rises from zero to an initial peak. It is related
  to (but different from) the concept of a transient: all musical notes
  have an onset, but do not necessarily include an initial transient.

And the Pitch detection

  A pitch detection algorithm (PDA) is an algorithm designed to estimate
  the pitch or fundamental frequency of a quasiperiodic or virtually
  periodic signal, usually a digital recording of speech or a musical
  note or tone. This can be done in the time domain or the frequency
  domain or both the two domains.

The two definitions are clear to me. Onset tries to find the start of a musical note, pitch detection tries to detect the fundamental frequency.

The confusion arise, because I think of the two concepts as highly related. For example if I want to track a musical note doesn't it mean that I already detected the pitch? or that frequency could be a harmonic and not the fundamental frequency ?

Can someone explain if the two are significantly different, or it's just a matter of different context of the same concept; tracking specific frequency vs tracking when that frequency starts.


texts: Perona Malik Noise Estimator using Canny

texts:
In Perona and Malik, they state:

  a histogram of the absolute values of the gradient throughout the
  image was computed, and K was set equal to the 90% value of its
  integral

My interpretation of this is to take the 90%ile of the distribution of magnitude of gradients. This interpretation however differs from the implementation here which seems to do a double cumulative sum.


texts:
From this paper (slide 11), the insertion loss (or attenuation) is defined as

$$
L(\omega^2)=\frac{\lvert V_i(j\omega)\rvert^2}{\lvert V_o(j\omega)\rvert^2}=\frac{1}{\lvert H(j\omega)\rvert^2}=10 \log\left(\frac{1}{H(j\omega)H(-j\omega)}\right)
$$

I'm interested specifically in, where does the last inequality follow?


texts: How do you send signals through geological formations

texts:
Does anyone have suggestions for performing the above?  Presently, in my job we send signals through geological formations; however, if the rock is too dense, then we are unable to receive any signals.

The signals must be sent from a battery-powered transmitter.  Here is an article I've found sending neutrinos, but I am more interested in sending electromagnetic radiation:

http://www.gizmag.com/neutrino-messaging/21842/


texts: How do FIR filters roll offs with no poles

texts: FIR filters only have zeros, how does it work like a filter with rolloffs if there are no poles?


texts:
Let's assume a SISO channel in the equivalent baseband, the standard channel model (discrete) is:
\begin{align}
y(k) = h(k)x(k) + z(k) \tag1
\end{align}
Where $y(k)$ is the detected signal, $h(k)$ denotes the channel, $x(k)$ is the sent signal and $z(k)$ is additive noise. If we consider reflections on buildings, cars, etc., why isn't there a convolutional model like in acoustics:
\begin{align}
y(k) = h(k)*x(k) + z(k)\text?\tag2
\end{align}


texts: Basis signals for the discrete-time Fourier Series

texts:
I am using Alan Oppenheim's Signals and Systems and I am a bit confused by the notion of discrete-time periodic exponentials as basis signals for the discrete-time Fourier Series (and later the DTFT). For the discrete-time Fourier Series we use the basis signals $$\phi_k [n] = e^{jk\frac{2\pi}{N}n} = e^{jk\Omega_0n} ,$$ where $\Omega_0 = \frac{2\pi}{N}$, to build general discrete-time periodic signals. Unlike the continuous-time case where we use complex exponentials as basis functions for the Fourier  Series representation, in this case the fundamental frequency of the $k$th basis signal is not $k\Omega_0$. This is because it can be shown that for a discrete-time periodic complex exponential signal $e^{jk\frac{2\pi}{N}n}$, the fundamental period $N_0$ is not $N$, but rather $$N_0 = \frac{N}{\gcd(k,N)},$$ where $\gcd(k,N)$ is the greatest common divisor of the integers $k$ and $N$. From that we conclude that the fundamental frequency of the $k$th basis signal $\phi_k[n]$ is not $k\frac{2\pi}{N}$, but rather $\gcd(k,N) \frac{2\pi}{N}$. So it is still an integral multiple of the frequency $\Omega_0$, except $\Omega_0$ is multiplied by the greatest common divisor of $k$ and $N$, rather than $k$. Of course in the case where $k$ divides $N$ the frequency would be $k \Omega_0$, but we cannot know a priori whether that's the case. Am I correct in my understanding?

Assuming that what I said above is true, when we look at the discrete-time Fourier Series representation of the sequence $x[n]$, we have $$x[n] = \sum_{k = <N>} a_k \phi_k[n],$$

which is a linear combination of the basis signals I defined above (and what the author means by the notation above is that the sum is over any $N$ values of $k$). Now given the fact the fundamental frequency of the $k$th component in this sum is $\gcd(k,N) \Omega_0$, it might turn out that $k$ and $N$ have no common factors at all, in which case the fundamental frequency of the $k$th basis signal is simply $\Omega_0$, which is the same as the fundamental frequency of the first basis signal. Therefore, those two basis signals seemingly have the same fundamental frequency and period (within the range of values of $k$ defined earlier). Does that make those signals identical, or are they different? Are the signals guaranteed to be different? And if they are not, doesn't that make the set of basis signals $\{\phi_k\}$ linearly dependent? And does the Fourier Series representation break down in this case?

Thank you in advance


texts: Reconstruction of Contiuous - Time Signals

texts:
In terms of analog signals, we can represent digital signal as :

$$
x[n] \triangleq x_{a}(nT) = \int_{-\infty}^{\infty}X_{a}(f) \, e^{j2\pi f nT} \ \mathrm{d}f
$$

While if we focused on the integral on the right side and according to the Digital Signal Processing by John Proakis, chapter 6.1, we can rewrite it into :

$$
\int_{-\infty}^{\infty}X_{a}(f) \, e^{j2\pi f nT} \ \mathrm{d}f = \sum_{k=-\infty}^{\infty} \int_{(k-1/2)F_{s}}^{(k+1/2)F_{s}}X_{a}(f) \, e^{j2\pi nf/F_{s}}  \ \mathrm{d}f
$$

where $ F_{s} \triangleq \frac1T $.
My question is how the second equation comes up ? what does the interval of $(k-1/2)F_{s}$ to $(k+1/2)F_{s}$ means ?

Furthermore, it is stated in the book that "observing the  $X_{a}(f)$ in the interval of  $(k-1/2)F_{s}$ to $(k+1/2)F_{s}$ is identical to $X_{a}(f-kF_{s})$ in the interval of $-F_{s}/2$ to $F_{s}/2$". Is there any explanation or derivation how both things are identical ?

Thank you so much, hope that my question is clear enough


texts:
I wanted to know the difference between split radix and mixed radix algorithm.

I also wanted to know what is the difference between radix 2 ,radix 4 and radix 8 FFT


texts:
i've got two questions about the matlab periodogram function:

How can I recover the amplitudes from the periodogram?

fs=100;
fn=fs/2;
L=2^12;
df=fs/L;

t=0:1/fs:(L-1)/fs;
x=1*sin(2*pi*(df*floor(10/df))*t)+2*sin(2*pi*(df*floor(20/df))*t)+3*sin(2*pi*(df*floor(30/df))*t);

periodogram(x,[],L,fs);


texts: Real-time implementation of cascaded all-pass filters from given transfer function

texts:
I am working on real-time implementation of spring reverb based on scientific paper called Parametric Spring Reverberation Effect by Välimäki, Vesa; Parker, Julian; Abel, Jonathan S.

One block of this effect is a cascade of $100$ stretched all-pass filters. Single stretched all-pass filter is defined by:
$$
A_{\rm low}(z) = \displaystyle\frac{a_1 + A_{\rm fd}(z)z^{-K_1}}{1 + a_1A_{\rm fd}(z)z^{-K_1}}=\displaystyle \frac{a_1 + \displaystyle\frac{a_2+z^{-1}}{1+a_2z^{-1}}z^{-K_1}}{1 + a_1\displaystyle\frac{a_2+z^{-1}}{1+a_2z^{-1}}z^{-K_1}}
$$
I calculated the difference equation of this filter:

$$
y(n)=a_1x(n)+a_1a_2x(n-1)+a_2x(n-K_1)+x(n-1-K_1)-a_2y(n-1)-a_1a_2y(n-K_1)-a_1y(n-1-K_1)
$$

and used it for implementing the cascade of $M = 100$ stretched all-pass filters in MATLAB.

for i = 1:M
    for n = 1+K1+1:(length(x))
        y(n) = a1 * x(n) + a1*a2 * x(n-1) + a2 * x(n-K1) + ...
            x(n-1-K1) - a2 * y(n-1) - a1*a2 * y(n-K1) - a1 * y(n-1-K1);
    end
    x = y;
end

However, the problem seems to be that I need to add another filters to the structure which are not cascaded (as you can see in the following block diagram), therefore they cannot be "repeated" like the all-pass filter.

How can I calculate the output of my all-pass filter cascade sample-by-sample?

I can imagine the multiplication of two or three transfer functions in order to obtain the transfer function of the whole cascade, but multiplying $100$ transfer functions seems to be a crazy and wrong idea. There is probably a simple solution, but I just couldn't figure anything out. That's why I am asking you for help.


texts: Symbol Timing recovery for modulation producing ISI

texts:
I am interested in understanding why the common timing recovery algorithms function for modulation schemes which produce ISI.

For example, suppose you are receiving at the output of a matched filter a raised cosine pulse and you are interested in timing recovery. For simplicity lets assume BPSK(though I would be interested in QAM). Besides the ideal sampling times there will be ISI.

Most of the common symbol timing recovery algorithms seem to use symmetry in the received signal, either balancing the measured value at the left and right sides of the ideal sampling instant or use zero crossings.

In the case of a sequence of raised cosine pulses, these features no longer exist as the signals overlap.

How do timing recovery algorithms work in this case?


texts: Why are the following two packet reception probabilities different?

texts:
https://www3.nd.edu/~mhaenggi/pubs/broadnets04.pdf

In 3 page of this paper, the packet reception probability without interference is $e^{-\theta N Ad^2/ P}$. $\theta$ is sinr threshold. $N$ is a white noise. $P$ is power. $d$ is tx-rx distance and $A$ is path loss constant.

The rayleigh fading is considered.

And I tried the following matlab simulation.

https://kr.mathworks.com/help/wlan/examples/802-11p-packet-error-rate-simulation-for-a-vehicular-channel.html

And by using the packet error rate table, I set packet reception probability (1 - packet error rate) according to tx-rx distance.

The friis path loss model is used, and the white noise is used in the snr calculation.

But packet reception probability in this simulation table, and above packet reception probability are different.

In the following graph, the probability of matlab simulation is much more than that of the paper analysis.

I don't know why.


texts: Is there an equation that will graph the shape or predict the maximum amplitude of a single sample impulse fed through a One-Pole LPF?

texts:
If you feed a single sample impulse of a given amplitude through a One-Pole LPF you get an envelope that looks like this:

The output of the LPF from its peak will settle into an exponential decay where time to reach $1/e$ amplitude is given by $1/(2πf)$ where $f$ is the cutoff frequency of the LPF.
I am wondering if there's any way to predict the maximum amplitude of the envelope from the sample rate, LPF cutoff freq, and amplitude of the single sample impulse. In general, is there a non-recursive equation that can describe or approximate the curve that results from these three factors?
If such an equation can be developed or exists, then one can take the derivative and solve where it equals zero to find the max.
Is this possible?
Alternatively, I can solve it numerically by just iterating through a temporary setup of a single sample impulse into an LPF of the given parameters until (output_1 < output). This will find the max as well but this is tedious and computationally consuming.
I would hope some equation can do this faster.
Thanks for any thoughts.


texts:
I am trying to implement BPSK demodulator in FPGA. First, I am modeling the system in MATLAB. Now, I am trying to design Costas Loop for carrier synchronization. This is the block diagram I'm trying to achieve:

I'm using RRC as a low pass filter. This is the MATLAB code:

load RRC.mat

fc = 0.05; % 0.11  %0.09
N = length(rf_signal);
bb = zeros(1, N);
bb_f = zeros(1, N);
I_f = zeros(1, N);
Q_f = zeros(1, N);
I_r = zeros(1, N);
Q_r = zeros(1, N);
error = zeros(1, N);
PhErr = zeros(1, N);
error_integral = zeros(1, N);
Theta = zeros(1, N);

% Loop Filter Coefficients
BW = 100;  % Hz
loop_theta = 2*pi*BW;
C1 = 4*(loop_theta)^2/(1+sqrt(2)*loop_theta+loop_theta^2);
C2 = 2*sqrt(2)*loop_theta/(1+sqrt(2)*loop_theta+loop_theta^2);

for i = 2:N
    % Downconverting to Baseband
    bb(i) = rf_signal(i).*exp(j*2*pi*fc*i).*exp(j*Theta(i-1));

    % Filtering
    bb_f = filter(RRC, bb(1:i));
    I_f(i) = real(bb_f(i));
    Q_f(i) = imag(bb_f(i));

    % Error
    error(i) = I_f(i).*Q_f(i);

    % Loop Filter
    error_integral(i) = error(i).*C1 + error_integral(i-1);
    PhErr(i) = error(i).*C2 + error_integral(i);

    % Phase Accumulator
    Theta(i) = Theta(i-1) + PhErr(i);

end

figure; subplot 221; plot(real(bb)); title('I Channel')
subplot 222; plot(imag(bb)); title('Q Channel')
subplot 223; plot(I_f); title('I Channel Filter')
subplot 224; plot(Q_f); title('Q Channel Filter')

figure; subplot 311; plot(error); title('Phase Error');
subplot 312; plot(PhErr); title('Loop Filter');
subplot 313; plot(Theta); title('Control Signal \theta');

rf_signal comes from another script that generates BPSK signal.
However, when I close the loop and set frequency exactly as the transmitter's I get these waveforms:

Although the signal demodulates very well when I open the loop. I have tested the loop with a cosine wave and it works just fine by producing a DC signal.

Any advice would be appreciated.


texts: Meaning of "Base" in Walsh Hadamard Tranform in Image Processing?

texts:
Currently, I am studying a paper by K. He and J. Sun, “Computing nearest-neighbor ﬁelds via propagation-assisted KD-trees,” in Proc. IEEE Conf. Comput. Vis. Pattern Recog., 2012, pp. 111–118.

In the paper there is a sentence which i can quote as:

  ...  We use the ﬁrst 16 WHT bases for the Y channel2 and 4 for each
  chrominance channel (Cb/Cr) throughout this paper. ...

Although I have made a search on the internet, I couldn't get the meaning of base.

In MATLAB 2014b There is a function fwht(x,n) where n is the order of the transform. Can this order be the base that i am trying to find the meaning of?


texts: Advances in Blind SNR estimation beyond $M_2M_4$

texts:
In Pauluzzi and Beaulieu, various SNR estimation methods are compared. Among the blind methods considered, the $M_2M_4$ estimator seemed to be unambiguously the best. However, it has been shown that the $M_2M_4$ estimator is too high for low SNR, and too low for very high SNR; see here for details. In addition, computing the estimator is kinda like walking through a minefield; there's no guarantee of existence for the system $M_2 = S+N$, $M_4 = k_a S^2 + 6SN + k_w N^2$ for arbitrary positive ${M_2, M_4, k_a, k_w}$ and hence total failure for the method is common.

It has been roughly 20 years since Pauluzzi and Beaulieu's paper. Have any advances in blind SNR estimation been made? What do experts currently regard as the gold standard in blind SNR estimation?


texts: HMM-based speech recognition/synthesis: state representation of monophones and triphones

texts:
In literature, a monophone is represented with 3 states.

When doing context dependent clustering, 3 states are used to represent a triphone.

Why is the triphone represented with 3 states and not 5? Doesn't modeling with 3 states reduce the information?

My current understanding is that each of the phones in a triphone corresponds to each of the states. For example, given a triphone 'k-a+b', then the first state corresponds to 'k', etc.


texts: Phase error correction for Fourier transform basis vectors

texts:
I was wondering what is the best way to account for phase noise in a set of basis vectors?

Example:
I have a measured signal, say $f'(x)$ that should be related to a desired spectrum $f(\nu)$ through the following relation (which is a Fourier transform for x-symmetric, band-limited signals, as pointed at in comments below):

\begin{equation}
f(\nu) = \int_0^{x_\text{max}} f'(x) \cos(2\pi x \nu)\,dx \tag1
\end{equation}

This can be expressed with vectors and matrices as $f'(x) = M\cdot f(\nu)$.  Here, the rows of $M$ correspond to an orthogonal set of sinusoidally varying basis vectors.

In my particular problem, the system has constant phase error that results in an actual relation of:
\begin{equation}
f(\nu) = \int_0^{x_\text{max}} f'(x) \cos\left(2\pi x \nu + \phi(x)\right)\,dx \tag2
\end{equation}
When I calculate this particular calibration matrix $M'$ (s.t. $f'(x) = M'\cdot f(\nu)$) for this system and perform the Moore-Penrose pseudo-inverse ($M'$ is non-square), I find very significant errors resulting in my spectra calculated via $f(v) = M'^{-1}f'(x)$.  I have also confirmed that spectral reconstruction via the pseudo-inverse without the phase noise works well (as I would expect).

Assuming I know apriori what my phase errors $\phi(x)$ are, is there a better way for me to reconstruct my spectrum $f(v)$ than through just the pseudo-inverse of $M'$?  Any additional insight or ways of looking at this are appreciated.

Edit:
Assume the matrix $M'$ is measured with a known, single frequency input so that the rows of $M'$ are indeed sinusoidally varying basis vectors, and the spectrum is known for $k$ points, and the signal is measured for $m$ $x$-points, so $M'$ is a $k\times m$ matrix ($k>m$). I could simply measure fewer spectral points, so $M'$ is square, though I had thought oversampling might provide some additional information.


texts: Kalman filter after lowpass filter: bad idea?

texts:
I am new to Kalman filter and am enjoying playing with it. However, I generated some random velocities and acceleration and Kalman filter (with the covariance matrices I have chosen) is comparable with lowpass filtering.

So I thought maybe both lowpass filtering and Kalman filter could be combined, however this completely ruins the assumption of white Gaussian noise. My numerical experiments indicates that Kalman filter does not bring anything interesting after LP filtering for the cases I tried.

What are good preprocessing practices, if any, before applying a Kalman filter?


texts: Understanding a simple case of fft2 in python

texts:
I have 2D arrays representing surfaces. I have created them by scanning some theoretically flat objects and I ended up with what can be called "imperfections", or else, deviation from the perfectly flat surface.

I hope to get information on the dominant wavelengths of imperfections and their amplitude, so I employed numpy's fft2. Since I am a first timer, I did some digging and tried to play around with some basic examples to get a grip.

Here is one:

import numpy as np
import matplotlib.pyplot as plt

"""
fft2 playground.
"""

# Initialise an empty array
field = np.empty([29, 481])

# Set the wave amplitude
amp = 2.5

# Create the synthetic sinusoidal field
for n, i in enumerate(np.linspace(0, 2 * np.pi, field.shape[0])):
    for m, j in enumerate(np.linspace(0, 2 * np.pi, field.shape[1])):
        field[n, m] = amp * np.sin(j)

# Perform 2D fourier and shift the result to centre
f = np.fft.fft2(field)
fshift = np.fft.fftshift(f)

# Calculate the magnitude and phase spectra
magnitude_spectrum = 20*np.log(np.abs(fshift))
phase_spectrum = np.angle(fshift)

# Reconstruct the initial field
f_ishift = np.fft.ifftshift(fshift)
re_field = np.abs(np.fft.ifft2(f_ishift))

# Plot
fig = plt.figure()

fig.add_subplot(411)
plt.imshow(field, cmap='gray')
plt.title('Field'), plt.xticks([]), plt.yticks([])
plt.colorbar()

fig.add_subplot(412)
plt.imshow(magnitude_spectrum, cmap='gray')
plt.title('Magnitude spectrum'), plt.xticks([]), plt.yticks([])

fig.add_subplot(413)
plt.imshow(phase_spectrum, cmap='gray')
plt.title('Phase spectrum'), plt.xticks([]), plt.yticks([])

fig.add_subplot(414)
plt.imshow(re_field, cmap='gray')
plt.title('Reconstructed field'), plt.xticks([]), plt.yticks([])
plt.colorbar()

plt.show()

Which gives:

Obviously the returned field is not the same as the input. The amplitude is correct but it is mirrored and 90 degrees off-phase. I feel I am missing something but I cannot nail it.

Also, I would expect that the magnitude spectrum would be something like 2 dots, one on either side of the central pixel and nothing else. What I understand is that the central pixel is the zero-frequency and moving to the edges are the higher frequencies, up to the Nyquist.

Worth noting, if I change the dimensions of the input field I get different results on the magnitude and phase spectra.

Could someone point out what am I missing please? How would I get back the initial field from the fft and why the magnitude spectrum is the way it is?

Thanx!


texts: How does Siri recognize me saying "Hey Siri"?

texts:
I am trying to understand how my iPhone can continually listening for me saying Hey Siri, Alexa, Hey Cortana or Okay Google without quickly draining my battery down.

I imagined two kind of algorithm. One that record slice of time such as 10 ms wide slices each 200 ms and perform a synchronous detection on specific frequencies. However these parameters strongly depend on the characteristic of my voice. Moreover, it will still consume a lot of CPU power to continually try to match a Hey Siri in the middle of nowhere.

What kind of efficient low-power algorithm/implementation (hardware or software) can perform such task?

This is somehow related to this patent I think: https://www.google.com/patents/US20160253997

I read some articles that talk about hidden Markov models, but I doubt it is very low power approach.


texts: Camera Calibration using Single Input Image

texts:
Given a camera, permanently located at the same position, angle and distance from what is being captured, and a single calibration image ( a row of vertical lines [ | | | | ] ), how would one go about using the image to apply correction (barrel distortion) to all subsequent images?

Numerous examples exist online for the camera calibration problem, but most attempt to achieve the correction through guess-work, or highly involved processes to correct real-world images. However, I cannot find anything on calibrating a camera whose position and subject is always at the same position, and where the expected positions of vertical lines are known prior to correction.

The closest I've come to my approach is the plumb-line calibration method described by brown (1971).

Are there any algorithms or pseudo code out there which describes an approach to calibrate using a single input image of vertical lines (where distortion would be clealry visible by the gap between each line)?

Close-Range Camera Calibration - D.C, Brown


texts: Technique of sampling a high-frequency signal (Mhz) with a lower sampling rate (khz)?

texts:
I currently have a .wav signal that was recorded at a 48 kHz sample rate, with a central frequency of 5.260 MHz and bandwidth of 4 kHz. I'm trying to get some information from this signal, specifically the location of the frequency peaks using matlab, which I would expect to be around 5.260 MHz. The code I'm using to generate the power spectral density is as follows:

path = '5.260MHz.wav';
f0 = 5.260e6; % frequency 5.260 MHz

% sample properties
[x, Fs] = wavread(path); % Fs = 48 kHz
alias = 48e3*floor(f0/48e3);      % starting frequency of target alias

%estimate spectrum
[psd, f] = pwelch(x, 512, [], [], Fs);

% If the frequency lies in one of the mirror frequency bands,
% we have to rotate about half the sample rate.
if (mod(f0, 48e3) > 24e3)
    f = Fs - f;
end

plot(f + alias, psd)

This script produces the following plot

The bandwidth does seem to be 4 kHz as expected, but the frequency peaks appear to be in the wrong place. I would expect them to occur between 5.256 and 5.264 MHz, or maybe 5.258 and 5.262 MHz, not between 5.276 and 5.280 MHz.

However, when I generated my own files with the same central frequency and bandwidth, I got the following when I ran the above script:

% signal properties
f0 = 5.260e6;           % frequency 5.260 MHz
sf = 4e3;               % bandwidth 4 kHz

% sample properties
fs = 24e6;              % sampling frequency 24 MHz
N = 10e6;               % number of samples

% generate random frequency modulated sinusoidal signal
fi = smooth(randn(N, 1), 11);
fi = fi / std(fi) * sf + f0;
x = cos(2 * pi * cumsum(fi) / fs);

% downsample to 48 kHz (factor 500)
x = x(1 :500: end);
fs = fs / 500;

wavwrite(x, fs, 'test_5.260MHz.wav');

This plot is exactly as expected, using the same script as the first plot. I'm wondering if I should be treating the first input different in some way to have it graphed correctly.

So far I've tried testing some other generated cosine signals using the same code as above, and they all graph correctly. However, every data signal I've tried has been off to some degree (I can post different sample plots if that would be useful). It could be an error with the data collection instrument, but it's far more likely to be a bug in my code.


texts:
The rayleigh channel is a single tap.
   1.
    h=1/sqrt(2)*randn(1,length(txSig_cp))+1i*randn(1,length(txSig_cp));
    fading=h.*txSig_cp;

   2.
    h=1/sqrt(2)*(randn(1,1)+1i*randn(1,1));
    fading=conv(h,txSig_cp);

Which one is correct? or both also wrong. Because I have obtained different results when compared to the berfading function in MATLAB (berfading(EbNoVec,'psk',4,1)).


texts: Sine wave in frequency domain on signal analyzer

texts:
The Fourier Transform of sine wave ($\sin(2 \pi A t)$) is given as :
$$\frac{1}{2i} [\delta(f-A)-\delta(f+A)]$$

This means that the Fourier Transform of the real function, $\sin(t)$ has an imaginary Fourier Transform (no real part).

How can we observe this Fourier Transform of sine wave on signal analyzer if it is imaginary with an "$i$" in it?

The thing is that I have a very high frequency signal (a few GHz) and so I am not able to see this signal clearly in time domain because the resolution of my signal analyzer is not that good. So I was trying to view it in frequency domain instead of time domain. Right now, in frequency domain I am able to view this signal as a single spike. So, should I conclude that the signal generated is a sine wave?


texts: Maximum Ratio Combining vs. Selection Combining

texts: In literature, I am seeing that MRC almost always works better than SC. Also, in my simulations for Rayleigh and Rician fading channel, I am getting the same results. Could anyone please explain what are the reasons behind this? I tried to read some papers but did not get a clear idea.


texts: What does it mean to say that "sinc" filters are ideal?

texts:
I suggested to someone that one can create a sinc filter that is ideal enough to be indistinguishable from the ideal, given certain limitations with the data in the first place.

Is that true?

It was only a suggestion yet it was met with unhelpfulness.


texts: What is the mathematical interpretation of using direct inversion around a single pole/zero

texts:
Let $F[z]=N^2\frac{z(z-(3+j\sqrt{7})/2)(z-(3-j\sqrt{7})/2)}{(z-1)^3}$

This has 3 poles at $z=1$; one zero at $z=0$; and a conjugate pair of zeros at $z=\frac{3\pm{}j\sqrt{7}}{2}$

Assuming a contour $H$ encircles these roots and zeros, a unique inverse is obtained from direct inversion:

$$f=\frac{1}{2{\pi}j}\oint_H Fz^{n-1} \,dz$$

What, if any, is the mathematical interpretation of taking a contour around a single pole or zero?


texts:
There are several web articles on the topic, but, after having read them, I still don't know what "energy" is, in the context of computer vision (CV) and image processing (IP). It is related to optimisation, given that, apparently, there are the so-called "energy minimisation problems".

Why is it called "energy" (that is, why the word "energy")?  I read it is because it is related to the concept of "energy" in physics, but assume that I have no idea of what energy in physics is. How would you explain what energy is in IP and CV? What is the intuition behind it?

Why do we care about energy? Given that there are the energy minimisation problems, we want to minimise energy, in such cases. I have also read that there are energy maximisation problems, so sometimes we also want to maximise energy.

I have read that it has different meanings depending on the context, but I just want to know its meaning in image processing and computer vision, that is, in the context of images.


texts:
I am trying to improve an edge following algorithm developed by some students who did a project at my work. The algorithm is supposed to make a robot follow a line with the use of a camera. Their approach was to detect edges with Canny's algorithm and then extract lines from this image using the Hough transform. Three suggested lines will then be presented to the user, who may choose which line the robot should try to follow.

What I want feedback about is data association using the Hough transform. Is there any good criteria for matching of lines between frames? The used solution right now is to measure the angle and distance between followed line and extracted lines and to choose the one that is most similar.

One other problem I see is that they did not filter the signal, i.e. detected lines between frames. I have an idea about using Kalman filter to estimate the current parameters of the edge by using the extracted lines so that it is dynamic and less error prone. What do you think about that?

I have thought about making a SLAM algorithm instead but since we only want a proof of concept that will be a huge remake and requires much more data than I currently have.


texts: Signal conjugation detected on RF recording samples, why?

texts: I collected spread spectrum signals at 400 MHz at low elevation angles using Software Defined Radio complex sampling over the seasons. I noticed that over watery, icy surfaces, the RF samples are conjugated compared with regular open space RF samples, resulting in failed de-spreading. De-spreading works if the signal samples are conjugated. I like to think that this phenomenon can be because the 180 deg. reversal of H vector of the wave front in reflection causing |E x H|atan(-H/E) resulting in a 90 deg. change of phase. This answer just doesn't appear to be convincing. Search the Net, could not find any related report on reflected RF signal has signal sample conjugated. Any suggestions?


texts: Polar form of the Fourier transform of $\sin(t)$

texts:
I came across the Fourier transform of sin(t).

It ends up being a purely imaginary (dirac delta) impulse pair. But when considering the frequency domain representation of a signal, we consider the graphs of (i) the magnitude of the signal w.r.t. frequency and (ii) the phase (i.e. argument or angle) of the signal w.r.t. frequency.

In the case of $\sin(t)$, the phase can be seen to be 90 degrees, treating the delta functions in manner analogous to real numbers.

But how would I find the magnitude? Could someone please provide a reference to a textbook?

As another example, what would be the magnitude and phase of

$$\operatorname{FourierTransform}(\cos(t)) \cdot (4 + 2j) \text{ ?}$$


texts: Explanation of Spectral Line Splitting when AR process is overmodeled

texts:
In the book Statistical Digital Signal Processing and Modeling by Monson Hayes, it is shown (in section 8.5.1) that when an AR(2) process described by the following difference equation
$$x(n) = 0.9x(n-2) + w(n)$$

is modeled with two different values of model orders $p = 4$ and $p = 12$, a single peak appears in the power spectrum for the former case and two peaks occur for the latter one. How do I explain this?
What is the relation between the model order and the number of peaks. Please forgive my lack of proper fundamentals, but I also wish to know why I am supposed to expect only a single peak to occur and not more than one?

The equations involved in estimating model parameters $a_{p}(k)$ and $b(0)$ and power spectrum of the AR process are given below. $r_{x}(k)$ refers to the autocorrelation sequence.

\begin{equation}
    \hat{P}_{AR}(e^{j\omega}) = \frac{|\hat{b}(0)|^{2}}{\left|1 + \sum_{k=1}^{p}\hat{a}_{p}(k)e^{-jk\omega}\right|^{2}}
\end{equation}

\begin{equation}
    \begin{bmatrix}
    r_{x}(0) & r_{x}(1) & r_{x}(2) & \dots & r_{x}(p)\\
    r_{x}(1) & r_{x}(0) & r_{x}(1) & \dots & r_{x}(p-1)\\
    r_{x}(1) & r_{x}(0) & r_{x}(1) & \dots & r_{x}(p-2)\\
    \vdots & \vdots & \vdots & \vdots & \vdots\\
    r_{x}(p) & r_{x}(p-1) & r_{x}(p-2) & \dots & r_{x}(0)\\
    \end{bmatrix}
    \begin{bmatrix}
    1\\
    a_{p}(1) \\
    a_{p}(2) \\
    \vdots \\
    a_{p}(p)
    \end{bmatrix}
    =
    \epsilon_{p}
    \begin{bmatrix}
    1\\
    0 \\
    0 \\
    \vdots \\
    0
    \end{bmatrix}
\end{equation}

\begin{equation}
    |b(0)|^{2} = \epsilon_{p} = r_{x}(0) + \sum_{k=1}^{p}a_{p}(k)r_{x}^{*}(k)
\end{equation}


texts: Criterion to choose length of an accumulator and product

texts:
I am designing an IIR filter with fixed-point arithmetic and I have to select the proper length for the accumulator and product. I would like to know a standard to follow in order to choose its length. I have selected the Direct Form 1 topology to implement a 6th order digital filter (instead of a cascaded second-order block), as it has only only one point where the sum is done and thus only one point which has to be taken care of when considering quantification error and overflow (correct me if I am wrong!).

For the ACCUMULATOR, I assume that I have to consider the worst case of summing numbers with N bits, so the answer should be N+M bits to avoid overflow, where M represents the quantity of numbers which it is summed.

For the PRODUCT, multiplying two numbers of N bits, in the worst scenario gives us a N+N=2N bits result.

I don't know if it is this easy or if I am skipping an important concept.

If you have experience in this field, any documentation about designing IIR filters on microcontrollers will be welcomed.


texts:
Why is the transfer function from node 2 to 3 $H_{23}=\frac{z^{-1}}{1+az^{-1}}$?
I don't understand the $z^{-1}$ in the numerator.


texts: Multi Image (Same Noise Realization) Denoising

texts:
I have two signals Sa and Sb, both affected by the same noise.  I don't know how much noise is mixed into each one, and the signal+noise is transformed using some (unknown) nonlinear function before I get it.  If the original signals are Sa and Sb and the noise is N, what I actually have Ta = f1(Sa + k1*N) and Ta = f2(Sb + k2*N).  f1 and f2 are different.  I would like to get Sa and Sb, or possibly f1(Sa) and f2(Sb): ie the transforms are not especially of interest, but removing the shared noise is.

The transform functions f1 and f2 are monotonic and reasonably well behaved.  I think they are closely approximated by f(x) = c1*(x^c2 + c3) where c2 is typically 0.9-1.1.  In some cases f1 is approximately the same as f2, so I'm interested in a solution for f1 same as f2 also.

The signals are actually images; so there is quite a lot of data to work with, typically 1-4 million data points each in a pair of signals.

This seems like a source separation or possibly deconvolution/guided filtering problem, but I can't really think of a good approach.  I can't even come up in with a good solution in the limited case when there are no transform functions... it is an under-determined problem, because given Ta = Sa+k1*N and Tb = Sb+k2*N, any arbitrary choice of N and k1 and k2 works for Sa = Ta-k1*N and Sb = Tb-k2*N.  I think there have to be some regularizing assumptions, like minimizing total variation of Sa, Sb and N, or minimizing cross-correlation, or some kind of other entropy based metric.

EDIT As requested, here is an image pair.  The highlighted black dot is not really in the images, it is due to debris in the optics, and present in both images in the exact same position (although: it has somewhat lower intensity in the second image).


texts:
I have two sensors measuring a single time varying signal . The first sensor  (reference sensor) is sampling the data at 60 Hz and the second sensor (test sensor) is sampling the data at 60 Hz.  I need to check the accuracy of the test sensor by comparing with the reference sensor. I am confused about how to downsample the data recorded at 100 Hz to 60 Hz.  I see it is quite trivial to downsample from 100 Hz to 50Hz/25 Hz. But I am confused how to downsize to 60 Hz.

After downsampling, is cross-correlation a good technique to compare the data from two sensors?

Can you please help?

Thanks,
Peter


texts:
Given this signal:
  $$4000\,\mbox{sinc}(4000t)+D1000\,\mbox{sinc}(1000t)$$
  with $ D=6000$, find its energy.

To find the energy of sinc I use this transform:

$$A\,\mbox{sinc}(Bt) \rightarrow A\,\mbox{rect}(f/B)/B$$

and compute the energy $E$ using:
$$E=\frac{A^2}{B}$$

In this case what is the right answer?

A) $4000^2/4000+D^21000^2/10000$ or
B) $1/4000+A^2/1000$


texts: Is it possible to identify the "blank data" in a JPEG without knowing the image history?

texts:
I am pretty much a begginer in matters of Image signal and to be honest, not that much versed into mathematics. I hope my question will not sound too naive. (sorry in advance)
(Also if it has been answered already, please redirect me to the correct thread)
Well my question is relating to JPEG quality in general.
rephrased question :
Let's imagine a JPEG with a quality under 100%. Let's say 70%.
If I re-encode this image with a quality of 100%, the weight increase a lot (it more than doubles up on my test with ImageMagick).
Obviously some data has been created, but the image can't be of better quality than the original 70% JPEG.
In the process there is what can be called "blank data" added: data that is not improving image.
How can we know if a given JPEG has an amount of such blank data ?


texts: Perform frequency analysis on grouped pulses

texts:
I have a system which consists of individual pulses grouped in trains.

The trains have a frequency of 10 Hz, with a timing precision of sub ns.
The pulses have a frequency of 2.2 MHz with a timing precision of sub ps. The train consists of 100-1000 pulses.

I would like to do a spectrogram in the range 0.1 - 100 Hz. Up to  5 Hz its trivial. I simply take the average of the train and still have the Nyquist theorem fullfilled. However I see a lot of signal which could come from aliasing. Is there a possibility to use the 5 order of magnitude faster signal from the individual pulses to gain anything useful here? I have a maximum of 25d of data. But I would ideally like to do a spectrogram, meaning it would be great to stay within about an hour of data (e.g 36k trains)


texts: Range of function $ \frac{1}{n\pi}(1-\cos(n\pi))\sin(\frac{n\pi}{2})$ and determination of Fourier coefficients

texts:
I am computing the Fourier series expansion of the given signal $x(t)$. In that I am having difficulties in calculating range of function $ \frac{1}{n\pi}(1-\cos(n\pi))\sin(\frac{n\pi}{2})$ (or) I am not able to get how can I arrive at equation (2) from equation (1)

I have done some back calculation (and would like to know the forward way of calculating it).

For example, for the function to have a value of $ \frac{2n}{\pi} $

$$ \sin(\frac{n\pi}{2})=1 \,\,  \textrm{and} \,\, \cos(n\pi)=-1$$

$$=> \sin(\frac{n\pi}{2})=\sin((4k+1)\frac{\pi}{2}) \,  \textrm{and} \, \cos(n\pi)=\cos(2k+1)\pi$$
$$=>n=(4k+1) \, \textrm{and} \, n =(2k+1)$$

Which is a contradiction and doesn't match with the book. (Is this the case that among $=>n=(4k+1)$, and $n =(2k+1)$, we have to choose $n=(4k+1)$?)

And how have we arrived at 2nd part of equation (2)?

Please help in this regard.

Also clarify another doubt. How have we arrived at equation (3) from (2). It is confusing because it involves determination of the terms based on n which in turn is dependent on $k$.


texts: Find the center of positive plateaus of rectangular function

texts:
If I have a rectangular function with irregular positive parts, is there a clever way of finding the center of each positive "plateau"?

The application is, that I threshold a continuous function and want to find the center locations of each segment that is greater than the threshold.


texts: Reconstruct signal from its Spectrogram only

texts:
The spectrogram of a signal throws away the phase information, but it is said to be possible to reconstruct the signal only from the spectrogram [1] via
$$s(t) = \frac{1}{2\pi s^*(0)}\int_{-\infty}^{\infty}\frac{M_{SP}(\theta,t)}{A_h(-\theta,t)}e^{-j\theta t/2}d\theta$$ where $M_{SP}$ is the chariteristic function of spectrogram and ${A_h(\theta,t)}$ is the ambiguity function of the window.

The formula seems to work in theory. Could anybody explain why it works? Some phase information is thrown away after all. Also, is it a good reconstruction tool used in practice? It seems to me that nobody uses this as the reconstruction tool.

[1] L. Cohen, Time-frequency analysis. Englewood Cliffs, N.J: Prentice Hall PTR, 1995.


texts: Difference in Interpretation: $ω$ (rads/s) vs. $ω$ (rads) and $X(ω)$ vs. $X(e^{jω})$

texts:
The fourier transform of a continuous time signal $x(t)$ is $X(ω)$ where the unit of $ω$ is radians/second. And for a discrete signal $x(n)$, the DTFT is $X(e^{jω})$ where the unit of $ω$ is radians. Clearly the $ω$ for FT and DTFT shouldn't mean the same thing.

Question

What is the difference in interpretation of $ω$ (rads/s) and $ω$ (rads)?

If we interprete $X(ω_i)$ as the ampitude or $|X(ω_i)|^2$ as the energy associated with the frequency component $ω_i$, then how should we interprete $X(e^{jω_i})$ or $|X(e^{jω_i})|^2$?

Thanks in advance.


texts: Voltage Controlled Oscillator for An Arbitrary Sinusoid

texts:
I have a time-varying signal:
$$ y(t) = g(t) + a(t) \sin(2 \pi f_m t) $$
$g(t)$ and $a(t)$ are varying with time.. I have both of them as 2D arrays of [time value]
I need to perform VCO for $y(t)$ in MATLAB with these specifications:
$F_c$ = carrier center frequency = 560 Hz
$A_c$ = carrier amplitude = 10 V
$\Delta f$ = variation of oscillation frequency = $\pm$ 30 Hz
Any help how I can do it ?


texts: Optimal sensor placement for 3D TDoA positioning

texts:
Suppose there is a rectangle indoor area, we want to locate different positions within this area using TDoA estimations. 5 sensors are placed to obtain optimal 3D positions with TDoA errors, we only care about horizontal positions (i.e., x and y coordinates), while the error in z coordinate estimation is the least thing we care. We place the first sensor at the origin and implement linear least square algorithm to get the optimal estimated position.

The above is the problem background, my question is: what's the optimal geometric node placement under this condition? By saying "optimal" I am talking about the optimal placement that maximises the TDoA error tolerance ability. So is there an optimal node placement pattern that can maximise the TDoA error tolerance? I have seen many papers regarding to the 2D case, but so far I didn't see one for 3D positioning.

thx


texts: Minimal step response overshoot IIR notch filter design

texts: Is there any IIR notch filter design algorithm, strategy or rule of thumb, that provides control for amount of overshoot/undershoot in step response of a filter?


texts:
I have the following problem. I have a speckle pattern (of light) like on the image below (left).
 I have to locate as precisely as possible the centers of all speckles.

That would not be a problem if those speckles would have some constant, known shape, e.g. Gaussians.

But they are irregular and I do not really know how to do this.

What I do now is:

I look for the highest point in the image and Im registering coordinates of this point.
I mask (NaN) the circular area near this point - more or less of the size of a typical speckle (image, 2nd subplot) and
I'm searching for another highest point. If there are no NaNs in the circular ares of this point, I register its position also. And so on, hundreds of times.

But it is not working to well. Is there any standard method in signal analysis for localization of individual speckles in the speckle pattern?

Image:

Left - speckle pattern
2nd  - masked areas
3rd  - registered positions if the masks can overlap
4rd  - ... if they cannot.