texts:
First post here, trying to make it as good as possible. Do not know how to make the Python code look nice - any tips? :) Anywho - to the main problem:

I am currently working on simulating the uplink of LTE starting with the SC-FDM(A) modulator. Now, the "first edition" is the OFDM modulator implemented in Python and basically:

import numpy as np

import numpy.fft as npf

numSymbols = 12*10 # 10 resource blocks, each containing 12 subcarriers.   FFTsize = 1024

tmp1 = np.array(np.random.randint(0,2,numSymbols))*2-1   tmp2 = np.array(np.random.randint(0,2,numSymbols))*2-1

inputSymbols = (np.array(tmp1) + 1j*np.array(tmp2))/np.sqrt(2) # QPSK modulation

TxSamples = npf.ifft(inputSymbols,FFTsize) # Zero-padded IFFT.

TxSamples is the OFDM modulated signal of some random binary input. The subcarrier mapping is implicit in the IFFT due to the zero-padding.

My issue is the fact that LTE Uplink uses half a subcarrier shift in relation to DC. My implementation is build upon the assumption that each entry in the IFFT is spaced with 15kHz (the required subcarrier spacing according to LTE) and this is also the case for two other implementations I have found here and here.

So, how can this half subcarrier shift (7.5kHz) be incoorperated into the simulation?

Let me know if you need more information - do not really know what is to much or to little information regarding my issue.

Thanks in advance.

** UPDATE: **

So, I tried to do the frequency oversampling by simply adding a zero in between samples. This resulted in me having a replica in the time domain. Cutting away this replica got me back to the starting point.

What I have done in order to solve the problem is basically mathematical driven. From the formula for the DFT it is possible to derive that you can simply multiply the input symbols by a complex exponential. This will shift the frequency. The Python code is basically (overwriting the last line in the example above):

ism = []
for m in range(len(inputSymbols)):
    ism += [inputSymbols[m]*np.exp(1j*np.pi*m/FFTsize)]
TxSamples = npf.ifft(ism,FFTsize)

which yields the correct time domain representation, with no sorta explicit oversampling. To verify scipy can be used as:

import scipy.signal as sps
import pylab as pl

ts1 = sps.resample(TxSamples,len(TxSamples)*2)
pl.figure(1)
pl.plot(10*np.log10(abs(npf.fft(ts1))))

which should show that the signal has now been oversampled by two and that the frequency bins are located correctly, while the time domain representation is not broken.

I suppose this way one makes sure that both domains are "the same". Since by simply oversampling in the frequency domain it is not possible to represent the time domain signal correctly. I do not know - it seems that this "hacked" solution works. However kind corrections are always welcome.


texts: Programming language for sound manipulation

texts:
Having had little experience in PHP, I moved to C++ in-order to create a spectrogram, I wanted to create probably the simplest/easiest one for my first project, so easy infact I don't need reading/write to files or add settings to it.

But, as far as I have been learning C++ I was able to manipulate audio file, only to read and write, but the spectrogram works, by reading from a mic and this seems kind of hard to do. I have looked every link in Google, with the word spectogram and C++ in it, but I haven't gotten any useful page.

Now, if I am not mistaken, for the project I am working on, it may be good idea to use JAVA, because I read somewhere that JAVA is better than C++  1 in a way it manipulates sound, and 2 it is actually easier to learn than C++

So, I wanted to ask here, if JAVA is better for my project, which I will be doing in Windows7?


texts: Amplitude demodulation of sinusidal signal in matlab

texts:
AM-demodulation task and I was asked to demodulate the signal in MATLAB and the result should contain three pictures.

plotting the $fft$ the (frequency spectrum)of the signal i was able to determine that the pictures are located at 0.1 , 0.25 and 0.5 frequencies.

The problem is that my code below only plot one picture which is located at 0 and I don't know how plot the shifted pictures that are located at 0.25 and 0.5 frequencies.

I tried to multiply it by complex exponential and still not able to plot the pictures

The main problem is that i need to shift those pictures that are located at 0.25 and 0.5 frequency to the center and apply my low pass filter, however i tried as the following code but failed. please help me.

The is the $fft$ of the signal.

  I get a mysterious signal modulated with the message as a signal vector z[n],
  by running the MATLAB function mkhwdata. The parameters of this function are your
  social security number in one
  column vector, e.g.
  z = mkhwdata ([xxxxxx]);
  The response from the function will be that a vector z containing the signal z[n], where the vectors
  first element corresponds to the time index n = 0.

  • To convert a vector, e.g. vector s describing the signal s[n], to an image use the provided function present_image. Try for example to watch the signal z[n]
  directly:
  present_image (z)

clc
close all;
clear

fc = 0.2;
fs = 0.5;
[z]= mkhwdata([xxxxxxxxx]);

[Z,nu] = tdftfast(z);
%N = length(z);
 n = [-0.5:1/0.5:0.5];
%n = N*(0:N-1);
 mult  = 0.5.*exp(1i*2*0.25*pi.*n)  + 0.5.*exp(-1i*2*0.25*pi.*n);
 mult2 = 0.5.*exp(1i*2*pi*0.5.*n)   + 0.5.*exp(-1i*2*pi*0.5.*n);
 [z1] = ifft(Z.*mult);

 [z2] = ifft(Z.*mult2);

 %Lowpass filter
 [num,den] = butter(9,0.2);

 y  = filter(num,den,z);
 y1 = filter(num,den,z1);
 y2 = filter(num,den,z2);
 figure(4)
 ylabel('Amplitude');
 xlabel('Frequency (hz)');
 subplot(221)
 present_image(z);
 subplot(222)
 present_image(y);
 subplot(223)
 present_image(y1);
 subplot(224)
 present_image(y2);


texts: Clarification Needed: Power Spectral Density of Real Signal

texts: For a real signal, the power spectrum will have Hermitian symmetry. If I consider the one-sided spectrum (as negative frequencies, or anything above the Nyquist frequency are redundant) must I then multiply my power spectrum by a factor of 2? I have seen this done but I can't understand why the "redundant", symmetrical portion of the spectrum should factor into the power density? Maybe this is a matter of convention? Please correct my assumptions if necessary.


texts:
I'm currently working on a problem that involves a Z-Transform. Basically, the essence of the problem is that if:
\begin{equation}
H\left(z\right) = \sum_{n=0}^{N-1}h\left(n\right)z^{-n}
\end{equation}
find:
\begin{equation}
Y\left(z\right)\:=\:H\left(z\right)\cdot H^*\left(\frac{1}{z^*}\right)
\end{equation}
The asterisk represents a complex conjugate.
So, I know that
\begin{equation}
H^*\left(\frac{1}{z^*}\right)\:=\:\sum _{n=0}^{N-1}h^*\left(n\right)z^n
\end{equation}
Am stuck at this part now:
\begin{equation}
Y\left(z\right)=\left(\sum_{n=0}^{N-1}h\left(n\right)z^{-n}\right)\left(\sum_{n=0}^{N-1}h^*\left(n\right)z^n\right)
\end{equation}
I'm stuck at this part and don't know what to do from here. Thank you for your help in advance.


texts: Analyze and reproduce sonic screwdriver sound

texts:
Do you know about Doctor Who and its screwdriver?

Well, I'm trying to understand how to replicate this sound but the spectral analysis is too way complicated, just see its spectrogram.

I was trying to figure out what kind of sine waves or partials it is made of, but probably I have no good experience in this.

I'm writing it in python but for know I have nothing than a signal with two sine waves just to make tests.

How can I understand how this sound is made?
There is a frequency modulation component which I would not consider right now, because it is probably a steady state sound which was modulated later.

import matplotlib.pyplot as plt
import numpy as np
import sys
from scipy.signal import get_window
import sounddevice as sd
import soundfile as sf

timeLength = 1.0                       # seconds
fs = 44100
t = np.arange(0, timeLength, 1.0/fs)
ww = get_window("hann", t.size)
A = .01
phi = np.pi # phase, radiants.

T = 1.0/fs
df = 20
t_circ = 0.1
t_mid = 0.2
f_mid = 3700
f_circ = df*(1.0 - ((t_circ - t_mid)/t_mid)**2.0)**0.5
phase1 = np.cumsum((f_mid + f_circ)*T*np.ones(t.size))
phase2 = np.cumsum((f_mid - f_circ)*T*np.ones(t.size))
circ = np.sin(2.0*np.pi*phase1) + np.sin(2.0*np.pi*phase2)

ss = []
#brown_noise = np.random.wald(1, 0.002, len(t))
for i in range(10):
    f = f_mid + 20*i
    s = A * np.cos(2 * np.pi * f * t + circ)
    ss.append(s)
ss = sum(ss)
ss = ss/max(ss)

plt.plot(ss)
plt.show()
sf.write('out.wav', ss, fs)


texts: Good Reference Problem to Test Filtering/Estimation Algorithms

texts:
I am looking to figure out if a current filter algorithm I have built could be useful for some problems I am looking into at work. It isn't a Kalman filter, but is instead making estimations using a Neural Network and the latest $N$ time series measurements for some state.

I have tested it on a 2D particle tracking problem I put together with what I believe to be fairly large Gaussian noise, and it has performed decent as far as I can see. An example figure is below:

However, I don't know if this sample problem is challenging enough to prove this algorithm works sufficiently well and I also don't have any reference algorithm results to compare against.

Is there any sample problems seen in the literature or elsewhere that I could run to test this filtering algorithm against so I have a reference of what's good or not?


texts: Formulas of the Fourier transform family

texts:
It has annoyed me that there doesn't seem to be a source online where the complete complex Fourier transform family is presented with every variable defined. The lack of definitions can be a nuisance when the transforms often use same symbols to denote different variables. So, what are the relevant transforms and the equations?

(Note: I will post the answers myself, but feel free to edit the answer to be as clear and concise as possible).


texts: How Random Forests can be used for regression?

texts:
I have an understanding of how random forests can be used for regression. But, I am still unable to understand, how random forests can be used for regression.
I have already read the research work of Leo Brieman on random forests. But, I still fail to understand how random forests can be used for regression.

It would be of great help, if this concept can be explained using any toy example.

Thanks in advance.


texts: Why do we care if a system is BIBO stable?

texts: I'm wondering what the actual application of this tidbit of knowledge is. I am currently a student in a Computer Engineering undergraduate program and I was wondering what the applicability of this is. Has there ever been a situation where a signal did come in bounded and leave unbounded, causing massive destruction?


texts: Causal Signal - Fourier Transform or Laplace Transform

texts:
I am dealing with a physics problem which is related to signal processing. The problem requires me to calculate the instantaneous force acting on a body which depends on some physical parameter $x$. Assume that $x(t)$ is periodic in time for the moment. Since $x(t)$ is periodic, then it can be expanded as a Fourier series with different frequency components (and it doesn't really matter if $x(t)$ is causal). The calculation for the instantaneous force involves adding a complex phase shift (which may depend on the frequency) to each of the frequency component. To do that, I can use the convolution theorem and take the convolution of $x(t)$ with some kernel $\kappa(t)$ whose Fourier transform gives me the required phase shifts, i.e. $\tilde{\kappa}(\omega) \propto e^{i\delta(\omega)}$ where $\delta(\omega)$ is the phase shift.

Now if in reality $x(t)$ is not periodic and is causal since I only know its values in the past, can I still apply the same kernel to get the instantaneous force? I have been told that I should use Laplace transform instead of Fourier transform. I see the point of it being bilateral by definition, but I am not sure how it is actually different to Fourier transform. Does applying the convolution theorem to a causal signal still give me the desired phase shifts?


texts: How to do people detection from bird eye view?

texts:
I'm trying to do people detection from bird eye view.

Actually, it is not a normal bird eye view because I don't have RGB images but I have disparity map, depth map as well.

In these kind of images, people are shown like lines that represent a single side of the person. I try to re-explain it: these lines represent the front or the back of the person.

I searched for papers on internet but I got no results.

Anyone have any information about that?

PS: I'm working on Matlab.

The following image shows how people looking like from a bird-eye view depth map. You don't look at the big stain. The 3 red circles contain the bird-eye view depth map of (from the left to right): a street fountain, a person and a roadsign.


texts: Calculating IIR Filter gain at given frequency

texts:
Let's consider an IIR filter with transfer function: $H(z)$.
Given the sampling frequency $F_s$ how can I calculate gain at say $F$ ?
When I was dealing with analog systems when I wanted to calculate gain at say $F=0 Hz$ (DC gain) I would simply put $S=0$ and I would find out what DC gain is.
Now I'm not sure if the same technique applies here.
My inital thought was to put $z= e^{j2\pi}=1$ into the equation but it won't work.
The problem boils down to finding $|{H(z)}|$ which I don't know how to do.
How can I approach this problem?


texts: LMS adaptive filter relatively delayed signal and reference inputs

texts:
I'm using two microcontrollers to implement an adaptive LMS filter to filter out the noise from the signal. One is recording the noise and streaming the data to the other microcontroller which is recording the (noised) signal and using the noise reference, filtering it out.

How does the delay between those signal affect the filtering quality? Say the noise reference input is delayed for 100us/1ms/10ms/100ms/1s, how does that affect the filtering process?


texts:
phi = exp(linspace(0, log(511), 1024)) - 1
x   = cos(2 * pi * phi)

Above will alias, despite peak instantaneous frequency evaluating to exp(log(511)) = 511 < 512. In fact, aliasing begins at x[724], long before peaking. The cause is revealed from diff(phi):

Successive inputs to cos differ by more than pi for all phi > .5. Thus while the continuous-time $\phi'(t) \leq 511$, the discrete-time greatly exceeds it, and we can't simply generate an exponential chirp via f0 * (k**t - 1) / log(k).
Can this limitation be predicted mathematically for any arbitrary $\phi(t)$ (more generally as in $\cos(\phi(t)$)? The goal is to know, for a given N, the allowed pairs of tmin and tmax in linspace(tmin, tmax, N) such that $\phi(t)$ won't alias. (-- Code)


texts:
I'm writing a script to detect blur images using OpenCV by applying Laplacian filter and calculate the std but there is a problem the std for images that contain motion blur is very close to those images which contain any other type of blur. (my propose is to find detect unsuitable images that can't detect the object on it like a dog image that contain motion blur for example)

I used this piece of code cv2.Laplacian(image, cv2.CV_64F, ksize=3 ).std()
 to find the blur ratio and make a threshold for std < 40 is considered a blurry image
 so I want a method to can differentiate between images that contain motion blur images and other kinds of blur


texts: Why is this MATLAB butterworth filter giving me wrong results

texts:
Given a 128 Hz signal, in MATLAB I entered the following command

[B,A] = butter(2,[1/64,63/64],'bandpass'); %construct second order all pass filter
Filtered_Data = filter(B,A, Data) %filter data using butterworth filter

And got

This is far from what I expected since the filter should have passed all frequencies. an someone help point out what I'm doing incorrectly?


texts:
I am new to DSP in general, but can one use linear algebra by itself to characterize a signal?

My first idea was to transform the signal into a matrix and then use the determinate to characteristic the signal. The big problem being that matrices obey row echelon form which means the rows can be switched and produced the same determinate.


texts: How to reconstruct original signal from sampled signal?

texts:
My original signal as
f1=2;
f2=5;

fs=100;
Ts=1/fs;
t=0:Ts:1;

xt=cos(2*pi*f1*t)+cos(2*pi*f2*t);

figure
plot(t,xt)

as shown below figure.

and my sampled signal with fs=12 which is greater than two times of
maximum frequency, 2*f2=10;
fs=12;
Ts=1/fs;
tn=0:Ts:1;

xn=cos(2*pi*f1*tn)+cos(2*pi*f2*tn);

and then I want to reconstruct the original signal with sampled signal.
I tried it using the matlab function interp1 as below
xr=interp1(tn,xn,t,'spline');

I compared original signal and reconstructed signal, but
they are different as shown below figure.

How to reconstruct original signal?


texts: Signal approximation using linear combination of functions

texts:
How I can approximate the signal $x(t)=0.001\,t^3 \exp(-0.1t)$ in the interval $[0,100]$ using a linear combination of the following functions:

$f_1(t)=A_1$

$f_2(t)=A_2\cos(0.05t)$

$f_3(t)=A_3\cos(0.1t)$

$f_4(t)=A_4\cos(0.2t+1)\exp(-0.2t)$

$f_5(t)=A_5\,t^3$

I try to write a matlab code. Is this correct?

t=[0:100];
x_t=0.001*(t.^3).*exp(-0.1*t); %signal given for aproximation
f1_t=x_t.^0;
f2_t=cos(0.05*x_t);
f3_t=cos(0.1*x_t);
f4_t=cos(0.2*x_t+1).*exp(-0.2*x_t);
f5_t=x_t.^3;
M=[f1_t' f2_t' f3_t' f4_t' f5_t']; %matrix with linear components
A=M\x_t'; %matrix with coefficients
f_t=(A(1)*f1_t)+(A(2)*f2_t)+(A(3)*f3_t)+(A(4)*f4_t)+(A(5)*f5_t);
figure(1),plot(f_t);


texts: Any idea what's the OCR tool behind `myfonts.com/WhatTheFont` font recognizer?

texts:
I went to myfonts.com/WhatTheFont to get the font from a text to train tesseract.
I realized that the font recognizer did actually better OCR than when I used tesseract on the same image.
So any idea how could I find out what OCR tool or library they're using?
They do have a forum but it's not a support forum, it's more like a font marketplace.


texts: I am getting I/Q data from a software-defined radio.  I want to do some stuff on signals in the data, but only if it exceeds a certain range.  What is the general procedure to get dB (dBm, or anything) from this kind of data?  Programs such as SDR# do it, but I don't know what exactly they do so that I can imitate them.


texts: Calculating the Norm of Each Sample of the DFT Trasform

texts:
Given a discrete signal $ \left\{ x[n] \right\}_{n=0}^{N-1} $ and its Discrete Fourier Transform $ X[k] = DFT \left\{ x[n] \right\}[k] $.

I'd like to effectively compute the norm of each sample of the DFT, namely  $ \left | X[k] \right | ^ {2} ,  k \in \left\{ 0, N-1 \right\}$ as opposed to the norm of the DFT series (Which equals the norm of the original series).

Could that be calculated without using complex multiplications (Since it's real)?
Namely, I'd like to not have to go through the calculation of the DFT and then calculate the norm of each sample.
What if $ x[n] $ is also a symmetric signal (Auto correlation for that matter), I assume then using the Cosine part makes it possible?

Thank You.


texts: How do I interpret the result of a Fourier Transform?

texts:
For example, I entered the following "equation" into Wolfram|Alpha:

FourierTransform[Piecewise[{{sin[t],t > 0 and t < 2*pi}}, 0], t, \[Omega]]

So as to take the Fourier Transform of a signal like this:

And turn it into some graphs that look like this:

My understanding from constantly — but casually! — hearing about Fourier Transforms (and DFT/FFT) in the context of audio processing and SDR I/Q data processing, is that I now have some information about a portion of the spectrum of the input signal. I'm trying to deepen my understanding, however, and refresh my memory of all I started learning in a Differential Equations class years ago.

Given my more recent practical background I'm left with the following questions understanding what the Fourier transform just did for me:

Why did I get a complex (real/imaginary) output from a real-only input? (How would I have passed some sort of "I/Q" equivalent in to the "equation" I provided?)
What units are omega, is it essentially Hertz if t is in seconds? What does negative Hertz mean?
If the input function were actually a voltage on a wire, would the real and imaginary parts be amplitude and phase (respectively) of the component frequencies?

From https://dsp.stackexchange.com/a/24758/18819, I gather that if I primarily care about power at a given frequency I would take the magnitude of the complex vector. From a Wikipedia article on negative frequency I'm not sure what its "wheel spinning backwards" analogy would mean in the context of e.g. electromagnetic or acoustic waves, but I'll take it to mean maybe it's just "some more of the signals" and combine the values across the y-axis.

So am I correct to interpret this as follows:

there is no power [correct term?] at 0Hz
at +0.5Hz and at +1Hz there is 1 unit (?) of "power" but
…at -0.5Hz there is also 1 unit of power
…while at -1Hz there is -1 unit of power
so at "real world" 0.5Hz there might be 2 units of power
but at "real world" 1Hz there might be 0 units of actual power?

Or what would be the best way to understand the first Fourier plot above, and derive relevant results from it?


texts: Direct IQ sampling symbol transition problem

texts:
In a direct sampling RF front-end, we can get real samples.
But when we sample the signal with two ADC with a sampling delay $ \frac{4n+1}{4fc}$ where $n$ can be $0,1,2 \dots$
Then we have In phase(I) and Quadrature phase(Q) samples outs of two ADC.
But there is a problem when we sample "I" before symbol transition and "Q" after transition.
This creates a mismatch in correlation with a known signal(local code).
As we increase the n value the probability of error samples becomes more.

Is there a way to predict the probability of happening?
How can I correct the error pairs?


texts: Difference Between Linear Convolution and Circular Convolution

texts:
If I understood correctly (and this page should confirm: http://www.cs.ioc.ee/~khoros2/linear/convolution-teo/front-page.html)

if I convolve linearly (the usual point-to-point multiplication and addition without tricks for each element of the image matrix) an image with a kernel I obtain RESULT1
if I calculate the DFT of the image and of the padded kernel (to have same size as the image) and perform their multiplication in frequency and then the inverse DFT, the result is RESULT2 and should be like applying the circular convolution in time space

RESULT1 slightly differs from RESULT2 as in the example

Is this correct?


texts:
Why does it mean that the process/signal is not stationary when its variance varied with time? that is,

$VAR[X(t)]= \alpha \times t$,$t$ is time,and $\alpha$ is a constant,then $X(t)$ is not the WSS process


texts: A filter in IOS to eliminate a certain frequency range

texts: I am making an application where I record sound on an IOS device using the built-in microphone. I want to process the sound in such a way that only frequencies in the 16-18 kHz range remain; the other frequencies should be eliminated. I read in some posting that I can use a band pass filter to get this result. Any help will be appreciated.


texts: Coefficients of a Zero Forcing linear equalizer for infinite length input

texts:
Given a discrete-time white noise model:
$$y_k = \sum_{i=0}^{\infty} \alpha^{-i}a_{k-i} + \eta_k$$
where $E(|a_k|^2)=2$, $|\alpha|>1$, $\eta_k$ are uncorrelated zero mean random variables with $E(|\eta_k|^2) = 2N_0$.

Find the Z-domain transfer function for this channel model.

Find the coefficients of a Zero Forcing linear equalizer for this system, that operates on the samples $y_k$ and removes all the intersymbol interference.

For what values of $\alpha$ the channel becomes free of intersymbol interference?

My attempt:

For part 1, $F(z) = z + \alpha^{-1}z^{-1} + \alpha^{-2}z^{-2} + \ldots$. However I don't know how to do the rest.


texts: generator matrix coefficient in convolutional code

texts:
I cant determine a type of the following code:
G_1=1   // g_1=1
G_2=11  // g_2=x+1

Accorsing to description, it is convolutional code but I dont understand the type ( code rate)?


texts: Converting Google's text-to-speech voice to, say, Justin Bieber's voice

texts:
We are trying to convert text to an artist's voice. For example, we want input text in Justin Bieber's voice. We are converting text to mp3 files in Python using gTTS (Google Text-to-Speech). We can then change the pitch or speed to some extent.

How can we convert gTTS's mp3 file to Justin Bieber's voice? Any pointers will be helpful. Thanks :)


texts: Echo effect on sinusoidal input: Intuition

texts:
I am currently reading about adding echo effects on signals. I was wondering if my understanding is correct.

In the attached figure, the blue line represents the original signal and the red line is the delayed original signal. Is it correct to add these two signals to represent the echo effect, resulting in the green line, assuming no attenuation?

I understand that an echo effect also attenuates the signal. However I just assumed that there is no attenuation for simplicity.


texts:
I have a time series of data with columns labeled Months and Rows labeled Years. So, my data looks as:

1900    -5     8    8    6    15   ......
1901    -3     8    8    6    15   ......
1902    -12    4    8    6    15   ......
1903    -34    1    8    6    15   ......
1904    -5     8    8    6    15   ......

The above data is just dummy and for illustration purpose only. My matrix is for period 1900 to 1950 hence the matrix size is 1950x12. The data is for flow in a river and hence there would be some correlation between flows of consecutive months.

I would like to predict data for year 1951 based on data from 1900 to 1950. What algorithm is best suggested for this purpose.

I can use Kalman Filter kind of method but that gives me only 1 step ahead forecast. I need to predict flow for 12 months. So, a Fourier analysis can be of use here as well.

Any other ideas ?


texts:
i have this open loop system , and i've been asked to find out the response $C(kT)$ due to a unit step input.

I am able to find the transfer function without the delay unit i.e $$\frac{C(z)}{R(z)}=\left(1-z^{-1}\right)\cdot \mathcal{Z}\left\{\frac{1}{s(s+a)}\right\}$$
i can find this ZT easily and find $C(kT)$

But how to deal with the exponential term i.e $e^{-s}$ ? then my pulse transfer function becomes
$$\frac{C(z)}{R(z)}=\left(1-z^{-1}\right)\cdot \mathcal{Z}\left\{\frac{e^{-s}}{s(s+a)}\right\}$$
Can i also consider it as a delay ? and take it out of the braces ? i.e
$$\frac{C(z)}{R(z)}=\left(1-z^{-1}\right)\cdot z^{-1} \cdot \mathcal{Z}\left\{\frac{1}{s(s+a)}\right\}$$


texts: Help with literature pointers for improving estimation of underlying mean for signal with periodic noise

texts:
I am in the starting phase of a master thesis and are having some trouble finding a good starting point in the literature for my thesis.
The aim of my thesis is to provide as good of an estimate as possible to an underlying constant signal, given measured data with periodic noise.
My degree is in informatics, with a specialization in machine learning, so I don’t have a strong background in signal processing.
The naïve approach is to just take the average of the measured data, it’s clear that the main issue with this approach, is the effect of incomplete wavelengths.
Of course if one could measure long series the periodic noise would average out, the goal of my thesis is rather to see how short it is possible to measure and still accurately estimate the underlying mean value.
A more sophisticated approach is to apply a filter before averaging the signal, but most filters are designed for this purpose so it is not clear which filters would be best suited.
Many filters does not alter the average at all, but what we need is to flatten out the waves such that the incomplete waves at the ends does not affect the signal.
One approach is tapering the edges of the signal, but we haven’t found any literature on that approach.
we will look into how to model the periodic noise as sine waves and then subtracting the periodic noise from the measured data. This approach works very well if you know the frequencies of the periodic noise but seems harder to do if little is known about the periodic noise.
I have looked a bit into using the autocovariance to sample the signal such that each wave top is accompanied by a wave bottom.
I had a bit of an unfounded hunch about Fourier analysis, but it seems our signal might not be of sufficient quality for this. In any case, I just need to find some literature tackling this problem, so I have some background on the solutions others have made before.
I would think this is a problem occurring with many different measurements, and that it would have been tackled by someone previously, but I seem to have a bit of trouble navigating the literature.


texts: I ran a number of simulations for symbol timing synchronization in the past. I used GNU Radio mainly. Now, I'm trying to do the same thing in C++. To achieve that, I need a way to introduce symbol offset to the symbols. So suppose I have a complex array of $M$ samples acquired at a sampling rate of $N$ samples per symbol. How do I introduce a symbol offset of say $\mu = 100 \ \rm ppm$ of the symbol time? Pseudocode, C++, or MATLAB script will suffice.


texts: What is the difference between Magnitude spectral subtraction and Power spectral subtraction in terms of performance?


texts: Speech recognition and comparison algorithms

texts:
I am doing several research for a prototype which I will be building. My prototype will consist of single word speech recognition and comparison with a preset recorded words. The prototyped system will then ask the user to say a the word and give a percentage match.

I am hoping to build this prototype with JAVA, however I am not at that stage yet, I am still researching all the available algorithms that exist in order to implement the above. I am seeking some guidance from you experts out there if I am on the right track in looking at the following algorithms to be able to implement the above:

Acoustic speech recognition
Hidden Markov Model algorithm
Discrete Fourier Transform
Fast Fourier Transform
The Cross-correlation Algorithm
The Auto-correlation Algorithm
The FIR Wiener Filter
Dynamic Time Warping algorithms
Mel Frequency Cepstral Coefficient

I am not sure if the above is wrong for my project and look into audio fingerprinting.

I am sorry I cannot provide any code for the time being I am still in the theory research part, If this question is not suitable to this forum please let me know so I can delete it and waste no one's time as it is not my intention.

P.S. Keep in mind that since this is only a prototype, moving forward I will research and eventually use any already existing algorithms (API's/Libraries in JAVA) so that is mostly why I am asking if I am on the right track. Many thanks for your help guys !


texts:
I am confused on how to solve this problem, does anyone have any ideas?
https://www.merl.com/publications/docs/TR2004-043.pdf
For a Haar filter $H \in \mathbb{R}^{3 \times 5}$ defined as below:
What is the equation to calculate the Haar features using integral image II?
In this problem an input images is $I \in \mathbb{R}^{m \times n}$ and integral image is denoted by $II\in \mathbb{R}^{m \times n}$
$H = \begin{bmatrix}
0 & -1 & -1 & 1 & 0\\
0 & -1 & -1 & 1 &0\\
0 & -1 & -1 & 1&0\\
\end{bmatrix}$


texts:
Given a complex,with fmin<0(say -10) and fmax>0(say 30) what is the bandwidth of this signal.Is it form fmin to fmax ,or 0 to fmax?
Thank you!


texts: If the impulse response of a causal LTIC system is $h(t) = \delta(t) + \sin(t)u(t)$, is it marginally stable or unstable (BIBO)?

texts: If you take the $H(s) = \mathcal{L}[h(t)]$ the poles are on the imaginary axis so the system should be marginally stable, but is it?


texts: Complex numbers in $\tt ifft$ of an MMSE amplitude estimator

texts:
I am trying to reconstruct a signal from a noisy speech using an MMSE algorithm proposed long time ago by Ephraim and Malah (1984). After going through the algorithm, I got a matrix A which represents the magnitude of the reconstructed signal. With the help of this group, I now know that I need to use this magnitude with the phase of the noisy signal in order to recover the signal. Now the problem is that after doing an ifft, I get complex numbers.

Does this mean there is a mistake in implementing the algorithm?
I read somewhere that I have to have symmetry in my input to an ifft function, how do I ensure such symmetry is applied here?

Here is my MATLAB command and the equation

A = A_hat.*exp(1i*nu);
x_new = ifft(A);

  \begin{align}
\hat A_k&=\Gamma\left(1.5\right)\frac{\sqrt{v_k}}{\gamma_k}M\left(-0.5;1;-v_k\right)R_k\\
&=\Gamma\left(1.5\right)\frac{\sqrt{v_k}}{\gamma_k}\exp\left(-\frac{v_k}{2}\right)\left[\left(1+v_k\right)I_0\left(\frac{v_k}{2}\right)+ v_k I_1\left(\frac{v_k}{2}\right)\right]R_k.\tag{7}
\end{align}


texts:
If I have the spectrum of a FM modulation, does the frequency of the carrier disappear when the modulation index is too big?
Does the amplitude of any side band depend from the modulation index?
And does the total number of side bands depend on the modulation
index?


texts: What is the smallest sampling points that can recover the signal?

texts:
Propose that we have a signal with a model of
$$
f_{4at0} = v_0(1 - \epsilon + \epsilon \exp(-c_l(t_{t2d}-t_0)))
$$

$f_{4at0}$ is dependent variable while $t_{t2d}$is independent variable,others are parameters.

It is a representation of the relationship of biological material concentration-time that is inside the blood serum.Since this material cannot be assayed real time in the human body, the blood samples have to be collected from patients.It's really inconvenient to obtain blood samples from human.So, my question is what's the lower limit of sampling points? And how to schedule the sampling points?

ps: here is the matlab code that I used .I want to use the "Nyquist Sampling Principle",but I don't know how.

cl=6.2;

epsilon=0.95;

t0=0.3625;

delta=0.1;

v0=1000000;

f4at0=v0*(1-epsilon+epsilon*exp(-cl*(tt2d-t0)));

syms tt2d;

f4=v0*(1-epsilon+epsilon*exp(-cl*(tt2d-t0)));

fourier(f4,tt2d)

Output:

  ans =

  100000*pi*dirac(-tt2d) + 950000*transform::fourier(exp((31*tt2d)/5 + 899/400), -tt2d, -tt2d)

I don't know how to understand transform::fourier(exp((31*tt2d)/5 + 899/400), -tt2d, -tt2d).

I don't know how to calculate T since there is also a Dirac function.
I don't know if there are other principles apart from the "Nyquist Sampling Principle" that can be used here.


texts: How do I differentiate between signals from an unknown program?

texts:
I believe this question is on topic for this site under Algorithm debugging questions, but if not, I would appreciate a suggestion about where to post this question.

I have been messing around with detecting a car key fob that was given to me from a room mate. This key fob goes to a broken car in a junk yard and he got it for free from there. I have managed to figure out how to sort out a car key signal from background noise by filtering based on the decibel level. I am very, very, new to signal processing and I want to learn more. The problem is, I cannot figure out how to make my program tell the difference between button presses and and different car keys.

I have written this program in Python 3 and I use a RTL SDR to detect the key fob. The key, while it is supposed to operate on 315 MHz, it appears to operate on 314,873 MHz. I figured this much out using Gqrx. The Key Fob is a Ford 2S4T-15K601-AA.

I hear some keys use rolling codes and I do not know if this key does. I am not interested in actually cracking any cryptography on this key unless it is necessary to detect which key buttons are pressed.

How would I differentiate between key presses and key fobs?

This is an example of the program receiving the lock button being pressed.

➜  remote git:(master) python3 remote.py
Devices: ['00000001']
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!

Wanted Frequency: 315000000.0 Hz! Actual Frequency: 314873000.0 Hz!
Offset: -127000 and Squelch: -10.0

Signal!!! Decibel: -4.172264183610216
Signal: [1]
Signal!!! Decibel: -7.696191692271029
Signal: [1, 1]
Signal!!! Decibel: -3.3640835791737893
Signal: [1, 1, 1]
Signal!!! Decibel: -4.760667362463348
Signal: [1, 1, 1, 1]
Signal!!! Decibel: -7.167746085106671
Signal: [1, 1, 1, 1, 1]
Signal!!! Decibel: -3.007769020399573
Signal: [1, 1, 1, 1, 1, 1]


texts: MATLAB fvtool: Setting the passband ripple below 0dB for a FIR Filter

texts: I'm new to using filter tools in MATLAB and I'm having a bit of difficulty. I'm designing a lowpass FIR filter and I'm trying to keep the passband ripple below 0dB in the magnitude response. So far, the passband ripple travels up above 0dB the same amount that it travels below. Any ideas on how to accomplish this using fvtool? I've been reading up on fvtool all day and I still can't figure it out. Thanks in advance for your help. Also, I apologize for this being so wordy for such a simple questions.


texts:
I have a program that detects events in a large amount of measurement data. When it detects an event, it writes a timestamp. I have thousands of event timestamps. What I wish to do is detect if there is periodicity in the timestamps I have.

Pictures may aid my explanation: If I have a bunch of events on a timeline, as in the figure below, the events all seem to be random but there may be some kind of periodic component to the events.

What I wish to do is detect if any of the seemingly random events are following a strict repeating interval. An illustration is given below, where we see that in the seemingly random events above there are some data points that are repeating with a fixed frequency.

I am not certain what kind of method to apply. I have looked into power spectral density, fourier transform and ARIMA. I applied fourier transform (as in the answer here) but was not able to make anything meaningful out of it.

Properties of the applied method should possibly include:

A quantitative measure of how strict or fixed the intervals are, or how
certain we can be that we have detected a fixed cycle
The ability to detect periodicity on different timescales (e.g. events occurring multiple times within the same hour or multiple times during a week with a fixed pattern)

Anyone has suggestions how this could be done?


texts: Rotation and translation from Fundamental Matrix

texts:
I understand how to extract rotation and translation from the essential matrix.
However, I did not find anything about obtaining the rotation, translation, (and also the calibration matrix) from the fundamental matrix.
Can someone explain to me how to do that?
So given $E =  [t_x] R,$ I know how to extract $[t_x]$ and $R$. But this is in normalized coordinates.
But  from my measured image points I have $F = (K_{2}^{-1})^{T} E K_{1}^{-1}$. So I how to handle the calibration matrices, if $K_{1}$ and $ K_{2}$ is unknown.


texts: Autocorrelation function and correlation integral

texts:
I am confused by the definition of autocorrelation function. It is originally defined as the expected value
$$R_{XX}(\tau) = E[(X(t)X(t+\tau)] = \langle X(t)X(t+\tau)\rangle\tag{1}$$
where $\langle\cdot\rangle$ is the ensemble average, and suppose they are all real signals. However, I see another definition defined by the correlation integral (e.g., see Autocorrelation - Wiki), which reads
$$R_{XX}(\tau) = \int_{-\infty}^\infty X(t)X(t+\tau)dt \tag{2}$$
Under assumption of ergodicity, Eq.(1) can be approximated by temporal averaging, i.e.,
$$R_{XX}(\tau) = \lim_{T\to\infty}\frac{1}{2T}\int_{-T}^TX(t)X(t+\tau)dt\tag{3}$$
But I don't see how Eq.(3) turning into Eq.(2), or how Eq.(2) being equivalent to Eq.(1).

So am I misunderstanding or missing anything here, or the one defined by correlation integral is another version of "autocorrelation"?

Any hints would be helpful!

Thanks!

EDIT: Another question is, for Eq.(2), if one sets $\tau=0$, the result is expected to be the variance (or "energy") of the signal. However, if we start from Eq.(2),
$$R_{XX}(0) = \lim_{T\to\infty}\frac{1}{2T}\int_{-T}^T X^2(t)dt$$
For any signal in $\mathcal{L}^2$ space (which has finite energy), the integral will be finite, but as $T\to\infty$, $R_{XX}(0)\to0$; that's not physical. Where did I go wrong?


texts: When and how does one use a Wiener filter?

texts:
I'm trying to get some insight in this topic. As far as I understand, a determined signal enters a Wiener filter and the output is an estimate of some desired signal. Then, one can substract the desired signal to the output of the filter and calculate the estimation error. This diagram would represent what I just described above, where $x(n) = \hat{s}(n)$, the estimate of the desired signal $s(n)$, and $w(n)$ is some signal that has some correlation with $s(n)$:

I don't understand why I would try to estimate $s(n)$ if I already have it (I wouldn't be able to calculate the error $e(n)$ if I didn't have the desired signal).

The next diagram makes a bit more sense to me:

It would be a standard noise-reduction filter. A noisy signal comes in, a less-noisy one comes out.

There is a third case I found:

Here, one estimates the noise $v(n)$ to subtract it from a noisy signal $s(n)+v(n)$ and get a cleaner version of it, $\hat{s}(n)$. In this case, I have the same question as in the first one: why would I estimate the noise to subtract it from $s(n)+v(n)$ if I already have to know what the noise signal is in order to put it at the input of the filter?

So, in summary, I want to know if all of these cases are of use, and if they are equivalent in some sense. Also, I want to understand why they always estimate a signal that is already known, or if they don't do that and I'm not thinking correctly.


texts:
how do people combine different information (e.g., RGB and depth image or RGB and thermal image) to make their object detection algorithms better?

If the single modality images A and B are perfectly registered, I can think of:

Write one object detector working on A, write one working on B and then write one regressor that takes the outputs from A and B and learns a final output.
Instead of working with feature vector f to describe a certain region (e.g. a bounding box) in the image A one could learn a prediction model based on a feature vector F = [f;g] where g is the corresponding feature for image B.

These approaches do not make as much sense if the images are not nicely registered, but there is a certain amount of misalignment.

So again: how do people combine different modalities for object detection and in particular deal with misregistration?


texts: How to reduce time consuming for calculating pseudo inverse of large matrix in matlab?

texts:
I have a matrix

P = randn(45875x65536 );
Pi = pinv (P);

I tried to run this code in matlab, but it takes long time

is it possible to split the matrix into smaller matrices then calculate the pseudo inverse?

any suggestion to reduce the time ?


texts: Encoding YUV Color Space with Positive Numbers

texts:
I got 2 hdr rgb textures/signals. When fetched one gets bicubicly interpolated and the other bilinearly. So I was thinking I can store as YUV and store Y from each texture in the bicubic one and the distribution of the rest of the channels are not as important.

Well another restriction is that the hdr output only accept pos float values.

So what I'm wondering are there some other colour space transform similar to standard YUV but which range is positive only?

Thanks!


texts: how to set Equalizer's coefficient using generalized eigenvector.

texts:
In that paper https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/1687-1499-2012-72 .. Equation 3,

$J(w) = w^HBw/w^HCw$ ..

$B$ and $C$ are matrices, $w$ the filter coefficients vector we need to design.

The author is supposed to maximize that cost function $J(w)$. So, he used the generalized eigenvalue decomposition of the two equations $(B,C)$ then he set the eigenvector correspondent to maximum eigenvalue as equalizer filter $w$.

My question, Is my understanding for that idea correct? I mean we can use generalized eigenvalue decomposition for that purpose maximize/minimize, which means if set  setting the eigenvector correspondent to maximum eigenvalue as equalizer filter $w$ will maximize, and setting the eigenvector correspondent to minimum eigenvalue as equalizer filter $w$ will minimize.

thank you.


texts: Does orthogonal beamforming mean $\mathbf f_a \cdot \mathbf f_b =0$?

texts:
If i said that these two beamformings $\mathbf f_a $ and $ \mathbf  f_b $ are orthogonal to each other,does it mean $\mathbf  f_a \cdot \mathbf f_b \approx 0$ ?

Because i have see two paper about orthogonal beamforming,but they both doesn't mention this relation.i just want to make sure about that


texts: what are the Pros and Cons of ESPRIT and MUSIC algorythms?

texts:
On wikipedia there are only 2 lines about ESPRIT: Estimation of signal parameters via rotational invariant techniques (ESPRIT)... MUSIC doesnt have an entry in the music disambiguation page, other than something for neural networks.

I have read that they are more advanced than FFT. What are their advantages and disadvantages?


texts:
I'm making a Laser Harp.
The application needs the position of the hand along each of the laser beams to modulate a sound synthesis or modify the properties of a sampled instrument.
I'm wondering if doing a Color Tracking with OpenCV will do.

Make the beam visible with fog machine.
Segmenting the image for each beam.
Measure the height of the beam.
PROFIT.

Other way can be using an infra-red light sensor like Infusion Systems - ReachClose v3.1
What method is more accurate and fail-proof?
Any other ideas?
Diagram3


texts:
With a 1/2-rate convolutional encoder, $n$ bits are encoded into $2n$ symbols.

Assume we have a long encoded stream such as $[... s_0, s_1,  s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, ..., s_{100}, ...]$. I want to extract a small portion from the middle of it, and decode it.

Starting from the symbol $s_1$, the data is decoded as follows:

$[s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, ..., s_{100}]$ ---Viterbi Decoder---> $[b_1, b_2, b_3, b_4, ..., b_{50}]$

What happens if we start from $s_2$?

$[s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, ..., s_{100}]$ ---Viterbi Decoder---> $[b_1', b_2', b_3', b_4', ..., b_{49}']$

Using Matlab's vitdec, starting from $s_1$ or $s_3$ produces the same result where the only difference is that $s_3$ starts from the second bit. But starting from $s_2$ produces a totally different vector, there is no small pattern in common between this and the results obtained when starting from $s_1$ or $s_3$.

Is this the expected result? Do we have to do symbol alignment to get correct results? Since the preamble in the data is encoded too, I do not know where to start decoding.


texts:
I want to calculate the SINR term in an up-link of wireless communication system but there is different models for simulation. I want to know what is the exact meaning of $|h|^2$ in this formula:

$\text{SINR} = \frac{p|h|^2}{\text{Interference+Noise}}$

Is this a Rayleigh fading envelop? If yes, what about path loss? Isn't any difference between near and far users? How can I simulate the channel gains correctly?
Thanks


texts:
I am trying to remove low frequencies from a signal and intuitively I chose the high-pass filter, more specifically - a Butterworth filter, Order 4 (because I am not sure how to choose properly the order and 4 seemed as a good choice) and cutoff frequency of 50 Hz. The problem is, that the filter removes the low frequencies, however, the peaks that were caused from those low frequencies are still to be seen.

I have read also about adaptive filtering, but according to the literature, I need a reference signal, which would be used as a desired signal. I tried implementing an adaptive RLS/LMS filter and as a reference signal, I processed my data with a low-pass filter - Butterworth, 4th Order, 50 Hz for the cutoff frequency. This method also did not get me far.

I have provided a a copy of my data, which is sampled at 1500 Hz.


texts:
$x[n]=\sin(\pi n)$

Since this is a discrete signal, and n can take only values like ...,1,2,3 ... the value of the power is getting zero, and since it gets zero does it mean that it's not a power signal?


texts: Histogram matching (specification) in Python

texts:
I'm trying to implement an algorithm in which I first pad each row of the image with a fixed amount of new pixels in a certain range, apply Gaussian smoothing to the row cumulative histograms in vertical (y) direction, and thus obtain new cumulative histograms for each row in the end.

After having obtained the new row cumulative histograms, my task is to get back/restore an intensity image from the cumulative histograms. Specifically, I would like to match each row histogram to the new, corresponding row histogram (to those which I obtained after padding and Gaussian filtering). Therefore, if there are, for example, 1000 rows in an image I will match 1000 row histograms and restore the original image.

My code in Python is below, where I came until the step where I need to perform histogram matching but I got stuck there:

import cv2
import numpy as np
import scipy.ndimage as ndi
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d

# Threshold of intensity values for padding
T = 200
img = cv2.imread('images/flicker1.jpg',0)
rows,cols = img.shape
# Number of pixels to pad each bin of a row histogram
N = 30
########################################################################
cdf_hist_Padded = np.zeros((rows,256))
cdf_hist_noPad = np.zeros((rows,256))
for i in range(0,rows):
    # Read one row
    img_row = img[i,]
    # Calculate the row histogram (without padding)
    hist_row_noPad = cv2.calcHist([img_row],[0],None,[256],[0,256])
    # Calculate the cumulative row histogram (without padding)
    cdf_hist_row_noPad = hist_row_noPad.cumsum()
    cdf_hist_noPad[i,:] = cdf_hist_row_noPad
    # Copy the row to prepare for padding
    hist_row_Padded = np.copy(hist_row_noPad)
    # Apply uniform padding to all the bins less than T
    hist_row_Padded[0:T] = hist_row_Padded[0:T] + N
    # Calculate the cumulative row histogram of the padded row
    cdf_hist_row_Padded = hist_row_Padded.cumsum()
    # Accumulate the cumulative histograms of padded rows in a matrix
    cdf_hist_Padded[i,:] = cdf_hist_row_Padded

# Apply 1D-Gaussian filtering on the padded cumulative histogram along the columns
Gauss_cdf = ndi.gaussian_filter1d(cdf_hist_Padded, sigma=2, axis=0, output=np.float64, mode='nearest')

# Normalize all the CDFs to get values between [0,1]
norm_cdf_hist_noPad = cdf_hist_noPad/cdf_hist_noPad.max()
norm_cdf_hist_Padded = cdf_hist_Padded/cdf_hist_Padded.max()
norm_Gauss_cdf = Gauss_cdf/Gauss_cdf.max()

# Take the first original and padded+smoothed row cumulative histogram
H_zero = norm_cdf_hist_noPad[0,:]
H_hat_zero = norm_Gauss_cdf[0,:]

# I would like to match now 'H_zero' and 'H_hat_zero'. When I find how to do that,
# I  will apply this to all rows in a loop. How do I perform the matching?..


texts:
I know that $\text{dB}$ actually represents dimensionless value, meaning, it is the ratio of two values that have the same dimension, for example:

$$p_1=10\log\frac{P_1}{P_0} $$

This can be expressed in decibels if $P_0=1\text{ W}$, however, if $P_0=1\text{ mW}$ then unit we use is $\text{dBm}$.

I am wondering, are we allowed to subtract and add values if one of them is in $\text{dB}$ and another is $\text{dBm}$ ?

The reason i am asking this is because i've found an example in one workbook where two values are summed up where the first one was in $\text{dB}$ and another $\text{dBm}$, however, i don't understand how's that possible.

For example, if we say $p_1=10\text{ dB}$ and $p_2=20\text{ dBm}$ if we sum these two up, we end up with $30$ but how is this possible? It's $30$ what? $\text{dB}$ or $\text{dBm}$? I hope someone could clarify me this. Any help appreciated!


texts:
I've been trying to model some radio signal properties of wireless networks wrt its usefulness. For example, most WiFi network adapters would decrease their transmission rate if the overall quality of the signal is bad so as to avoid re-transmission, errors, etc.

What is the relationship of the received signal strength (measured in dBm) and the signal-to-noise ratio (SNR) wrt the overall signal quality? Ideally, I am looking for an equation or paper reference.

Thanks!


texts: Intersymbol Interference -- Root raised cosine filter redundant if doing impulse response equalization?

texts:
I'm implementing DBPSK (differential binary phase-shift keying) over audio (44.1kHz sample-rate) using software.  Eventually I'll use multiple audio frequencies at once, so I'm using FFTs and inverse FFTs.

As expected, as the window size (symbol length) gets smaller, ISI becomes more and more of a problem and the BER (bit error rate) increases.

It seems like using RRC (root-raised cosine) filters is an established way to reduce ISI.

If as part of my data transmission I send out a special known signal that can be detected, then presumably I can determine the impulse response of the channel and apply an inverse transformation to re-construct (ignoring noise) the original signal without multi-path distortion.  Why is RRC useful if this transformation can be done?


texts: 2D convolution of image with filter as successive 1D convolutions

texts:
I want to prove (or more precisely experiment with) the idea that a 2D convoltion as produced by the Matlab conv2() function between an image I (2D matrix) and a kernel (smaller 2D matrix) can be implemented as some 1D conv i.e. the Matlab conv() function and NOT conv2(). Of course possibly some reshapes and matrix multiply might be needed but no conv2().

And to make it clear, I am NOT refering to that kind if thing:

s1=[1,0,-1]'
s2=[1 2 1]
diff=conv2(x,y)-conv2(conv2(x,s1),s2)

diff is = 0 everywhere

Rather, I want to do something like

conv(conv(x(:), filter1)filter2) ...


texts: How to identify useful elements of audio recording and ignore lulls?

texts:
I assume this is a relatively simple DSP task, but I'm having trouble finding any information on how to approach my problem.  Hopefully someone with more experience and brain power can help me out:

I have many (thousands) audio records of bird calls.  I am looking for a technique that will identify the timestamps within each audio file during which the bird is chirping.  Here's an example of a high quality audio file:

Ultimately, I wish to export a table of the frequencies created by the bird in each file, for further analysis.  I've already created a Python program that will allow me to manually select data points of interest, but I'd like to automate the process.

The simplest process I can think of would be to set a minimum power threshold for data points of interest, but the audio files have varying degrees of background noise.  Some of the audio files may be unusable due to background noise, which is fine, but they need to be flagged as such.

So the two questions are:
1) How to identify low-quality audio files
2) How to identify the useful sections of high-quality audio files

Thanks!


texts: How are line pairs and pixels related in image resolution?

texts:
I hope this is the correct place to ask this. If not, please refer me to a better place, thanks. Now to my question,

I am learning about digital image processing, and the book I am reading is discussing spatial resolution. They discuss spatial resolution in terms of line pairs. They talk about constructing a chart with pairs of dark and light lines, and how the width of a line pair is the width of a light and dark line. This is all of the information the book gives about line pairs, and I don't really understand what role these play in digital image formation and resolution.

What does a line pair actually correspond to or respresent in the context of image formation, specifically in a camera? There is a question in my book about how many line pairs/mm a camera will be able to resolve when taking an image of a subject. It gives the size of the CCD in the camera, as well as how many elements there are vertically and horizontally in the CCD. What does line pairs/mm of the CCD mean? Is this something like the number of pixels that will be resolved per CCD element? It just isn't clear to me how line pairs are realized in the camera.

I hope this question makes sense. I am a CS student so don't do much of anything with signal processing, but I would like to have a better understanding of how images are formed with respect to their spatial resolution capabilities.


texts:
I don't have an idea how to start it. Help pls :)

$$m = z(t) + \frac{\operatorname{Sa}(t-T)}{4}$$

We have some signal $z(t)=\left(\operatorname{Sa}(\frac{t}{T})\right)^2$. How often the m signal should be sampled to be sure of correct signal reconstruction


texts:
I feel like it is a very silly question so I feel ashamed to ask my professor. So i would appreciate it if anybody would help me understand this:

We know that $x(n-a)$ shifts the function $x(n)$ to the right side of $x$ axis by $a$ units.
In aliasing , $x(n+rN)$ is the representation of $x(n)$ shifted to the right by multiples of $N$.

Aren't these two contracting because acc to time shifting $x(n+N)$ should shift the signal by $N$ to the left.


texts: The best method to convert piano sound to music notes in real time

texts: I was looking for a way to convert piano sounds to piano notes for my research. I discovered the conversion of piano sound to piano notes using FFT and piano note recognition using CQT. I am also a beginner in signal processing. Can someone suggest me a method for converting piano sounds into piano notes?


texts:
I’m in the process of making a convolution reverb and I’m trying to add an envelope to my impulse response signal and plot it in order to change the RT60 of my sound signal (Just a song). I’ve looked at the documentation on adding an envelope, but it doesn’t mention how to use the envelope for a signal that being sampled. The code is shown below.

I just want to know how I can add an envelope to my sound signal and adjust it so I can make the envelope bigger/smaller.

[im,Fsim]=audioread('foobar.wav');

[up,lo]=envelope(im,10)

plot(im)

title('IR')
xlabel('Time(s)')
ylabel('Amplitude')


texts: Under what conditions do the phase margin and Nyquist criteria give the same results?

texts:
When designing feedback systems, I often evaluate stability by thinking about phase margin: the closed loop system $$T(s) = \frac{L(s)}{1+L(s)}$$ is stable if $L(s)$ has positive phase margin, i.e.,
$$\angle L(j\omega) > -\pi/2$$ at all frequencies for which $$|L(j\omega)|>1$$. This is easy to visualize graphically using a Bode plot.

But for some systems -- typically involving right-half-plane poles and/or zeros in $L(s)$ -- this criterion doesn't work and we need to use the Nyquist criterion to check stability. That is, the number of unstable closed-loop poles is equal to the number of encirclements of $-1+j0$ by the polar plot of $L(s)$ when $s$ is evaluated along an appropriate contour. My understanding is that this Nyquist criterion is more general, and the "positive phase margin" rule is a simplification that only applies in certain cases.

I'm looking for a criterion that will let me decide when these two criteria (positive phase margin and the Nyquist test) will give me the same results. I suspect that it involves right-half-plane poles and/or zeros in $L(s)$, but I'm not sure.


texts: Is calculus background a must for learn DSP?

texts: I'm beginner in DSP and in the literature some Authors suggest Analog (Continuous) Signal Processing a prerequisite for learn DSP. But it demands calculus background, that I do not have. Is calculus and ASP background a must for learn DSP?


texts: Does a filter add oscillations to a signal?

texts:
this is a more general version of a question which i asked previously.

From what I understand, the purpose of a filter is to change the amplitude of a specific frequency band.

As I went through the analytic calculation of a filtered (2nd order) signal I observed that the output signal contains an oscillating component (a sinusoid, with the frequency being the imaginary part of the complex conjugate pole pair).

A complex pole (in the left half plane) does correspond to a damped oscillation. I really cannot understand how the addition of a specific frequency to the signal conforms with the job of a filter. Thanks for your insights!

EDIT:

The filter I am considering is a second order low pass Bessel Filter. The input signal is an exponential decay. I tried to calculate the output signal and observed there was a exponentially decaying cosine involved with its frequency being the imaginary part of the two poles. It really surprised me since I did not expect an oscillation in a filtered signal, which it did not express before.

I do understand, that this sinusoid was present in the signal already before filtering, it just struck me that it appears in the filtered signal as a single term.


texts: Implementing a phase-neutral band-pass filter using SciPy

texts:
Does the following code properly implement a phase-neutral band-pass filter using SciPy?

freq_fraction = FREQ / (SAMPLE_RATE/2)
sharpness = 0.1
filter_length=128
fir = sig.firwin(filter_length, [freq_fraction*(1-sharpness),freq_fraction*(1+sharpness)], pass_zero=False )
filtered = sig.lfilter( fir, 1, data_to_filter )
filtered = sig.lfilter( fir, 1,filtered[::-1] )[::-1]

The code is based on the answer to:

Is it correct to subtract a low-pass filtered signal from the original signal and use the result as a "high-pass"?

which doesn't give a final code listing for how to maintain phase neutrality.  I'm assuming it's just a matter of running the filter forward and backwards but want to double-check.

Also, if there are better/different ways of doing this (other than the remez and firwin2 methods listed in the other question) I'd love to know.


texts: Frequency response given poles and zeros

texts:
I'm trying to plot the frequency response $H(z)$ of given zeros/poles using the following code in MATLAB:

z=[0.36545+0.88446i; 0.01-0.1057i;]
p=[-0.46016+0.87251i; -0.37649-0.94861i;]
[num, den]=zp2tf(z,p,K)
[h,w]=freqz(num,den)
plot(w,abs(h))

But it appears it doesn't work correctly when the coefficients of the transfer function $H(z)$ are complex. And it gives a different response compared to the expected response.

This is the expected transfer function:
    $$H(z)=\frac{1+(-1.3745-0.77689i)z^{-1}+(0.46331+0.85406i)z^{-2}}{1+       (0.83665-0.023904i)z^{-1}+(0.91366+0.061999i)z^{-2}}$$


texts:
What does the graph of the function $x(t)=-\delta(t)+u(t)$ look like?
$$\delta(t)\ldots\text{ Dirac delta impulse}\\
u(t)\ldots\text{unit     step function}$$

Will the impulse at the origin start from 0 downwards or from 1?
I'm having trouble because the unit step is discontinuous at t=0, so I don't know how it will shift the impulse.
I am talking about continuous time.


texts: Is signal processing used in block matching algorithms

texts:
I'm working on a custom video codec which uses the standard mean squared error to find blocks.

As explained by this youtube video you choose a search area size to find a block in. Each pixel of the search area is turned into a block, and then the search block is compared to the master block.

These difference for each pixel are multiplied by themselves and added up for the entire block, and you get the total mean squared error. If the error is within a threshold you "found" the block. If the error is too high you need to do some more compression work.

So I implemented this mean squared algorithm, but there are certain videos I'm not finding blocks very well with.

For example this test I put together, of a 3d camera pan across a desk, (warning the test is 5.4MB and will take a while to load, once it does load you can play the video by "scrolling" the page).

Using a reference frame every 4 frames I was only able to find roughly 50% of the blocks using a 16x16 block size, 65% using an 8x8 block size, and 77% using a 4x4 block size.

I don't get it as the animation is very simple and beside a small shift in 3d perspective the blocks are just moving along a single vector.

This makes the file size HUGE for such a simple video. Right now it's clocking in at 5.8 MB for 64 frames. This is why it takes so long to download.

Are there other methods based on signal processing which modern video codecs use to find blocks? Like comparing the dct coefficents of each block to reduce noise errors?

On a side note the low quality of the video is not from the codec (mostly), but it's because I did a low quality render from my 3d program. Over the weekend I plan to do a full quality render.

Edit, one thing I've thought of is to test if the block is getting brighter/darker due to lighting conditions. If it's getting brighter every pixel error will be offset by how much brighter the light got. This offset can be stored and used to bring the overall error of the block back down to tolerable numbers.

I'm just wondering if this is normally done or if there are better methods to tackle this problem.


texts: Impulse Response Function-Green's Function

texts:
Assuming a input-output system
$$u(t) = c \cdot \big(h(t)\circledast m(t) \big)$$

where its impulse response function is:

$$
h(t) =
     \begin{cases}
       \frac{A}{\tau}te^{-\frac{t}{\tau}}, &\quad t\geq0 \\
       0, &\quad t<0 \\
     \end{cases}
$$

Given only these, how can one derive the differential equation below, whose Green's function is the above?:

$$
\ddot{u}(t)+\frac{2}{\tau}\dot{u}(t)+\frac{1}{\tau^2}u(t) = \frac{A}{\tau}m(t)
$$

Would, considering an inverse n-order L differential operator and performing the consequent integrals, be a possible way?


texts: Motion Artifact Cancellation from ECG Signal Using 3 Axis Accelerometer Data

texts:
I have a ECG signal measured as a test subject is performing 3 different activities - sitting, walking(2mph) and jogging(5mph) and also the corresponding 3-axis accelerometer(X,Y and Z) signals. I can visually observe correlation between the amplitude of accelerometer signal and noise in the ECG signal for the 3 activities. The following are my questions,

How to decide on which axis of accelerometer data to use as noise feed to an adaptive LMS filter? Or should a combination of all 3 axes data be considered and if so, how?
Does the accelerometer data have to be normalized to the amplitude range of the ECG signal for effective performance of LMS filter?
What are the suggested parameters for the LMS filter for this case(The available literature is not clear on this problem).
For implementation in a embedded platform, is RL, LMS or NLMS suggested?


texts: Why the number of poles and zeros for a RHS signal in the Z domain is equal?

texts:
I can not understand the reason why the following sentence is true:

  If we have a Right-Hand signal(RHS) x(n), X(z), the Z-transform of x(n), has the same number of poles and zeros except at z = infinity

can any one explain why!?


texts: I am taking computer vision course, where I learned about Sobel operator for detecting edges. I somewhat understand how it works as described here. But I have a basic confusion. The operator can be divided along $x$ and $y$ axis (as $G_x$ and $G_y$). But these divided operators are finding derivative along one direction, then why are they 2-dimensional?


texts:
Is there a good, documented open source implementation of spectral subtraction in Python?

I've searched a lot but I've only come across pieces of code where I can't really understand what's going on as they are undocumented. For example. Can someone either point me to some implementation or explain step by step what is happening in the above link or here for example.


texts: How to calculate Long Term Average Spectrum of an audio file?

texts: I'm working with audio files and I have to find their long term average spectrum. Although I had an option available in the software Praat but I don't understand the algorithm of finding the spectrum. I need to understand it so I know the actual working and also implement it through MATLAB!


texts: Pulse shaping with root-raised cosine filter for a non-Gaussian channel

texts:
I am here to check whether my line of thinking is correct.

Root-raised cosine (RRC) filtering is one way to minimize intersymbol interference (ISI). Hence, we apply matched RRC filters on both sides of the communication link.
We can adjust the roll-off factor $\beta \in \left(0,1\right]$ to trade-off the bandwidth (BW) for a better signal quality at the receiver. The borderline cases of $\beta$ are $\beta=0.01$ and $\beta=1$, where we "sacrifice" 0.01 BW and 0.5 BW, respectively.
Now, this is usually when the impulse response function of a channel is assumed to have a normal distribution (or similar-ish). In other words, the noise is linear (i.e., AWGN)
If this is no longer the case and the impulse response of the channel does not follow normal distribution, would RRC still be a viable solution? - I guess not but please correct me if I am wrong.


texts: understanding a signal from its mathematical formula

texts:
I can understand from unit step function in the end of the equation that $n=[3 \quad4]$, but I cannot understand how delta function affects the signal in order to solve it and put it on matlab.

Answer:


texts:
I have a periodic signal and I want to find it's autocorrelation function.
I can calculate it exactly:

$$R_{uu}(h) = \frac 1M \sum_{k=0}^{M-1} u(k)\cdot u(k-h)$$

But will xcorr() use this function for periodic signals?

BTW, I've created my own function for periodic signals:

function [R h] = intcor(u,y)
%Calculates the correlation between two vectors u, y
M=length(u);
h=0:1:M-1;
R=zeros(M,1);
for i=1:M
   for k=1:M
     if k-h(i) <= 0
     R(i)=R(i)+u(k)*y(k-h(i)+M); %since periodic, add M -> gets same result
   else
     R(i)=R(i)+u(k)*y(k-h(i));
   end
end
R(i)=R(i)/M;
end
end


texts:
Given is this Wiener filter:

From this we take \begin{equation}
x[k]-a x[k-1]=v[k]
\end{equation}

$v(k)$ is assumed to be a white gaussian noise.

In the textbook it is then stated that

  The input $v[k]$ at time $k$ and the output $x[k − 1]$ at time $k − 1$ are statistically independent. Thus, $E\{v[k]x[k − 1]\} = 0$.

My intuition tells me thats wrong. The equation above can also be written as
\begin{equation}
x[k-1]=\frac{v[k]-x[k]}{-a}
\end{equation}

in which I see that $x[k-1]$ depends on $v[k]$ and is therefor not independent of it.

Where is the mistake in my thoughts? I guess I look at it the wrong way. I'd like to build a better intuition for problems like this. They always mention it so easily in these textbooks, and I need hours to verify everything.


texts: why GMSK use a gaussian filter instead of raised cosine filter?

texts: I'm wondering why GMSK use a gaussian filter instead of raised cosine filter as a pulse shaping filter? Is there special reason?


texts:
If I want to add 3dB per octave to signal (e.g. to flatten out the power spectrum of an exponential sine sweep), is it really just as simple as...

Take the Fourier transform of the time-domain signal, let's call this A(f).
Multiply this by the square root of the frequency  (square root because power goes like amplitude squared)?
Maybe normalize by the lowest frequency, so that there's unity gain for that frequency.
Take the inverse Fourier transform to get back to the time domain.

Mathematically, the filter would be, simply,...

A'(f) := A(f) * sqrt ( f / f_low )

Is this right, and/or is there a better way?
(I've searched around and...it seems this is such a simple matter that people don't post how to do this.)


texts: In the context of transfer functions, what is the relationship between the terms "proper", "causal", and "realizable"?

texts:
I am thinking about these terms in the context of linear control.

A transfer function is proper if the degree of the numerator is not greater than the degree of the denominator. I've read often that improper transfer functions are "not causal". I also often see the word "unrealizable" used often in this context.

If a control transfer function I've designed is improper, does that mean it is "causal" and/or "unrealizable"? What is the difference between these terms? What do they mean in practice?


texts: Convolution to do FIR with initial and final conditions!

texts:
I need to apply an FIR filter on chunks of very long signals. I can use MATLAB's filter function as follows to preserve the state of the filter when a new chunk of data is available:

[y, state] = filter(b, 1, x, state);

where b includes the coefficients of my FIR filter. However, b is fairly long and even each chunk of data is long and it appears to me that conv performs much faster than filter for this case. The following is a simple benchmark to compare the execution time for these two functions:

xin = rand(1, 1e6);
b = rand(1, 20e3);
tic; y = filter(b, 1, xin); toc
Elapsed time is 9.533244 seconds.

tic; y = conv(b, xin); toc
Elapsed time is 0.634058 seconds.

Unfortunately I can't preserve the state of my filter using conv function. I already tried to overlap the chunks of data and mimic the "state" for the convolution but haven't been successful yet. All suggestions and advice are greatly appreciated!


texts: C++ based FIR filter design using GNU Octave remez function

texts:
I am designing a system where I want a FIR filter coefficient generator feature.
I try the remez.cc source file provided in the Octave Signal package.

The source code for remez.cc is here. I have removed the octave interface part (line 757 - end) and the library header (line 34) and created a simple header with only remez function at line 592 then compiled the source code into a static library.

#pragma once
// remez.h
/********************
* remez
*=======
* Calculates the optimal (in the Chebyshev/minimax sense)
* FIR filter impulse response given a set of band edges,
* the desired response on those bands, and the weight given to
* the error in those bands.
*
* INPUT:
* ------
* int     numtaps     - Number of filter coefficients
* int     numband     - Number of bands in filter specification
* double  bands[]     - User-specified band edges [2 * numband]
* double  des[]       - User-specified band responses [numband]
* double  weight[]    - User-specified error weights [numband]
* int     type        - Type of filter
*
* OUTPUT:
* -------
* double h[]      - Impulse response of final filter [numtaps]
* returns         - true on success, false on failure to converge
********************/
int remez(double h[], int numtaps,
          int numband, const double bands[],
          const double des[], const double weight[],
          int type, int griddensity);

Then I followed an Octave example for filter design and implemented a C++ main function for experimenting how to call the remez function. Here is my main function.

#include <remez.h>
#include <cmath>
#include <vector>
#include <iostream>

using namespace std;

int main()
{
    int numtaps = 52;
    vector<double> h(numtaps);
    vector<double> bands = { 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 };
    int numbands = bands.size() / 2;
    vector<double> des = { 1, 1, 0, 0, 0.5, 0.5, 0, 0, 1, 1 };  // designed response for each band

    double ripple1 = 1 - pow(10, -0.3 / 20);
    double att2 = pow(10, -60 / 20);
    double ripple3 = (1 - pow(10, -0.2 / 20)) * 0.5;
    double att4 = pow(10, -70 / 20);
    double ripple5 = 1 - pow(10, -0.1 / 20);
    vector<double> weight = { 1 / ripple1, 1 / att2, 1 / ripple3, 1 / att4, 1 / ripple5 };

    int err = remez(h.data(), numtaps, numbands, bands.data(), des.data(), weight.data(), 1, 16);
    for (auto &c : h)
        cout << c << ", ";
    cout << endl;
    cout << "error code: " << err << endl;
    return 0;
}

This function call produce some weird coefficients. All values inside h vector are 10e144 something. It is clearly an overflow so I debugged the remez.cc and traced what cause this.

The remez function documentation specified that des array should be of size numband. The des array in remez function is passed to CreateDenseGrid function on line 86 for grid generation. The documentation for CreateDenseGrid on line 73 indicate that its parameter des should be size of 2*numband. Clearly since my des array is only of size numband some out of bound memory access happened on line 110.

I changed the des vector to be {1, 1, 0, 0, 0.5, 0.5, 0, 0, 1, 1} and tries again. The coefficients looks nicer, but when I plot the frequency response in Octave it is not anything close to my intended filter design.

I get this weird frequency response:

Anyone could help me with this issue? Is anything wrong with my remez function call? Any suggestion is appreciated here. Thank you very much.

By the way. I am using vs2015, windows7 64-bits, Debug X86 build for compiler settings.


texts:
Can you please help me with some ideas on how to implement an FIR filter in Matlab using Parks-Mclellan algorithm?

My specifications are the passband cut-off frequency, the transition bandwidth. The I also have the passband ripple, which is an alternating value $ \delta_p=\pm0.2$ and the stopband ripple $\delta_s$. This because the weigth in the stopband frequency range comes from: $ \rho(\omega)=\delta_p/\delta_s$. The design using firpm should meet these specifications.

I have two troubles: The first one is that I have to find the optimal minimum order of the filter N to get the desired  design without using any Matlab builtin function (I saw there is one called firpmord, but again I can't use it), so I imagine I need some kind of iteration but don't know how to put this in code. Also can't find a way to account for the alternating ripple to use it in my calculations. I'm just looking for some advice on how to achieve this.

I'm just starting, trying to catch it:

wp=0.1;
w_tr=0.3;
w_stop=1;
Gp=1;
dp=0.2; % this should be plus minus
ds=0.05;
N=100
h=firpm(N,[0 wp w_tr w_stop],[Gp Gp 0 0],[1,dp/ds])
[h_m,w]=freqz(h,1);
semilogy(w,abs(h_m));


texts: How to get Step Response from an Impulse Response in Simulink?

texts:
Im sorry if it seems like a trivial question but I am confused right now. Im currently watching my professors lecture. And he basically has $\lambda(t)$ as Step response and $k(t)$ as Impulse response of an LTI system. The integral of the Impulse response gives us the Step response:
$$ \lambda(t) = \int^{t}_{0} k(t) dt $$
and
$$ k(t) = \lambda^{\prime}(t) $$
So to see it in action I decided to make a Simulink model of that and here it is (at least I think its good if not please tell me how to do it right):

As you can see those plots are not identical but I was expecting them to be (?)
Why is that?


texts: Performed FFT on an audio signal, but what does the output actually mean?

texts:
Original post from yesterday here

So I did the FFT and I have my transformed data (which is a bunch of values for each frame of data. I'm unsure what the transformed data actually represents. What information do I need, and what math do I need to perform to turn the $k$ values into the appropriate frequency values and the $X[k]$ values into $\textrm{dB}$ values? With $X[k]$ being equal to the sum of $x[n]$ from $n$ to $N-1$ times [...]

I understand how the FFT algorithm works now, I'm just not real clear on what the actual results represent.


texts: Using 8 bit samples for speech comparison

texts:
I am making a speech comparison app in javascript.

I found this dsp.SE post:

  Speech comparison algorithm for rating on similarities,

where I read it is best to use mfcc and dtw algorithms.

I found the Node.js implementation of mfcc which I'd like to use. However, it is only working with 8 bit audio samples. Will that affect the quality of speech comparison, and by how much? If the difference is big enough I will edit the algorithm to support 16 bit samples.


texts: Detecting and Recognizing a pattern in the 2D-FFT

texts:
More theory before I ask a practical question based on the task I have.

I've discovered that performing a 2D-FFT (python or matlab implementations) on some test imagery I have results in a unique pattern. This pattern has so far been easily visually recognizable, but not numerically. The pattern appears as straight lines of some length in the 2D fft, when plotted.

I've tried to perform a Hough transform, stepping through the angles of where the lines are expected to be. While somewhat functional I haven't made a good implementation that works.

In talking with some ML folks, they suggested what every cool kid is doing- machine learning and training. Unfortunately I just don't have the data to do that. I was looking at trying to synthetically create some with POV-ray but that's beyond the scope I think I can afford to learn.

The closest I've seen for pattern recognition is based on character recognition, using an FFT (which link escapes me). But even then in that effort they're training lots of characters. I think this is the point that I'm failing- how do you extract out the shapes to train on?

All of the ML tutorials I've pushed through didn't have FFT in them; although I could substitute, I'd need a working dataset to feed in. Although transforming the Iris example into 2d-fft space might be an interesting effort....

If you've experience with extracting features from a 2D fft and could point me to examples to learn from, I'd be grateful.

Also tried: Gaussian filter to suppress frequencies in the 2D, Sobel, Canny (that's still in progress), Radon, Hough, and a few short other pattern matches/phase correlation. White paper/examples are probably the most valuable to me here. Thank you.

Edit: This is NOT my application here, but I found an example on a published website that is similar to, but not perfect, related to my questions. I hope the visualization makes things easier. Try not to read too much into the activity on the page (defect and crack/scratch detection). On this page, there is an image of multiple scratches and a 'filtered FFT' is done. That would be a good example (mine aren't filtered) of trying to recognize that 'x' present in the 2nd row, 3rd image.


texts: Sub-band factor 0.5 in uniform filterbank

texts: Is there someone who knows where the factor $\frac{1}{2}$ in front of $U_i(z)$ comes from?


texts:
I have rich experience signal-processing, but haven't touched image processing since my happy university days... so:

Working on a side project, I need to enhance ridges (continuous lines) in a 2D grey-scale image. Using Matlab, I'm at a point where Canny edge detection does a great job, but since many lines are thick, I get 2-edges for each ridge. Some Questions:

Is Canny a tool fit for the task?
If so, How do I adapt the Canny algorithm to enhance ridges, instead of edges?
Where can I find a good intro to Canny edge detection (googled it, nothing really helpful found)?


texts:
Currently I'm working out plotting biquads in a VST/AU plugin and have problems with the graphics part. I posted in several forums but haven't got a really useful answer for this case.

First, tell me if I'm right how to get the magnitude response. For this I use this equation
http://rs-met.com/documents/dsp/BasicDigitalFilters.pdf

Am I right that I have to get an array of values, the "points" which are my Y-axis values in my filter plot?

So far, so good. Now, how should I move on to plot this magnitude on screen? I'm really on a point I don't know how to go on.

I'm using the WDL/IPlug framework in which I can use DrawPoints(x,y) and DrawLine (x,y,x1,y1) classes for drawing.

Any help would be appreciated, especially code examples/snippets (I'm learning easier when I can see it...)!


texts: Exact average error probability of QPSK in Rayleigh fading channel

texts:
In Rayleigh fading channel(SISO), I know the instantaneous SER of QPSK for a given channel realization.
However, I do not know the exact average error probability.
It is very hard to calculate the average error probability because of the square of q function.
Are there any results on the exact average error probability of QPSK in Rayleigh fading channel?


texts: FFT Phase interpretation of input signal with non-integer number of cycles in FFT window

texts: It is known that if we take the FFT of a signal at such a frequency which has non-integer number of cycles in the sample window we get different value of phase even if the original signal was at phase 0 (reference to cos wave). Looking at the time-domain signal can we predict what the phase output is going to be i.e. as there any intuitive sense behind the phase that is reported?


texts: Moving average and linearization of two piecewise linear systems

texts:
I have 2 oversampling ADC's running parallelly, each to process data in a specific range of the input as shown below:

Each ADC can process only half cycle range of a sine wave. Each ADC adds its own gain/offset errors. Input is simultaneously applied to different ADCs. Assume one conversion cycle is 1ms and there are 1000 clock cycles (sampling clock).

If the input is of low frequency occuring completely in ADC-1's range or ADC-2's range for one conversion cycle, compensation the gain/offset errors (o1,g1 or o2,g2) of those ADC's respectively is straightforward.

The problem arises during filtering where I need to (moving)average the output from two ADCs which have a different offset and gain errors associated with them. This is where I am stuck.

For simplicity, the filter can be considered a First order Accumulator, (1/z-1). It just averages the 1000 samples.

Below is what I tried:

Since the values o1,g1 and o2,g2 are linear with the number of clock cycles, I tried to find to find a linear equation for them by the following methods:

Now I got four equations for ADC-1 and four for ADC-2 (by matching the input and output of separate ADC's - after the filter - in the following conditions):
(after fixing tstart): Eqs-1:

o1=a*n+b
g1=c*n+d

(after fixing tend): Eqs-2

o1'=p*n+q
g1=r*n+s

(Similarly for ADC2)

Through which I can correct the following samples occur sequentially in a single conversion cycle:

n1 samples from ADC-1 (correct using Eqs-1), n2 samples from ADC-2   ;where (n1+n2=1000)
n3 samples from ADC-2 , n4 samples from ADC-1 (correct using Eqs-2)   ;where(n3+n4=1000)

Now, I am stuck what if the following happens:

n5 samples from ADC-1, n6 samples from ADC-2, n7 samples from ADC-1 (where n5+n6+n7=1000)

This is where I thought, thinking of the filter (1/z-1) as a convolution would help, as I could design the convolution mask differently. Normally, the convolution mask for moving average would look like below:

mask=[1 1 1 1 1 1]; <-- add the factor due to o1/g1 here, modifying each element with 1*(factor), where factor depends on o1/g1 in case of ADC-1

But I am not sure if that would help fixing the problem. Am I making this problem more complicated?


texts: Mathematical equation for the sound wave that a piano makes

texts:
Is there a mathematical function that can output the sound that a piano makes at different frequencies?

So if the simplest equation for a sound wave (at a given frequency and for a given sample rate) is

$ sin(\frac{2 \cdot \pi \cdot x \cdot f}{samplerate}) $

where f is frequency, is there a similar equation for the sound that a piano makes?

EDIT: I'm not looking for anything too complicated here, just a wave that approximates this estimation.   I've been playing around on desmos to see if I can get something similar:

This is what Guest's wave sounds like... not much like a piano.


texts:
We try to multiplication operation of a black & white image with RGB image in same image but their class is not same: BW -> logical, RGB -> UINT8.

How can I convert from Logical to UNIT*? Or, can we do images which is in different class multiplication?


texts: What is a Kravchuk transform and how is it related to Fourier transforms?

texts:
It has been stated here, that the the so-called Kravchuk transform is very important in the field of image processing and possibly in signal processing in general.

I can hardly find any description about this (e.g. not mentioned in Wikipedia, etc.).

It seems to be mentioned in this paper, for example.


texts: How i can smooth a sinusoidal signal using it's local maximum

texts: I have a signal that it is like a Sinusoidal signal with many local maximum, I want to smooth this signal with almost connecting it's local maximum to each other.


texts: When i have already found beamforming,do i still need to use MRC?i have some problems for them

texts:
I have some problem when i learning MIMO,first thing is that i know designing beamforming and MRC can ensure better receive signals,but they are not the same,so i have some question about them.

1.I know the MRC is the one of method to ensure better received signal,so if I have already  found the beamforming direction now,do i still do MRC when calculating the SNR?,like the example below

2.If the transmitter use $N_T$ antenna to transmit one signal to the receiver which is with $N_R$ antenna,now  i do SVD to the MIMO channel $\mathbf H$ ($N_R \times N_T $ matrix ),and find the best beamfoming direction $f_A,(N_T \times 1$ column vector), from it.Now i have beamforming now ,so i don't need to do MRC?

3.Now the received signal is $y_t=\sqrt{P}\mathbf H \vec f_Ax+\vec n$,so now the $SNR=\frac{P||H\vec f_A||^2}{\sigma^2 _n}$?

Because i heard my classmate said that $SNR$ is not $\frac{P||H\vec f_A||^2}{\sigma ^2 _n}$,but $\frac{P||\vec u^HH\vec f_A||^2}{\sigma ^2_n}$,and this $\vec u^H$ is calculate the SVD too.The first column of $U$,SVD=$U\Sigma V^H$.Because $H\vec f_Ax$ is still a vetor,and we can't not calculate SNR from a vector,it must be calculate from a value,and $\vec u^HH\vec f_A$ is a value

Is my SNR formula right or my classmate's is right?Does anyone know the answer about my question?It confused me for lots of months


texts: DFT for audio classification - signals of different lengths

texts:
If I have a set of signals each with $n$ points, I can take the DFT of each and then use the resulting frequency domain vectors as features for some classification algorithm. If the signals are differing lengths, the frequency basis used by the DFT is no longer the same. This means I can no longer directly use DFT as features if I want to compare signals of varying length. What should I do about this?

In other words, I want to convert each audio signal into a length $m$ vector of frequency components, and use the same $m$ for all signals.

I realise there is fundamentally more information in a longer signal, so any conversion will involve some loss of information.


texts: What are the ripple and attenuation in a set of moving average filters?

texts:
Ladies, Gentlemen,

Consider following set of moving average filters:

(1) - 100 coefficients equal to 1/100
(2) --- 95 coefficients equal to 1/95
(3) --- 90 coefficients equal to 1/90
(4) --- 85 coefficients equal to 1/85
(5) --- 80 coefficients equal to 1/80
(6) --- 75 coefficients equal to 1/75
(7) --- 70 coefficients equal to 1/70
(8) --- 65 coefficients equal to 1/65
(9) --- 60 coefficients equal to 1/60
(10) -  55 coefficients equal to 1/55

Suppose filters are implemented in sequence. What are ripple and attenuation of the whole set of filters?

Responding to Mr Commentator I define ripple 1 dB, cut off band 1 tone (1/6 of octave) and attenuation as little as possible.

Regards


texts:
If I have a LTI system which has impulse response $h(n) = \left(\frac{1}{2}\right)^nu(n)$   and the entry is $x[n]=u[n]-u[n-1]$ where $u[n]$ is the unit step function. In order to find the output I have to convolute the $h[n]$ with $u[n]$ and knowing $x(n)=u[n]-u[n-1]\Longrightarrow y(n)=h(n)+h(n-1)$ take the result. Is my thought right? Because I saw somewhere some examples solving differently.
for the above example the result is $y[n]=\left(\frac{1}{2}\right)^nu(n)-\left(\frac{1}{2}\right)^{n-1}u(n-1)  $
(there is a similar question link but I have confused from the discussion.)


texts: How should I sample the signal $f(t) = \sin(24t)^3\chi_{[0,0.52]}$ on the interval $[0,1.25]$?

texts:
I am from an applied math/PDE background and I don't usually deal with proper sampling and signal processing. I just take roughly what seems to be a good number of samples. But I would like to be precise with a signal I'm currently dealing with:
$$
f(t) = sin(24t)^3\chi_{[0,0.52]},
$$
which is shown in the image below on the interval $[0,1.25]$. My matlab code is:

sig_fn = @(t) \sin(24*t).^3.*(0<=t).*(t<=0.52);

time_N = 1500;
T = 1.25;
dt = T/time_N;

t = linspace(0,T,time_N+1);

figure
hold on, grid on
plot(t,sig_fn(t))

How should I sample this signal in Matlab so that it is accurately resolved, that is, what time-step size (or how many time-steps) should I choose? Clearly it is accurately resolved in the image but I have used 1500 time-step for this image which seems to be much more than necessary. By accurate, I mean the relative error between the true signal and the sampled signal is less than, say, $10^{-2}$ in the $l^2$ or $l^\infty$ norms.

I want to use the minimum number of time-steps that still gives an accurate resolution of the signal. So how do I determine how many time steps to use? What changes would a signal processing expert make to the above code so that the correct number of time-steps are chosen to achieve a specific relative error?

On a related note, is there any pre-processing/filtering I could do with the signal that would allow me to use less samples and still get an accurate resolution?


texts: Integral of an upsampled signal, without actually resampling it

texts:
Given a signal X which is sampled at a certain frequency. The value we currently compute is given as the integral of the upsampled signal. Thus: Y = X but 100 times upsampled, by means of sinc interpolation or by using an FFT resampler. The integral is simply the sum of all values in Y.

The calculation of this integral is easy, yet I would like to speed it up by avoiding the upsampling step. Is there any possibility to obtain the integral of the upsampled signal, without actually resampling it ?

Preserving integral through downsampling and Do lowpass filters affect the integral over the signal? are similar questions, but deal with cases of downsampling or bandlimiting. In both cases, it is clear that an integral will not exactly be preserved by downscaling.

Yet, in this question, we are talking about upsampling. I suspect this is possibly because X does contain all information necessary to create Y.


texts: Does spectral leakage include negative frequencies?

texts:
When choosing a window function, window duration, and/or transmission frequency (assuming sampling rate satisfies Nyquist), one may want to understand what sort of spectral leakage would occur at a frequency of interest.

It is known that a finite-duration window corresponds to a non-finite bandwidth frequency response (e.g. rect <-> sinc), and it is also known that a multiplication in the time domain corresponds to a convolution in the frequency domain.

Consider the simple case of a non-windowed, constant-frequency sinusoid in the time domain, which corresponds to a frequency response of two delta spikes centered around 0 Hz.

Applying a window function would convolve the frequency response of the window function (e.g. a sinc function) over the delta spikes.

1. Does this convolution of the window function extend to the negative frequencies when calculating the spectral leakage in the positive frequency components (and vice versa)?

I would say yes based on the above (time domain multiplication <-> frequency domain convolution), and the following two images (source) which I annotated in red.  But it leads me to question 2, which I find a bit concerning.

2. If spectral leakage does extend to opposite-sign frequencies, doesn't that imply window functions without a zero crossing at 2x of a frequency of interest would result in constructive and/or destructive interference ("spectral leakage") in the frequency response of the windowed duration at that frequency?  I.e., frequencies could interfere with themselves?

Here is an image (source) showing that even for a given window duration, the occurrence of such "self-interference" would depend on the choice of window function:


texts: Analysis of the ratio of two moving average filters

texts:
I have created a basic segmentation algorithm for 1-D signals (e.g. audio) based on a ratio of energy averages. The classification rule involves comparing the signal energy measured over a short time window divided by that over a longer window, with a fixed threshold.
More precisely, if $x[n] > 0$ is the instantaneous signal power at index $n$, then the quantity described above is:
$$ y[n] = \frac{\frac{1}{K} \displaystyle\sum_{i = 0}^{K-1} x[n-i]}{\frac{1}{L}\displaystyle\sum_{j = 0}^{L-1} x[n-j]} = \frac{L}{K} \left(1 + \frac{\displaystyle\sum_{j=K}^{L-1} x[n-j]}{\displaystyle\sum_{i=0}^{K-1} x[n-i]}\right)^{-1},$$ for fixed integers $K$, $L$ with $L \gg K > 1.$
I am interested in the behaviour of this nonlinear system, since it seems quite useful in practice. Can anyone suggest a way to analyse it theoretically?


texts:
Can you explain to me in what way Hartley Transform differs from Fourier Transform? Is it even used today or is it some mostly forgotten, obsolete archaic thing?

Please don't use equations - I dont understand them, but I understand Fourier Transform.


texts: Is there a common adaptive image color quantization (posterization) method?

texts:
I know there are a lot of methods to quantize colors in an image given a number of colors. For example the k-mean algorithm enables to reduce the number to k colors.
I'm looking for an adaptive method which finds the best k automatically.
Edit: This could also be called posterization.
My goal is to trace (vectorize) drawings from photos of images with low number of colors like graphics novels.


texts: I am looking for examples of signals that are band limited but also sparse. For instance, the spiking of the neurons can be modeled as banded in frequency domain and sparse in time domain. What other examples exists for such type of signals?