texts: Convolution: generating a continuous-time signal from a discrete-time sequence

texts:
Given a discrete-time (DT) sequence $g[n]$, I want to represent it as a continuous-time (CT) signal. I can do this by representing this sequence as a weighted sum of Dirac delta impulses. Would it make a difference if I pass the DT signal through a DT filter first and then represent it as a weighted sum of Dirac impulses or pass the CT signal through a CT filter. The two cases are as follows:

Case 1: DT sequence converted first to CT signal and passed through CT filter.

The DT signal can be represented as a CT signal as:
$$g(t)=\sum_kg[k]\delta(t-kT)\tag{1}$$
If $g(t)$ in $(1)$ is the input to a continuous-time LTI system with impulse response $h(t)$, the output is given by
$$y(t)=\int h(\tau)g(t-\tau)d\tau = \int h(\tau)\left(\sum_kg[k]\delta(t-\tau-kT)\right)d\tau$$
or
$$y(t) =\sum_kg[k]\int h(\tau)\delta(t-\tau-kT) d\tau$$
or
$$y(t) = \sum_kg[k]h(t-kT)\tag{2}$$

Case 2: DT sequence passed through DT filter and then converted first to CT signal.

The DT signal is passed through a DT filter $h[n] = h(nT)$ to obtain a DT signal $z[n]$:
$$z[n]=\sum_kg[k]h[n-k]\tag{3}$$
This can be represented as a CT signal as
$$z(t)=\sum_kz[k]\delta(t-kT)\tag{4}$$

Is $z(t)$ same as $y(t)$? Can I express one in terms of the other? Any help wuld be greatly appreciated?
-ryan


texts: How to find lattice coefficients of all pole IIR filter with filter coefficient $k_m$ is 1?

texts:
Given the following  system function
$$ H(z) =\frac{1}{1+\frac{2}{3}z^{-1}+\frac{5}{8}z^{-2}+\frac{2}{3}z^{-3}+z^{-4}} \tag{1} $$
We have to draw lattice structure for above system function

The denominator polynomial of the transfer function at lattice stage number $m=4$ is assumed as $A_m$  and now $A_{m-1}$ can be found with

$$\begin{align} A_{m-1}(z)&=\frac{A_{m}(z)-k_mB_{m}(z)}{1-k_m^{2}}\\
\text{with}\quad B_m(z)&=z^{-m}A_m(1/z)\\
\text{and}\quad A_0(z)&=B_0(z)=1\end{align}\tag{2}$$

where $k_m$ is the $m^{th}$ reflection coefficient.
But since the $k_m$ value is 1 equation (2) becomes zero in denominator and hence cannot be solved.

I couldn't find the solution to this particular problem in some of my book or other site.
How can I get the lattice coefficient for above system function?


texts: 2nd Order Type 2 PLL for Tracking Frequency Error

texts:
This is a "DSP Puzzle", Please preface your answer with spoiler notation by typing the following two characters first ">!" as the intention is for readers to think through what the solution might be first (the ones that want to participate, others can hover over immediately to see the solution).

A second order "type 2" Phase Lock Loop is required in order to track a phase ramp with time with zero error. A phase ramp is a frequency step. Similarly a third order "type 3" PLL would be required to track a frequency ramp (phase acceleration), which I have summarized in the graphic below. The "Type" refers to the number of poles in the open loop transfer function at the $s=0$ in continuous time or $z=1$ in discrete time loops, since these represent pure integrators. An integrator has infinite gain at DC and hence infinite suppression of DC error.

A second order type 2 PLL is often implemented with a proportional-integral loop filter, adding the second pole in addition to the oscillator which has an inherent pole since it integrates phase (controlling the output frequency of the oscillator directly is controlling the integral of the phase of the output).

The question is: There is a way to implement a similar tracking system to track a phase ramp with zero error using two first order PLL's. How do we do this?


texts:
I have recorded an ultrasonic wave from a microphone using MATLAB command. After plotting that recorded wav file, the graph shows the amplitude between $1$ and $-1$.

Can anyone tell that what is does mean?
How can we convert that data into pressure?

I read from the detail of audiowrite() here that the data should be normalized between $1$ and $-1$. But my question is in what form it reads and stores in the wav file. Either it is voltage or something else.

Why it is normalized?


texts:
I have a signal up to $3\textrm{ MHz}$. The ADC that sample it has a rate of $1.5\mu s$. So a full $T$ of the signal is $0.3\mu s$, and I can only sample each $1.5\mu s$. It sounds not enough, but I don't need to reconstruct it, but to create an envelop detector from it, over time, based on lets say $1000T$ (periods).

So, over $1000$ periods of $3\textrm{ MHz}$, I will have: $300 \mu s/1.5 \mu s=200 \textrm{ samples}$. From these $200$ samples, I need to create some envelop detector, or continues curve to then later check if it has some large amplitude changes.

How can I chose where to sample the input signal so that I can get the "right points" of it- means mostly its maxes, where my sample rate is much slower then the signal ?
Should I use a moving average to get this curve ?
Is there another good approach expect from taking more periods?($>1000$)


texts:
I was searching on the Internet hopelessly about some materials regarding detecting a sound in another sound. Say, I've got a recorded short sound (which may be anything, fragment of speech, fragment of music, noise, their combination or something else) and a longer sample, which contains this sound somewhere. The problem is, that the sound may be partially mixed with some ambient sounds. I know though, that despite mixing with other sounds, this will be exactly the sample I have recorded earlier.

Which algorithm may I use to perform such search?


texts: How to calculate the frequency of a signal without knowing the sampling frequency using Matlab

texts:
I have a signal and I am using Matlab command pwelch to calculate the frequency of the signal, but the frequency I obtained is changed as I change the sampling frequency.

For example, when using sampling frequency equal to 8000[samples/sec], the frequency appears to be 1 Khz, while using 16000 sampling frequency the frequency of the signal appear to be 2 Khz.

Which is the correct frequency? And is there other method to calculate the frequency of a signal without a prior knowledge of the sampling frequency?


texts: Using MNE-Python for EEG trimming and Filtering

texts:
I am working on an EEG Signal analysis problem with python. I need to remove the recordings below 1st minute and above 6th minute of the signal, and pass it through a bandpass filter. I am not familiar with MNE so used scipy for trimming and filtering after converting it into raw NumPy array format. The code is given below. Since the sampling rate is 100 Hz, I assumed the first minute will contain 6000 samples and the next five minutes will contain 30000 more samples which are why I am only taking raw_data[i][6000:36000].
filtered_data[i] = butter_bandpass_filter(raw_data[i][6000:36000], lowcut, highcut, fs, order=5)

butter_bandpass_filter is defined as follows
def butter_bandpass(lowcut, highcut, fs, order=5):
   nyq = 0.5 * fs
   low = lowcut / nyq
   high = highcut / nyq
   b, a = butter(order, [low, high], btype='band',analog=True)
   return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order=5):
   b, a = butter_bandpass(lowcut, highcut, fs, order=order)
   y = lfilter(b, a, data)
   return y

But I don't feel like this is the correct method. Is there a way to do the above-mentioned task using MNE-Python instead of converting it to ndarray or using scipy?


texts: ECG noise filtering using FIR Bandpass Filter

texts:
I am new to signal processing and examine ECG data corrupted with noise. The clean data has a frequency spectrum like this.

And the corrupted one looks like  this (sorry for the different scale)

I am asked to find a FIR band pass filter in matlab to filter out the noise. Unfortunatly I am using filters for the first time so I played with the coefficients and found something like this (The only thing that seems to be clear to me is that the bandpass has to be between something like 1-30 but I have trouble choosing the other parameters.)

$Fstop1 = 0.01$

$Fpass1 = 3$

$Fpass2 = 25$

$Fstop2 = 60$

$Astop1 = 80$

$Apass = 1$

$Astop2 = 30$

$Fs = 250$

The result is not 100% satisfying (I am still having a lot of baseline fluctuations). Is it possible to get "good" results in doing this? Can anybody see heavy mistakes in my parameters that could lead to problems? Or can anyone tell me better coefficients to use?


texts: 2D Fourier Transform of Rotated Discrete Domain Signal

texts:
Assume we know that the Fourier transform of a signal $x(n_1,n_2)$ is $\mathcal{F}(x(n_1,n_2))=X(\omega_1,\omega_2)$. What is the Fourier transform of the signal after being transformed by a rotation matrix?

I have found a property of the DFT that states that rotating the spatial domain contents rotates the frequency domain contents which is called the Rotation Property.  I am assuming this extends to DDFT's (Discrete Domain Fourier Transforms).  However, I would like to derive it.

We can represent our signal using vector notation as $x(\boldsymbol{n})$, where $\boldsymbol{n} = \begin{bmatrix} n_1 \\n_2\end{bmatrix}$.

The rotation of $\boldsymbol{n}$, denoted $\boldsymbol{n}' =\begin{bmatrix} n_1' \\n_2'\end{bmatrix}$, can be expressed as
$$\boldsymbol{n}' =R\boldsymbol{n} = \begin{bmatrix}
       \cos\theta & -\sin\theta \\[0.3em]
       \sin\theta & \cos\theta
     \end{bmatrix} \begin{bmatrix} n_1 \\n_2\end{bmatrix}
$$

So I am trying to find the Fourier transform of $x(R\boldsymbol{n}$).

My attempt is as follows:

Step 1: Write the Fourier transform in vector notation.

Define $\boldsymbol{\omega} = \begin{bmatrix} \omega_1 \\ \omega_2\end{bmatrix}$.  We can now write the 2D Discrete Domain Fourier transform as: $$\mathcal{F}(x(\boldsymbol{n}))=X(\omega_1,\omega_2)=X(\boldsymbol{\omega})=\sum_\boldsymbol{n}x(\boldsymbol{n})e^{j\boldsymbol{\omega}^{T}\boldsymbol{n}}$$ because $\boldsymbol{\omega}^{T}\boldsymbol{n}=\omega_1 n_1 + \omega_2 n_2$.
Step 2: Solve for $\boldsymbol{n}$:
\begin{align}
\boldsymbol{n}' &=R\boldsymbol{n}\\
R^{-1}\boldsymbol{n}' &=R^{-1}R\boldsymbol{n}\\
R^{-1}\boldsymbol{n}' &=\boldsymbol{n}\\
R^{T}\boldsymbol{n}' &=\boldsymbol{n}
\end{align}
Noting that $R^{-1}=R^{T}$ for rotation matrices.
Step 3: Apply Fourier transform to rotated signal:
$$\mathcal{F}(x(\boldsymbol{n}'))=\sum x(\boldsymbol{n'})e^{j\boldsymbol{\omega}^{T}\boldsymbol{n}}$$
Plug in $\boldsymbol{n} = R^{T}\boldsymbol{n}'$
$$\mathcal{F}(x(\boldsymbol{n}'))=\sum x(\boldsymbol{n'})e^{j\boldsymbol{\omega}^{T}R^{T}\boldsymbol{n}'}=\sum x(\boldsymbol{n'})e^{j(R\boldsymbol{\omega})^{T}\boldsymbol{n}'}$$
And therefore
$$\mathcal{F}(x(R\boldsymbol{n}))=X(R\boldsymbol{\omega})$$

Which I am interpreting as meaning the original statement of rotating the spatial domain contents rotates the frequency domain contents.

Can anyone confirm this is correct?


texts:
I am new to DSP, and am mostly self taught. I have a couple of questions, that may be too basic, but I couldn't really find an answer online.

I have a signal obtained by plotting the motion of a human in 2D from a fixed point of reference (origin).

The data is noisy, so I wanted to use a filter to get a smoother signal.
I want to filter out different motions. The intuition is that different kind of motions would occur at different frequencies.

From what I googled, and read online; it seems I need a bandpass filter like butterworth. However, after reading a few tutorials and book chapters, I have two questions:

My signal is a time-signal (displacement vs time), but the filter takes the input in terms of cut-off frequency. Does this mean I have to convert the signal into frequency domain, or does the filter take care of it? I am bit confused on how this actually works.
On a related note, I don't know the frequency of each motion that I am trying to filter out i.e. the intuition is that the frequency for different motions be different, but how do I determine by cut-off values? Is it usually done by trial and error, or is there a more scientific way to accomplish this?


texts: Time signal FFT different for whole signal than half signal on high frequencies

texts:
I have a time signal of u from 0 to 1000 time units. If I chop the signal in two halves and compare the frequency spectrum of both it looks similar, as it should (the signal should be statistically steady from where I start recording it). However if I compare it to the frequency spectrum of the full signal I get a different slope in the high-frequency region.

I do not understand this. If I use the whole signal there should be a change on the low-frequency region rather than the high-frequency one right?

This is the code I use compute the frequency spectrum. I think it's okay, but maybe I'm doing something wrong.

def time_spectra(t, u):
    import numpy as np
    from scipy.interpolate import interp1d
    # Re-sample u on a evenly spaced time series (constant dt)
    u_function = interp1d(t, u, kind='cubic')
    t_min, t_max = np.min(t), np.max(t)
    dt = (t_max-t_min)/len(t)
    t_regular = np.arange(t_min, t_max, dt)[:-1] # Skip last one because can be problematic if > than actual t_max
    u_regular = u_function(t_regular)

    # Compute fft and associated frequencies
    uk = np.abs(np.fft.fft(u_regular)) / len(u_regular)
    freqs = np.fft.fftfreq(u_regular.size, d=dt)

    # Take only positive frequencies
    freqs = freqs[freqs > 0]
    uk = uk[:len(freqs)]

    return freqs, uk


texts:
I'm trying to implement SIFT algorithm.
After I found the min/max points in DOG images I need to find the real min/max subpixels by taylor exapnsion:

$$
\begin{equation}
D(\mathbf{x}) = D + \frac{\partial D^T}{\partial \mathbf{x}}\mathbf{x} + \frac{1}{2}\mathbf{x}^T\frac{\partial^2D}{\partial \mathbf{x}^2}\mathbf{x}
\end{equation}
$$

http://en.wikipedia.org/wiki/Scale-invariant_feature_transform

I'm not sure how I do it.
I understand the idea behind using taylor expansion.


texts:
I am trying to apply phase lock loop to calculate phase shift due to doppler effect and finally calculate the doppler frequency($\Delta f$). I am assuming that the received wave is of the form,
$r(t) =\cos(2\pi f0 + \phi) $
.The receiver in my setup is at rest and the source is moving at velocity of about 1m/s. But I am not observing the correct doppler shift (calculated using, $\Delta f = \frac{v}{c}f0 $).
To calculate $\Delta f$ from $\phi$ I am using
$\Delta f = \frac{1}{2\pi}\frac{d\phi}{dt}$
.I am testing using $f0=17kHz$ with sound. My low pass filter in PLL is a linear phase FIR filter with stopband and passband frequencies of 200Hz and 100Hz respectively.
What am I doing wrong? I want to reduce the passband of the filter to 10Hz but octave is giving an error 'insufficient extremals'. Currently I am getting a maximum $\Delta f$ of about 6Hz while it should be around 50Hz according to the above equation.

EDIT:
Just found out that amplifying/de-amplifying the signal before processing it is changing the $\phi$. Not sure why? Can anyone shed some light?


texts: Possible to Implement Baseband OFDM on Microcontroller?

texts: I am wondering if one can implement OFDM on any available microcontroller or Development board in the present Market. Definitely not looking FPGA solution. Specifically, on any Microcontroller is it possible?


texts: Regarding the nature of white noise in images

texts:
I have just started learning the very basics of noise.

I have come to understand what white noise is in sound samples, but I do not understand the meaning of white noise in images.

In sound samples, time advances, and the various sound waves evolve through time. But images don't have time evolution, so I struggle to see how the frequencies come into play. Are the various waves evolving through one axis of the image?

How was the  white noise image generated on the wikipedia page on White Noise?


texts: Successive dynamic time warping with a set of window sizes

texts:
I am applying DTW to a set of data. I haven't figured out a solution yet, still searching for ideas, and I'm currently trying to apply DTW successively with a monotonic set of windows.

Let's say i have a reference and test signals, which have been both resampled at 10 millis (reference is usually a 10 samples or so of length), the test signal is varying,but 3k of data samples is not unusual. My intention is to run DTW with window size of let's say 10,20,...50 and see how far it gets me. Question is, can I optimize this? Example: starting with 50 and calculating properly the DTW for this, are there shortcuts when progressing down to 40, 30 and so on (or the reverse, starting with 10 and progressing to 50)?

Can the processing effort be reduced under 5 full DTWs by reusing calculations for a different window size, yet applied to the same two signals?

For instance, I reinitialize the cost matrix only once per a set of 10...50 window DTWs. Cost matrix will have a 3K by 3K size after resampling, and reinitialization for constrained DTW, in my understanding, means resetting the elements to an arbitrarily high value. Checking with matlab, yielded the same results as reinitializing every time before DTW, but the running time was reduced to a third. Still, this has been tested insufficiently.

Please note this is not a question about generally optimizing DTW (currently not investigating bounding or anything else), but one with specific application to this use case.


texts: Defining the observation matrix for a Linear Kalman Filter

texts:
So I'm working on some content for an exam tomorrow and have hit a logical snag. The question can be seen below:

In particular I am referring to 5)c).

The questions asks for a measurement model to be derived for this problem.
I am aware that our measurement Zt = CtXt + noise, where Zt represents the measurement, Ct the observation matrix at time t and Xt the state vector at time t.

Xt is defined as (Pt, Vt)^T

One 'solution' I have seen for this problem is to define Ct as [1, 0]. However to me this makes little sense. In the question it states we measure both the position of the robot and the velocity. As such should this observation matrix not be [1,1]? However in which case the result of this multiplication would become = Pt + Vt. Which of course is a nonsensical measurement reading.

Instead we want an obersvation matrix defined as:

As this would give us a Zt measurement result of (Pt, Vt)^T Which the question asks for?

A similar question has been asked before, however the corresponding solution only adds to my confusion, defining an observation matrix of [0,0,1] thereby resulting in two of the three variables in the defined state vector (for that question) being multiplied by 0 and ignored?

Another source has an almost identical question, but states we measure solely the robots position and not both the position and velocity.

Question
Is my thinking right, and therefore the 2x2 identity matrix for the observation matrix correct? Or is there something I am mising?


texts: The Concepts Behind SVD Based Image Processing

texts:
I am interested in information about the output of SVD of the matrix. Mathematical part of SVD process is clear to me but I don't understand how to read figures with graphs of SVD of a matrix. As I understood vertical axis represents singular values.

But I can't figure it out what horizontal one represents.
Also, what is the difference between singular spectrum and singular
vectors representations?
What singular spectrum means, is it singular values?


texts: Help in understanding the IQ raw file format used by SDRs/GnuRadio

texts:
I apologise as I feel like I should know this off the top of my head. I will try to explain what I believe I know and then ask a simple question.

The usual file format used in software defined radios should be just numbers in binary format, representing in-phase and quadrature values of the sampled waveform. Those values are usually 32 bits, so every 2*32 bits you have a single sample of the waveform in that moment. When you play back this format, the DAC reproduces the waveform associated with those IQ states at the rate you ask it to. If you are using 10 MHz as your sample rate, the DAC will produce a waveform with the IQ values you ask it to and consume those values 10 million times a second.

The only way to entirely corrupt this file format is to cut 32 bits somewhere, as that would invert I and Q for the rest of the file. If you remove any multiple of 2*32 bits from the middle of the file you would only corrupt that single sample (and maybe the one before/after it), but the integrity of the file as a whole will not be compromised.

I'm asking this because I'm interfacing with the USB driver of a SDR and I'm confused as to what is actually going on.


texts: On generalizing Gabor-Heisenberg uncertainty in a noisy environment

texts:
The Gabor-Heisenberg uncertainty represents the fundamental limit of time and frequency resolution one can extract from a signal.

$\sigma_t \sigma_f \geq \frac{1}{4\pi}$

My question is: what happen in a noisy environment?

If a bird sings a perfect constant pitch. Depending of the ambient noise, the frequency estimation of this pitch will be affected by the SNR.

Let say you have a time-varying arbitrary tune (like a bird song) played in a arbitrary colored noise environment. Is there a generalized Gabor uncertainty that takes to account the SNR?

I expected something like this:

$\sigma_t \sigma_f \geq function(SNR)$

Given the downvote(s) and the comments, I'll try to rephrase my question:

Frequency estimation is limited by SNR in a noisy environnent.
Frequency estimation is limited by Gabor-uncertainty.

If statements 1 and 2 are correct, how to reconcile the two statements in one general concept? I suppose, there should be a way to compute the 'frequency-estimation precision' as a function of both SNR and time resolution (maybe with some other assumptions).


texts: Names of system functions in frequency domain

texts:
I was just trying to refresh my systems theory known from long ago, and I realized that I had forgetten the name of the basic functions.  Specifically, what are the names of these functions respectively:
$$H(\Omega),~ H(\omega),~ H(s),~ H(z),~ |H(\Omega)|,~ |H(\omega)|,~ |H(s)|,~ |H(z)|$$
I'm assuming that $\Omega$ is the continuous frequency in radians, and $\omega$ is defined as the discrete frequency in radians.
I'm guessing that $H(\Omega)$ is the frequency response, and that $H(s)$ is the transfer function... but i'm not sure about the other names.


texts: Improving Velocity Estimation Using Multiple Sensors in a Dynamic System

texts:
I have a sensor reduction model which gives me a velocity estimate of a suspension system(velocity 1) .

This suspension system estimate velocity is used to calculate another velocity(velocity 2) via a transfer function/plant model.

Can I use velocity 2 to improve my velocity estimate (velocity 1) through Kalman filtering or through some feedback system.??


texts: How to automatically identify a surge in a periodic signal

texts:
Say I have a periodic signal i.e. Sine wave, which sometimes can have spikes that are 100% larger than the peak value. These spikes can be periodic as well.  I'm trying to find an algorithm that could detect these spikes without human intervention.
I was thinking for each point to average the value with the surrounding 3 or more points but it doesn't seem to be working.
Any help is appreciated.


texts: Confusion in basics of Laplace Transform

texts:
I have few confusions while starting Laplace Transform. So far I have studied, Fourier series and Fourier Transform. The basic difference which I found from different books is Fourier Transform is only considered the imaginary part whereas the Laplace transform considers both real and imaginary for general values.
i) I want to ask that, is it only difference we have in Laplace and Fourier Transform?
Then i saw the two different equations of Laplace transform which is bilateral Laplace Transform $$ X(s) = \int _{-\infty}^{+\infty} x(t) e^{-st} dt$$
Whereas in the second equation of Laplace Transform is called unilateral Laplace Transform and it defined as:
$$ X(s) = \int _{0}^{+\infty} x(t) e^{-st}dt $$
It omit the negative part and only have for $t>0$

ii) Here I want to ask that what is the reason of omitting the $t<0$ part?

And Lastly, there was an example  $$ x(t)=e^{-at}u(t)$$
After applying Laplace transform it was written The transform exists only if $Re(s+a)$ is possitive.
iii) Now here is am confuse that why it took for possitive?


texts: Detecting a fixed template image out of a semi-constant frame of video

texts:
There are a number of videos that I'm looking to process of different video games to detect various "states" in them.

The first game that I am tackling is any edition of Super Street Fighter 4.

In it, I'd like to detect when the "vs" character screen comes up.  Here's an example of one frame of the video:

(taken from ~10s mark of this video)

If I could detect the "vs", then I'd be able to detect that frame of video is indeed the "vs" screen, which would allow me to look for other information (for now, let's say I'll use it to detect the timestamp in the video where the match is about to start).

That said, here is what can be assumed about the frames from the videos that I will be processing (this is not the only video, there are thousands, if not tens or hundreds of thousands of videos, but the issue of scale in processing that many videos is a completely different domain):

I'd prefer (but it's not necessary) to process the lowest resolution image possible with reliable results (lower resolutions = faster processing time). The image above is 480 x 270 pixels (taken from a YouTube video with a fmt 18) but they may come in different sizes (I've gotten YouTube videos with fmt 18 but with dimensions 640 x 360 pixels).
Most videos will be direct-feed
Most videos will be 16:9 aspect ratio
The reddish background will be animated, but generally be within that orange-red color (it's flames)
Sometimes there will be a badge fading in and out over the lower part of the "vs" to indicate a version (that will be important, but not right now), which might obfuscate the "vs", like so:

(taken from ~3s mark from this video; also note that the above is a resolution of 640 x 360 pixels)

The size and position of the "vs" is going to be roughly the same (I haven't verified this yet but I know it doesn't move) in proportion to other direct-feed videos
The characters will be chosen from a pool of more than 30 on each side (in other words, those areas of the frame will vary)
The videos will generally be anywhere from two to four minutes long, with somewhere between 4,000 and 6,00 frames.  However, there might be longer videos (maybe a two hours) which have various other games and live action cut in.  These videos are not as important, but if a solution tells me where a certain game pops up in the larger overall video, great
The native resolution of the captures is 720p, so a baseline image of the "vs" can be taken at what would be considered a "native" size.

Ultimately, I'm looking to code this pipeline in .NET, but that's not super important, the proof-of-concept is more important here as well as an understanding of the techniques involved so that I can translate and optimize it for .NET as well as for other videos of other games in the same genre (if I can pick out the significant discriminators, and videos of say, Ultimate Marvel vs. Capcom 3, Street Fighter x Tekken, BlazBlue: Continuum Shift, etc.).

I'm also dipping my toes in Mathematica and have home version 8.0, so a proof-of-concepts in that environment is more than welcome as well.


texts:
Suppose I have the following image. I want to extend/expand the grey background behind the model. The extension should only be upward and sideward. I don't want to extend downward because it will be ugly.

The purpose is to make the image into size (w, h) where w is greater than or equal to current image width and h is greater than or equal to current image height.

One way I could think is, to copy the pixel in the (0, 0) and fill the image extension using this pixel value. However, as you might notice, the grey background at bottom right is slightly different than the rest. This will make noticeable colour difference.

What are better algorithms that is usually used to do that? The resulting image should not have noticeable colour difference and looks natural.


texts: How do you estimate necessary dynamic range?

texts:
Say I have a signal (1D in my case, but could be an image, etc.) that has been captured adequately on nice equipment with sufficient resolution and range to get all the details of the signal that are important. I want to estimate what the minimum dynamic range to capture the relevant details of the signal would be.

In particular I want to compare the dynamic range of two signals.

My idea was to take the top percentile of the absolute value of the stored signal, divided by the bottom percentile. In python, for example:

DRestimate = np.percentile(y,99)/np.percentile(y,1)

Obviously this depends on subjectively picking a good percentile for your application, but it does allow me to get a comparison between two signals. So, the question is, is there a standard, or better way to do this?


texts: Wavelet Transfrom + Power Spectral Density (using Matlab)

texts:
I don't have background knowledge about signal processing before and new at Matlab too.

I have EEG data (with noise removed) 1x128; sampling rate = 128 Hz, It's means that I have 1 sec. data right?

OK, I need to extracted to 5 frequency bands that are Delta (0-4 Hz), Theta (4-8 Hz), Alpha (8-16 Hz), Beta (16- 32 Hz) and Gamma (32-64 Hz) by Wavelet Transform (using Matlab), What is/are function--commands should I use?

And then, I need to compute the power spectrum (PSD) for each band, What is/are function--commands should I use?

Example:

Input: X = [1:128] and I need
Output: Y = [psdOfDelta, psdOfTheta, psdOfAlpha, psdOfBeta, psdOfGamma]

Thanks.


texts: Is it possible to design noncausal filters in Matlab?

texts: I'm trying to design a lowpass IIR filter with 5Hz cutoff frequency (sample frequency is 200Hz). i know how to create it with fdatool, or with functions such as 'butter' or 'ellip'. However, i think that all the filters created are causal. Is it possible to create also noncausal filters? Thanks in advance


texts: One representative time series signal from multiple time series data

texts:
I came across this basic problem in DSP which is not my area owf expertise but I consider this problem to be a common problem which others might be addressing.

I have multiple time series data and I need to find a time series data that is a representative of all those data. One method that I am applying is averaging the signals but I am sure there will be some other sophisticated methods to do the same.

What are the other methods that I can apply?

Thanks


texts: Reconstruction of a signal using an ideal DAC

texts:
I think I was able to do part (a) correctly, but now am stuck on part (b). I don't know how to approach this part or what is the theory behind it.
My MATLAB code is shown below. Please let me know if I have any mistakes.

% part a
T = 0.2;
t = 0:0.001:3*T;
xc = 10 + 3*sin(20*pi*t+pi/3)+ 5*cos(40*pi*t);
% for sampling time t = 0.01n
n = 0:0.01:3*T;
xn = 10 + 3*sin(20*pi*n+pi/3)+ 5*cos(40*pi*n);
figure(1)
plot(t,xc);
hold on
stem(n,xn,'filled');

% part b
% constructing yr to produce x[n]


texts:
While studying Laplace transform, I also some questions which I want to understand:

a) We used to say that Laplace transform include both real and imaginary part whereas in Fourier transform we only have imaginary part. But when we have to say about convergence we also choose Real part to be either >0  or <0 . I want to know why we ignore imaginary part?

b) If we have any function x(t)  how do we determine that we have to take bilateral integral or unilateral integral. In the above case we have u(t)  with the function so our limits are changed. But if we don't have $u(t)$ function with the exponential like $$ x(t)=e^{at}$$ than how can we select bilateral or unilateral

Q2: what will be the Laplace Transform of $$f(t) = e^{at}$$


texts: Why is MSK (minimum shift keying or FSK with a modulation index of 0.5) said to be a spectrally efficient form of FSK?


texts: Obtaining a high sample rate digital approximation to an analog filter from lower frequency measurements

texts:
Consider a set of dense, but generally irregularly-spaced frequency response measurements of some real low-pass analog filter.  Denote the maximum frequency for which a frequency response measurement is available as F_a_max.

I would like to create a digital filter model for this analog filter.  The sample rate of this filter F_s needs to be upsampled with respect to the rate implied by the measurements, i.e., F_s > 2 * F_a_max.  I have used Matlab's invfreqz function to obtain the transfer function of the digital filter from the frequency response measurements.  In principle, I can associate an arbitrarily high sample rate with the frequency response measurements.  However, I'm concerned about what the response of the digital filter will look like for frequencies greater than F_a_max.  While I don't know the exact desired response for such high frequencies (since I don't have frequency measurements for such high frequencies), I don't want the response to go "crazy" in that high frequency band.

An alternative may be using invfreqs to obtain coefficients of an analog transfer function and then use, e.g., a bilinear transform at the desired sample rate to obtain a digital filter.  However, the same concern exists.

Are there standard approaches to this problem?  I have seem some recommend Lagrange interpolation of the invfreqz output where F_s is first set to 2*F_a_max, and then Lagrange interpolation would resample the response at the higher rate.


texts: Fusing motion and color in particle filter

texts:
I am trying to implement particle filter to track a car bounded by a box.

First i used color histogram as my likelihood function and implemented PF, where i was using the bhattacharya distance to get weights.

Later I used motion technique, In which i am subtracting the  consecutive images, and then finding the contour in the image, which will be the object to be tracked(Camera is static), and I am using the gaussian distribution as the likelihood function to get weights and I have applied PF to it. Now I want to fuse both the techniques in one and use Particle filter .

How can i do it? I tried to search online, But I couldn't find any nice explanation or material.


texts: Are there any measurements or test for whether an audio signal is stationary?

texts: I need to divide an audio signal into frames in which the signal can be assumed to be stationary. How can I measure whether an audio signal is stationary in a frame?


texts:
I have 2 sin waves:

Fs = 1500;
N = 100;
t = (0:N-1)'/Fs;

sinwave = sin(2*pi*15*t);
sinwaveshifted = sin(2*pi*15*t + 1.3);

If I get the magnitude at 15Hz using an fft (need to use an FFT that is a power of 2 for reasons beyond my control):

fftsin = fft(sinwave,128);
fftsinshift = fft(sinwaveshifted,128);

% 2 corresponds to 15Hz

abs(fftsin(2)) = 51.819;
abs(fftsinshift(2)) = 41.6151;

Why the difference?  I'm assuming because my bins do not line up perfectly there is some leakage occurring. Also, I haven't done any windowing.

If I do window my signals (I used a flat top because I read that was best in terms of magnitude accuracy), these are my results:

w = window(@flattopwin, 100);
sinwin = sinwave .* w;
sinshiftwin = sinwaveshift .* w;

fftsin = fft(sinwin ,128);
fftsinshift = fft(sinshiftwin ,128);

% 2 corresponds to 15Hz

abs(fftsin(2)) = 2.7283;
abs(fftsinshift(2)) = 17.822;

Why the huge difference?


texts: Kalman Filter Process Noise - Model Where It Vanished

texts:
I am trying to use the Kalman filter (the scalar version) to estimate the steady state of a set measurements which is a random process.
I have used a constant dynamic model as the state equation,

$$ x(t+1) = x(t) + w(t) $$

Where $ w(t) \sim N(0, Q) $.

The measurement equation

$$ y(t) = x(t) + v(t) $$

Where $ v(t) \sim N (0, R) $.

The measurement noise $ v(t) $ is taken as the uncertainty of the instrument and R is a known value with a assumed Gaussain distribution.
The process error, $w(t) = x(t+1) - x(t)$ has high values as a constant variance (Calculated using the total error variance) or a time varying (Taking last 2, 5 readings as the set f sample).
However, the state reaches the steady state when $ Q $ is very small or  $ Q = 0 $.

I have seen several other theoretical examples uses $ Q = 0 $ and reaches the steady state. But I am working with actual data. Also I have seen some other posts explaining the similar behavior. Can some explain this behavior with reasons, please?


texts: How many bits of precision are often used in fixed point DSP?

texts: I understand FIR & IIR digital filters are often implemented in fixed point DSP hardware. I have also seen them implemented in software. Do companies make special purpose digital filtering chips that use floating point precision (float) and (double)? When fixed point hardware is used, what are the choices for the bits of precision?


texts: Convolution that results in an all-zero sequence

texts:
I am asked to find a pair of sequences, each one of which contains three distinct values and where the convolution is an all-zero sequence.

I've came to the conclusion that one of the sequences must be infinite but just can't think of any examples...


texts:
Suppose we have a DSBSC signal given by :

  $$s(t) = 10 \cos (2\pi f t + \phi ) \cdot m(t) $$

  where carrier is random signal with phase ($\phi$) uniformly
  distributed in $[0,2\pi]$.

  If the power spectral density of the message signal $m(t)$ is :

  Q.How can I express the power spectral density of $s(t)$ in terms of given PSD of $m(t)$?

My attempt:

By Wiener–Khinchin relations,

Autocorrelation of $m(t) = 3 \mathrm{sinc}^2(3000t)$

Now to get the autocorrelation of $s(t)$,

$$R_{ss} (T) = E[ x(t)x^*(t+T)\cdot m(t) m^*(t+T) ]$$

where $x(t)$ is the carrier.

If I assume they are independent, then :

$$R_{ss}(T) = R_{mm}(T) R_{xx}(T)$$

which gives me

$$R_{ss}(T) = 150\cos(2\pi T)\cdot\mathrm{sinc}^2(3000T)$$


texts: Interpreting FFT Coefficients from System Matrix That Is Originally Toeplitz (Not Circulant)

texts:
If I have a measured signal $y$, true signal $x$, and a convolution matrix $A$ that is a Toeplitz but not circulant matrix, I can write the convolution as

\begin{equation}
y = A x \ .
\end{equation}

However, I would like to analyze the system using diagonalized coefficients of the Fourier transform. A re-formulation such as the one given below is often used to provide a means for fast computation:
\begin{equation}
\left[\begin{array}{c}
y\\
y'
\end{array}\right] =
C
\left[\begin{array}{c}
x\\
0
\end{array}\right] =
\left[\begin{array}{cc}
A & B \\
B & A
\end{array}\right]
\left[\begin{array}{c}
x\\
0
\end{array}\right] =
\left[\begin{array}{c}
A x \\
B x
\end{array}\right] \ ,
\end{equation}
where $C$ is a circulant matrix into which the Toeplitz matrix $A$ is embedded, using an additional matrix $B$ derived from the values of $A$.

Diagnoalized values of $C$ can be obtained by multiplication with Discrete Fourier Transform matrices. But are these values relevant for interpreting the behavior of the original system, $y = Ax$ - for instance, for use in construction of a Wiener filter for the original system?


texts: Can someone help me plot the spectrum as shown in the figure in MATLAB

texts: I have to plot the freuency spectrum of a similar pulse echo response in m project, can someone help me here?


texts: Contour Integral and Residue Theory for Inverse $z$-Transform

texts:
I'm aware that the inverse $z$-transform can be evaluated using contour integration which leads to the use of Residue Theory as a corollary and I do know of the two definitions. My question is how does one lead to the other being used? It's been many years since I studied the two.

Thanks.


texts: Image processing functions for quality control

texts: I have to use image processing for quality control of a cookie manufacturer (as a part of my project). The program must be able to detect oversized, undersized, distorted cookies, cookies having cracks, etc. I am new to opencv. Can you please suggest which all functions would help me?


texts:
I'm looking to apply an optimal LQR filter to a discrete signal of the form

$x[n]=A\sin[\omega_0n + \phi]+ v[n]$

The amplitude $A$ and the phase $\phi$ are unknown variables I want to estimate using the filter, and $v[n]$ is an uncorrelated noise signal of variance ${\sigma_v}^2$.

I don't know how to build a state model to generate this sine wave, and proceed from there.

Thanks in advance for your help.


texts: Group cascading IIR filters of different orders

texts:
Is it possible to make one IIR filter from various cascading IIR filters of different orders?

I know it is possible to do it from filters of the same order, but what about filters with different orders?


texts: Is there an existing feedback elimination algorithm that can be implemented in iOS?

texts: The project I'm working on allows a user to speak through a PA system with their iphone as the microphone. Unfortunately, the existing audio units in iOS don't eliminate the feedback between the PA speakers and the iphone microphone and there is instant and debilitating feedback. Is there a way to overcome this issue using existing algorithms? If software feedback elimination is not an option, would it be possible to tune the sensitivity of the iphone microphone to be more directional?


texts: Difference between Leaking Factor and Forgetting Factor

texts: I am using a Recursive least square adaptive filter to process electromyography signals and it is working decently so far. I decided to implement an LMS adaptive filter as a noise cancellation, so that I can compare the results, however, going through the matlab documentation for the LMS filter and seeing the LeakingFactor $$0<\alpha<1$$ and the ForgettingFactor of the RLS filter$$0<\lambda<1$$ I am now confused if there is an actual difference between those two parameters or is the difference only in the names?


texts: How can you tell whether there's a signal (when your signal looks a lot like noise)?

texts:
This is my snoring detector again.
I've gotten pretty good at detecting a signal when there's anything there -- can track from a wall-peeling snore down to breathing you can't even hear in the recording.  The problem is, I can't tell when the signal has dropped below detectable level and the app is just "hearing things".  And, unfortunately, snoring/breathing is often irregular enough that a simple autocorrelation or similar interval timing scheme is unlikely to help much.  (And it's actually likely that in some cases the noise is more regular than the breathing.)
So, are there any tricks I'm missing for figuring out when there is no signal?  It kind of seems that I'm up against a hard place here, given the "signal" is so noise-like to begin with.
(And maybe this is related to another problem I'm having:  Strangely, I can't accurately (or even approximately) measure the signal level even when fairly loud.  Since I need to use rolling averages and ratios to detect the signal anyway, the level information kind of gets lost.  I'm looking for some tricks to reconstitute it.)
Basic technique
(For Yoda)
The audio signal is sampled (generally at 8000Hz, for various reasons), then FFTed in 1024 blocks.  (In my experiments Hamming filters and overlapping blocks seem to have little effect, though those may be revisited later.)
The FFT is divided into "bands" (currently 5, slightly skewed in size to place more detail on the low end) and the "spectral difference" and level of each band is summed.  Long-term averages of the peak-limited values are used as "thresholds", and further bias adjustments are used to maintain a roughly 20% "over threshold" rate.
Each "over threshold" value is given a weight of 1 (under threshold is given a weight of 0), but then that weight is adjusted by the apparent "variability" (at roughly 2Hz) in the band, to give more weight to bands that carry more apparent signal.
The weights of the bands are summed and then the summed weights of subsequent blocks are summed over about a second to produce a running "score".  This is again compared to a running average threshold (plus several heuristics) to detect snore onset/offset.
Update
It suddenly occurred to me that if my algorithm effectively maintains a constant-level signal (per my signal level problem), the way to effectively gauge SNR is by measuring the noise when there's no signal.
Conveniently, snores are intermittent, with lots of "dead air" in-between.  And I'm already detecting the snore envelopes.  So anything outside of the envelope (between the end of one snore and the start of the next) is presumably noise!  This I can (with some modest degree of accuracy/repeatability) measure.  (It took three tries to come up with a halfway decent algorithm, of course -- reality never matches the theory.)
So I don't have the full answer yet, but I've made progress.
(While the above technique gives me a fairly good proxy for SNR, I'm still having trouble estimating actual signal level.  My "relative level" indications can be off the scale for a barely audible breath and so-so for a window rattler.  I need some sort of proxy for absolute level.)


texts:
In MIMO systems we have:
$y=Hx+n$ with $H$ is a matrix $N_r \times N_t$.

But the previous equation is only true for non-frequency selective channels.

What is the formula for frequency-selective channels?

Normally, $y=h \star x +n$. But if H is a matrix, we can not the convolution. How to solve this problem


texts: Amplitude of the fft is less than what is expected

texts:
This is my MATLAB code
Amp = 0.3;
freqHz = 1000;
fsHz = 160000;
dt = 1/fsHz;
t = 0:dt:2000*dt;
sine = Amp * sin(2*pi*freqHz*t);
t = 0:2000
subplot(2,2,1)
plot(t,sine)

y1 = sine;
Fs = 160000;                   % samples per second
N = length(y1);            % samples
dF = Fs/N;                 % hertz per sample
f = -Fs/2:dF:Fs/2-dF + (dF/2)*mod(N,2);      % hertz
Y1_fft = fftshift(fft(y1))/N;
subplot(2,2,2)
plot(f , (abs(Y1_fft)) - min((abs(Y1_fft))));
legend(num2str(i))
shg;

and this is the result:

The amplitude of my sin is 0.3 so I expect to get the FFT signal with the amplitude of 0.15 at 1Khz while I get 0.096 as the amplitude. My goal is to extract the amplitude of a tone among different frequencies.


texts: Why must the angle contain $\pi$ for $\cos$ be periodic?

texts:
The $\cos(\frac{n}{6})$ is aperiodic, and $\cos(\frac{n\pi}{6})$ is periodic, why? What role does the $\pi$ play? By the way, $n$ must be integer

I have seen this question,Why is cos(n/6) aperiodic? but the answer just show that it is not of the form $2\pi(mN)$,but it did't explain why should that $\pi$ exist,and the comment below said that we can't find the next larger (integer) value of n such that $\cos(\frac{n}{6})=1$ after $n=0$, however, yes we can, the $n=360 \times 6$ can let $\cos$ value back to the $0$ again. So, I want to ask why must the $\pi$ exist to let $\cos$ be a periodic?


texts: Good methods for hardware based 1-2 word speaker independent speech recognition?

texts:
I want to detect, in real-time, a 1-2 word spoken phrase within continuous speech, speaker independently, in hardware. The smaller the number of gates the better.

What is the best way to do this? Are the requirements feasible?


texts: What is the purpose of the filtering the image data in the PNG file format

texts:
I am reading the W3C description of the PNG file format, in particular section $9$ on filtering. The filter functions:

None(x) : the identity filter
Sub(x) : subtract the pixel value of $x$ by the pixel value in the position immediately before x
Up(x):   subtract the pixel value of $x$ by the pixel value in the scanline before the scanline containing $x$
Average(x): Subtract the pixel value of $x$ by the mean of the subtracted values described in Su and Up
Path(x) : Substract the pixel value of $x$ by the result of the Paeth Predicator at three values, see the spec.

are applied to different scanlines of an image; the filter function is applied to each pixel in a line.
It is stated without justification that:

Filtering transforms the PNG image with the goal of improving compression

My question is why does applying these filters improve compression?


texts: why derivative and logarithm operators amplify the noise effects?

texts:
It is said, do not use derivative operator in a the control system. because it will amplify the noise effect. Can someone explain it and give some mathematical reference about it please?
Also I heard, we shouldn't use logarithm operator too, for the same reason. How come?
Thanks in advance.


texts:
Envelope variation due to filtering of a QPSK signal becomes more pronounced at greater phase steps.
Why is that? Why do greater phase steps (180 vs 90 degrees for example) lead to more pronounced envelope variations?


texts: Dominant Orientation using Fourier Power Spectrum

texts:
I have been using Fourier Transform Power Spectrum for estimating the dominant direction in some images.

However, I am now working on extremely small images of size 8X8 pixel and I have found that even at this level there is some result regarding the dominant orientation of the image. As the image size is 8X8, the total number of pixel will be 64 and as shown in the figure below, there will be less number of angles.

I have simply done polar conversion  of the Fourier Transform Power Spectrum of the image which will be of same size (8X8), then I have taken the summation of the intensity for each angle and plotted them against the angle.

Now, from the plot I can find the maximum angle but I want to increase the accuracy of my result. I will first find the dominant direction of an image (a medical image) and then I will find the changes in the diseased state.

Thank you so much for your help.


texts: I am working on bearing faults.I did the high pass filter and then calculated the envelope of the signal in the time domain. I then found its fourier. The fft spectrum is still not clear. My fundamental frequencies are not visible clearly. Do i need to filter it further?


texts: Does it make sense to apply convolution in the frequency dimension of a fourier transformed signal?

texts:
What I have is more likely a theoretical question. Since I am not from a signal processing background it is hard for me to grasp the issue in using convolution in the frequency dimension of a Fourier transformed signal.

What I am trying to do is apply 3D convolution (in a 3D convolution neural network) for a set of Fourier transformed signals recorded by a set of electrodes. The 3 dimensions are the frequency dimension and 2 spatial dimensions of electrodes (x and y).

I understand that what I am trying to achieve is for the model to learn frequency patterns. However, my colleagues feel there's something theoretically wrong in this approach because unlike in time domain, it might not be intuitive to compare among frequencies. I'd value any opinion in this regard or an explanation as to why it is wrong.


texts: Is there any way that we can perform speech recognition without using Fourier transforms?

texts: I am trying to research about speech recognition and why everyone uses Fourier transforms in going about the topic. I know that we get information related to the frequency of each sound uttered which is extremely important in the process, however I wanted to know if the amplitude of a sound wave can be used in order to recognize phonemes and the information related to a spoken word.


texts: Phase delay between two signal using FFT

texts:
I am working in calculating the phase delay between two signals. The signals are sent through the same transmitter and received in two different receivers.
They have many frequencies, but with a primary one. I need to calculate the phase delay at the maximum value. The FFT magnitude gives me the main frequency component. I can calculate the phase difference at any exact frequency bin around the max freq if I use the same freq for both signals.
B
elow are the FFT magnitude and phase.

As you can see the phase at maximum freq is always located at a peak. Any small change because of noise gives a big error.
When I unwrap the phase the difference is very big.
Is this the correct approach? Any idea of how to deal with this?
Thank you


texts: Difference Between Iteratively Reweighted Least Squares (IRLS) and Sequential Quadratic Programming?

texts:
Part of my work is concerned with applications in Sparse Bayesian Learning and therefore I occasionally stumble over interesting papers in the field of compressed sensing.

I recently read Iteratively Reweighted Algorithms for Compressive Sensing by Rick Chartrand and Wotao Yin (Available also on DocDroid).

The paper describes how using $ {L}_{p} $ -norms with $ p < 1 $ can be used to recover signals with fewer measurements than with the LASSO ($ {L}_{1} $ Regularization).
There is even a Wikipedia entry on Iteratively Reweighted Least Squares (IRLS).

However, I can't wrap my head around the difference between IRLS and Sequential Quadratic Programming (SQP). Is there any difference? The papers I have found on IRLS never mention SQP..

Many thanks in advance!


texts: Motion and Distortion Estimation using multiple still images?

texts:
TL/DR: I'd like to take the median of lots of images to make a single "better" image.  The problem is, the camera is slowly moving, and there is significant lens distortion.  On the plus side the motion is constant, I've got lots of images, timestamps on each image, and I've been able to track points across the images to help align them.

I have a large 2000 frame series of night sky images taken from a GoPro Hero3. Which is in itself silly because GoPros have bad low light performance. I've done some light math on the images, and identified star position "arcs" over the 2 hour period.

Is there a way, using the star movement, to solve for the distortion of the lens AND the star rotation? Perhaps using OpenCV, or barrel distortion correction formulas?  Star rotation alone is easy - 1 rotation every 24 hours.  But generating the formula of (x1, y1) = f(x0, y0, num_minutes) is hard given I don't have the north star identified, the camera has a fish-eye effect, etc.

I feel like there should be a generic way to solve the pixel offset equation, regardless of the interaction between the lens distortion and star rotation. Any ideas? I believe I have all the info needed, about 30k data points across 250 stars of: (star_id, time, x, y) with good coverage, see the fast graph image below.  (I'd chop off the left side where some trees stayed still.)


texts: Interpolating the peak of a cross-correlation using a centroid

texts:
Forgive me if this question is poorly worded, I'm not sure if centroid is the word to use here.

Say I want to interpolate the peak of a cross-correlation function in order to get sub-sample delays. I can fit a parabola with three points, or simply upsample my signal through zero-padding/sinc-interpolation. However, I haven't seen any comments (or found any literature) on using some sort of weighted average on the main peak.

In case it's unclear, i mean performing the following:

Finding the maximum of the cross-correlation in order to get a coarse estimate.
$$
\hat{D} = argmax(R_{12})
$$
Taking the P nearest neighbors (where [-P,P] corresponds to the central peak area) and doing the following fine estimate

$$
\hat{d} = \frac{\sum_{k =-P}^P kR_{12}(k)}{\sum_{k=-P}^PR_{12}(k)}
$$

I've tested it for a gaussian distributed, infinite snr signal, critically sampled (so peak is only three samples. Centroid, (yellow) versus some sinc interpolation (purple) and parabolic fitting (orange), and it seems to offer good performance.

It appears to have less maximum bias, despite the discontinuity.
I also tested it with noise and the results were also okay. I get that this requires knowledge of the signal A.C.F. beforehand whereas fitting a parabola doesn't, but is there any other reason why this method is not seen in the literature?

Either way, I'm finding it somewhat advantageous in my application (also not sure wh), so I would like to read some more formal studies or descriptions of the technique. My background is not signal processing, so I'm afraid I'm overlooking some severe shortcoming.

NOTE: I also tested the mean-square error. It seems to perform much worse there,
 but as I said, for my use case it seems to perform well. . (The black line is the cramer-rao lower bound. Not sure why the parabola goes below it, probably because it's a biased estimator...)

EDIT: Signal example of the application (this picture has quite a lot of distortion of the delayed signal, but it's what I have at hand currently).


texts:
Usually ASR systems are evaluated using WER (word error rate), which summarizes 3 types of changes when calculating the edit distance: insertions, deletions and substitutions. According to the wikipedia page, there are two versions:

A. each type is given the same score: 1, 1, 1 (S, D, I)

B. Hunt's version: 1, 0.5, 0.5

I've noticed that sclite has it's own weights

C. sclite: 4, 3, 3

What are the use cases for each weighting scheme? My goal is to compare different speech recognition APIs.


texts:
What is the meaning of $Ta_k$ of fourier series or transform?
I am taking a course on signal and systems.

In 286 page of my textbook, it says that as T becomes arbitrarily large the original periodic square wave approaches a rectangular pulse.
Also it says that all that remains in the time domain is an aperiodic signal corresponding to one period of the square wave.
(textbook: siganls and systems sencond edition, author: oppenheim)

I have a difficulty understanding this.. I can't connect this idea with fourier transform.

I suggest a link http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-003-signals-and-systems-fall-2011/lecture-videos-and-slides/MIT6_003F11_lec16.pdf


texts: i am working on characterization of noise in an experimental signal from an accelerometer, mounted on a beam. Normally, white gaussian noise is considered by several researchers to add noise in the simulated model. I want to find out, what is the noise type in real scenarios, whether it is gaussian or non-gaussian.


texts: Identify Where Singing Starts in a Voice Only Recording

texts:
I have a little karaoke-style app where a user sings 4 lines of a song, with a one second gap between each line.  There is no backing music, so it's voice only, hopefully making the problem easier to solve.

I am looking for the most robust way to detect exactly where in my recording the user starts and ends singing line 1, starts and ends singing line 2, etc.

I have cobbled together a simple-minded algorithm that works when there is very little background noise in the recording (like when does that happen?), but it falls to pieces in the presence of the smallest noise.

Can anybody point me towards something more robust?


texts: Trying to understand downsampling and then upsampling

texts:
I am trying to understand how this works, specifically, what the DTFT of each step looks like in each step of the chain (for understanding). I am not looking for an answer like because the input signal has a frequency of $\pi/3$, it will be reconstructed correctly.

I plotted the DTFT of each step in MATLAB and simply don't understand the result. (DTFT of $x_d[n]$ and $x_r[n]$)

I would also like to know what the transfer functions of the downsampler and upsampler are.

The following pictures shows the DTFT of $x[n]$, $x_d[n]$ and $x_e[n]$ respectively

I don't know where the frequency components in the upsampled signal ($x_e[n]$) are coming from. I have noticed though, that it is what you would get if you convolved the original signal ($x[n]$) with an impulse train with period $2\pi/3$.

PS: Why is there no DTFT tag on this site?


texts: Is resizing of frequency spectrum a valid method of resampling?

texts:
One method of resampling is to perform a Fourier Transform on a signal, resize the resulting frequency spectrum, and then return to the resampled version of the signal with an inverse fourier transform.
Is this a method used in practice?
Are there methods that perform better down/upsampling (it terms of interpolation error)?
Are there faster methods?


texts: How to estimate the signal-to-noise ratio of a waveform?

texts:
I have a signal: $f_i(t_i=i\Delta t)$, where $i = 0\ldots n-1$.

The signal seems to vary quickly around a slower varying "trend". I am assuming that the quickly varying part is noise and the slowly varying part is the real signal.

How do I estimate the signal-to-noise ratio (SNR) of the signal?

I guess that if I could decide on a treshold frequency: $\omega_t$ I could use the following expression:

$$S/N=\frac{\displaystyle\int_0^{\omega_t}|F(\omega)|^2}{\displaystyle\int_{\omega_t}^{\infty}|F(\omega)|^2}$$
where $F$ denotes the Fourier transform of $f(t)$.


texts: Is there any simple algorithm to convert a sound source in 3d to volume and panning

texts:
I'm looking for a simple algorithm which calculates an approximation of volume and pan at the position of the camera from the following 3d data:

Camera (position and look direction)
An item which emits mono-audio at a specific position.

Just a basic approximation is enough for this case.


texts: Is it necessary to use filter bank in MFCC process? Can anyone explain what is the Mel filter? I know that frequency in hertz is converted into Mel scale but is this formula can be directly applied after the Fourier transformation of the speech signal? Why the filter bank is needed?


texts: Local Image Features Extraction for Road Signs

texts:
I'm working on a project to detect a road sign from the Image. Consider the sample image below:

I'm using a heuristic search to detect the road sign within an image. Basically, I want some weak features (colour, shape, zero symmetry within road signs) which can be calculated very fast and their weighted average can be used recognize the road sign.

Currently, I'm searching the entire image to find the road sign which could be of different scale. Since the domain of search is a lot, I tried to reduce it bu by using some heuristics:

Location of sign detect in previous frame (its mostly likely to be near)
Road signs are usually on right sign
Road sign contains enough white pixels

But eventually search needs to stop when it finds the region that contains a road sign. For this purpose, I'm relying on some fast and robust local features that predicts likelihood of containing road sign within given region of an image. Currently, I'm relying mainly on colour and some region props that Matlab provides.

I tried looking for lines and corners within edge map of the region even tried thresholding and looking for rectangle using morphology. But seems like they are too binary either its YES or its NO. In fact in most cases it fails, so my questions what are some nice local features that I could rely on to detect road sign?

I would really appreciate if somebody you guide in the right direction or provide some links or papers that could be helpful for this problem.


texts: Doppler frequency when down-converting a receiving signal

texts:
Suppose we have a monostatic radar system, with only one target crossing at a speed $v$ at the main lobe of the antenna. The Doppler frequency for this case will be given by

$
f_d = \frac{2v}{\lambda} = \frac{2v \cdot f}{c}
$

With $f$ being the carrier frequency of the received signal. However, if we downconvert, $f = 0$, which would give a $f_d = 0$, which does not sound right to me. So, how does downconversion affect the Doppler signature?


texts: I have the Fourier transform $S(\nu)$. If I oversample by a factor $R$ in the frequency domain. Does the duration of the signal $s(t)=IFFT(S(\nu))$ change?


texts: What is the effect of wiping the right half of Fourier Transform bins?

texts:
I'm trying to change the pitch of a signal using a Fourier Transform (FFT) followed by an Inverse Fourier Transform (IFFT).
I've found many examples, some of which zero out the right half of the real and imaginary bins before changing the pitch. For example, if the signal was $8192$ bins, the real and imaginary parts from $4096$ to $8192$ are set to $0$. This seems to make the math for pitch changing easier, but reduces the volume by one half. This seems to be corrected by doubling the magnitude.
I'm wondering what effect wiping the right half of the bins has on the final signal, apart from reducing the volume. I am confused why these bins exist if they can be wiped without affecting the final signal too much.


texts:
i have an image I of size 32*32. I perform the DCT of this image using the matlab function DCT2(I). I get a sparse representation of my image which is again a 32*32 image. I construct a circulant matrix A of size 200*1024, i.e i need only 200 samples out of the total 1024. Mathematically spaeaking, what i did is
                      take my original signal x, sparsify using dct2 call it B, then compress is using A. So i get measurements y=A.B.x . Now how do i calculate the incoherence measure from A and B. Can somebody help.


texts: Looking for a simple and effective notch filter

texts:
I ran a finite-difference simulation and the behavior of an output signal, $s$, in time, $t$ (sampled with period $\Delta t$) behaves approximately as in the figure below. It is well-described by a slowly-varying pulse plus a rapidly oscillating signal of the same envelope with lower amplitude.

For concreteness, I computed this sample signal in MATLAB with the following code.

f_noise = 20;
t = linspace(-4,4,2e3);
signal = exp(-t.^2);
noise = 0.25*exp(-t.^2).*sin(2*pi*f_noise*t);
signal_w_noise = signal + noise;

I emphasize that this is just a sample signal and not the actual data I want to analyze.

I wish to compute the "time-average" of the signal. By this I mean the signal without the rapidly oscillating component (which we could call noise). To get a clear picture of the problem, I calculated the Fourier transform of the signal approximately using MATLAB's fft function and obtained the spectra below.

From this plot, I suspect a notch-filter could do the trick. However, I know very little of signal processing and I know how to use first-order filters from undergraduate electric-circuit courses. What is a simple to use but effective notch-filter I could use? I am particularly looking for the transfer function in the frequency domain of such notch-filter, because the software I use to generate the data is equipped with a FFT algorithm, so I'd like to do the processing there and avoid exporting the whole data to, say, MATLAB.


texts:
I am designing a fractional delay filter, I found this code for lagrange FIR fractional delay filter, The fractional delay filter acts as a low pass filter, it passes low frequencies from 0 to 0.25*fs. But I want a Bandpass fractional delay filter which passes higher frequencies from 0.25*fs to 0.5*fs. I also want the phase response to be linear and equal to zero at 0.25*fs.
Could you please help me how can I get a bandpass fractional delay filter.
Thanks

function h = lagrange(L,x)

% HLAGR2

% MATLAB m-file for fractional delay approximation

% by LAGRANGE INTERPOLATION method

% h = lagrange(L,x) returns a length L (real) FIR

% filter which approximates the fractional delay

% of x samples.

% Input: L = filter length (filter order N = L-1)

%        x = fractional delay (0 < x <= 1)

% Output: Filter coefficient vector h(1)...h(L)

% Subroutines: standard MATLAB functions

%

% Timo Laakso 27.12.1992

% Revised 14.01.1996 by Timo Laakso

%         17.01.1996 by Vesa Valimaki

N = L-1;                    % filter order

M = N/2;                    % middle value

if (M-round(M))==0 D=x+M;   % integer part closest to middle

else D=x+M-0.5; end;

%

h=ones(1,(N+1));

%

for n=0:N

n1=n+1;

for k=0:N

if (k~=n)

  h(n1) = h(n1)*(D-k)/(n-k);

end  % if

end; % for k

end; % for n

end


texts: Is image padding really necessary while using a filter?

texts:
I do know that we must pad an image while using a filter. But what I am suggesting is that is it really necessary? Can't we just calculate at run time if the current cell/pixel is an edge cell/pixel and then use the padding value directly over there. It might add an overhead to the function but so does the entire padding function.

Only reason I think the padding function should be used is if the padded version of original image is going to be used in many different function which will overtake the overhead of dynamically calculating the edge cell/pixel values(which might never occur). Am I wrong?


texts: What is the difference between image restoration and image reconstruction?

texts: I am new to image processing. I don't know whether this is the right place to ask, but what is the difference between image restoration and image reconstruction?


texts:
Question is about  "channel capacity" http://en.wikipedia.org/wiki/Channel_capacity
I guess it is pretty elementary for experts, however I have not seen it discussed in
e.g. Proakis book or Tse "Fundamentals of Wireless Com".

Question (roughly speaking):  is channel capacity is known for the fading channel with "pilots" ?
(discrete, memoryless channel).
"pilots" - means we transmit on certain positions symbols known to receiver and transmitter both. It is common for all modern telecommunication standards GSM, UMTS, LTE to have "pilots".

What is the literature where it is discussed ?

More precisely let us consider the following signal model ("block" fading)

$r_i = h s_i + n_i, $

where $i=1...N$ , h - is random, but constant on Block, $n_i$ is gaussian noise.
(its variance can be 1) known to us 2) uknown to us)
Assume we have K-"pilots"  i.e. we send symbols $s_1=1$ ... $s_K=1$.


texts: How does the RaspberryPi radio hack convert digital GPIO signals to an FM signal?

texts:
After having looked at various explanation of how the RaspberryPi FM transmitter hack works, I realize there are some fundamental pieces missing. Most explanations talk about how to construct a digital signal from an analog one by Fourier's theorem, but never how the digital GPIO (3.3 Vpp) is constructed and used to modulate an FM signal.

How the reverse operation is obtained, if even necessary?
How is the digital carrier used (it's frequency)
How is the "analog" audio modulated on top of that?

I think a picture or more of how the resulting FM signal is built by the non-amplitude varied digital signal would be a helpful answer. I wish I had a proper DSO to see this myself, but I don't.

Note: In that hack audio transmission can be made specifically in the 1-250 MHz region, but the harmonics can be clearly heard all the way up into 1.1 GHz region. From comments here.

The closest explanation I can find is that of using PWM to Analog like in this picture:

(Figure 11.5. Credit: Mark Fedkin modified after Dunlop, 2010)

But this doesn't halp much since it doesn't explain how the other half of the sine wave (the negative values) are generated?


texts: Can anyone suggests some basic readings for video processing?

texts: Actually, I am new to this field and would like to work on a project in Video processing. I have a little background in Image processing but would like to study further in video processing. So, If anyone could suggest some readings as pre-requisites for video processing.


texts:
DSD is 1bit PWM Sigma Delta audio format.In PCM that dont have dithering,silence looks like samples with 0 value,I wonder,what does DSD silence looks like.Is it just series of 0 value samples,or does it switch between 0 and 1 constantly,third option,it changes between 0 and 1,but not constantly,more in noisy random way.

Many DACs these days use are multibit sigma delta,how does multibit sigma delta silence looks like?


texts: FIR filter design with frequency sampling method - setting proper phase response for IDFT

texts:
I'd like to implement freuqency sampling method for linear phase FIR filter design using IDFT transform.

My procedure goes like this :

determine desired magnitude response value in frequency points
I add linear phase response function with group delay (N-1)/2 to get complex frequency response values and equidistant points in frequency
use IDFT to calculate system's impulse response.

This approach works for odd-length FIR filter but I have problems with even-length FIR filters - I just don't  get proper result.

I guess I'm doing something wrong maybe with phase function or something else - but what ?

Thanks in advance,
regards,
Bul.


texts:
I have the following question about the maximum likelihood (ML) in presence of inter-symbol interference and colored noise.

Assume the communication system is as follows. Information source, modulator, transmit pulse filtering, channel, AWGN, matched receiver pulse filtering, sampler, and then ML estimator.

The received signal after the sampler is given as

$$y = h\star h\star c\:a + n\star h$$

where $y$ is the received samples (contains transmit symbols + ISI + noise), $a$ is the transmit symbols, $h$ transmit/receive pulse shaping filter, $c$ is the channel impulse response, $n$ is the AWGN, and $\star$ denotes convolution. This can be further written as

$$y = A\:a + \eta$$

where $A$ is a convolution matrix whose elements contains $h\star h\star c$ and $\eta$ is a colored noise.

I wonder what will be the ML in this case?
And how to derive/calculate it?

Thanks.


texts:
I want to implement a AC Voltage measurement function for a DMM. That DMM can sample up to 1,000,000 Samples/s.
With the sampling function I wanted to sample an input sigal (e.g. sine signal) and measure/calculate the RMS value.
Since the formula for the RMS calculation in known, that part is not a problem.

My question is, how do I choose the right sampling rate and the number of samples? For different signal frequencies I need different sampling rates and different sample sizes (considering  the Shannon Theorem and the duration of the sampling process). In my case, I'd like to be able to measure the RMS of signal from 50Hz up to 500kHz.

Is there a certain standard how to implement such a function?


texts: Why are window functions used when calculating spectral estimates, really?

texts:
Having just read the rather long article on Wikipedia about window functions, I still do not see the mathematical point in using window functions when calculating spectral estimates (using e.g. Welch's method).

For example,

  The Fourier transform of the function cos ωt is zero, except at frequency ±ω. However, many other functions and waveforms do not have convenient closed form transforms

what is this supposed to mean? I doubt any sampled and digitized signal has a convenient closed form transform anymore.


texts: Video: Detecting a digital timer and when it ticks

texts:
Input: A video with a digital timer, possibly several hours long, such as this video. The timer might use any font or color, and might be located anywhere on the video, but it probably won't fill the entire screen.

Output: A list of time indices when the timer starts and stops, it might start and stop multiple times. For example:

Timer 1: Starts off paused, starts at 0h20m32s, stops at 2h30m04s, ends up being paused.
Timer 2: Starts off ticking, stops at 0h04m00s, starts at 0h06m38s, stops at 0h32m01s, end up being paused.

Possible frames from different input video files:

How might this be achieved? In particular, what algorithms could be used to categorize the data? How would could you detect a timer that might be everywhere, of any color or font size?


texts:
I am doing a personal project which aims to detect infant cry. I have an infant cry audio database and extracted the MFCC from these files using MATLAB. I've come up with 12 coefficients for each frame the audio was divided into.
My goal is to compare audio obtained from a microphone with the training data (MFCC from the samples). I figured I would split the audio input data into frames and then compare each frame with the training data using a k-NN classifier. My question is how to, in fact, train the k-NN classifier, since I have many samples to compare with. I mean, what should I compare the frames from the input data to?

Thanks,


texts: SPL values from FFT of microphone signal

texts:
I am trying to get a frequency response vs dB SPL plot for recorded sounds. I have a microphone with a flat response, a sensitivity of 4mV/Pa, and 1 Pa = 94dB.

To get the dB SPL, I have the following formula:

$dB SPL = 94 + 20 \cdot \log_{10}(AI/0.004)$

where AI in the input voltage from the microphone, and assuming no gain.

This seems to work to get the overall dB SPL level for the signal, using peak voltage as AI.

My question is, how can I apply this to an FFT of the input signal, to get the intensity level per frequency?

I saw this post, and am not sure how to adapt this to input voltage.

Here is some python code to demonstrate what I have thus far, my goal is to apply this to ultrasonic signals that contain many different frequency components.

import numpy as np

fs = 5e5
duration = 1
npts = fs*duration
t = np.arange(npts, dtype=float)/fs
f = 1000
amp = 1.414*0.004
signal = amp * np.sin((f*duration) * np.linspace(0, 2*np.pi, npts))

rms = np.sqrt(np.mean(signal**2))
dbspl = 94 + 20*np.log10(rms/0.004)

sp = np.fft.fft(signal)
freq = np.arange(npts)/(npts/fs)

sp_db = 94 + 20*np.log10(???)


texts:
Let's say I have a noise power-spectral-density (PSD) which is not flat and ranges from 0 to $f_1$ Hz in frequency. As we know, the total area under the PSD is equal to the total average power of the signal (according to Parseval's theorem). Let's say this value is $\sigma^2$. This means the value of the auto-correlation function at zero-time (which is the total power in the signal) will also be equal to $\sigma^2$.

Now assume we want to approximate the above colored noise with a band-limited (from 0 to $f_1$) white Gaussian noise with the same noise power (i.e. $\sigma^2$). That means the variance of the AWGN is $\sigma^2$, the auto-correlation function would be a delta function (i.e. $\sigma^2 * \delta(t)$) or more precisely a sinc() function, and the PSD would be flat (equal to $\sigma^2$) from 0 to $f_1$. The total area under the PSD should be equal to the total average power of the noise. The total area under the PSD in this case simply would be $\sigma^2 * f_1$ which is not equal to the initial assumption of the total power $\sigma^2$. What am I missing here? Should I consider the flat PSD value is $\sigma^2/ f_1$ instead of $\sigma^2$ (however this does not satisfy the auto-correlation vs PSD relation)?


texts: Determine whether a signal is increasing or decreasing over time

texts:
I have a signal (x-axis: Time, y-axis: Data) which has more than 10000 samples per second.
The signal itself represents some physical data (e.g. speed, acceleration, etc.) and has some noise on it.

Details about the considered signal:

The signal increases/decreases over the considered capture interval with a small gradient
Let's consider the case where the signal decreases:

Due to the arbitrary noise (which has a very small amplitude) it regularly happens that one (or more consecutive) samples are not smaller than their predecessor.
However due to the high sampling rate those deviations are just an issue for the evaluation routine (Python) trying to decide whether the signals is continously decreasing in the considered time interval.
For a human being, with optical inspection of the plot it is very clear that the signal is decreasing

What is the most robust way to determine, whether the signal is increasing or decreasing over time?

I thought about using a moving average filter but I am curious to know whether there is a more proper way to reach my goal.

Any answer is highly appreciated.


texts: $\mathcal Z$-transform of an equation [Exam question]: Verifying the solution

texts:
I'm studying for exams at the moment and I'm trying to reproduce a solution from my professor (I have the solutions). The following signal is given:

The excercise says:

  Calculate the Fourier transforms for i = 13 to 15 and N = 64.

The signal in the time domain looks like this (this is where I'm still on par with the solution):
$$
f(k) = \left( -\frac{1}{N}k + 1 \right)\left( \sigma(k) - \sigma(k-N) \right)
$$

The problem starts when trying to transform the whole thing to the $z$-domain. This is my take:
$$
f(k)=-\frac{1}{N}k\sigma(k) + \frac{1}{N}k\sigma(k-N) + \sigma(k) - \sigma(k-N)
$$
Corrected for delay:
$$
f(k)=-\frac{1}{N}k\sigma(k) + \frac{1}{N}(k-N)\sigma(k-N) + N\sigma(k-N) + \sigma(k) - \sigma(k-N)
$$

Transformed:
$$
F(z) = -\frac{z}{(z-1)^2}\frac{1}{N} + \frac{z}{(z-1)^2}\frac{1}{N}z^{-N} + \frac{z}{z-1}Nz^{-N} + \frac{z}{z-1} - \frac{z}{z-1}z^{-N}
$$

But the solution only gives me three summands and I can't figure out how he is able to simplify the rest of the equation (Being well aware that the solution given by the professor might be wrong). He states:

  \begin{align}
F(z) &= - \frac{1}{N}\frac{z}{(z-1)^2} + \frac{1}{N}\frac{z}{(z-1)^2}z^{-N} + \frac{z}{z-1}\\
F(z) &= \frac{z}{(z-1)^2}\left[-\frac{1}{N} + \frac{1}{N}z^{-N} + {z-1}\right]
\end{align}

What am I doing wrong / am I doing anything wrong?
Can you please sanity check me?


texts: Effect of sampling interval length and Gaussian noise on the frequency-spectrum

texts:
Suppose you have a signal $s(t)$, corrupted by Gaussian noise of $\eta(t)$ with zero mean and standard deviation $\sigma$. So that the measured signal is $f(t)=s(t)+\eta(t)$.

I now want to calculate the spectrum of the signal using FFT. For my particular case, I have found that for wavenumbers $q$ above a given cuttoff value $q_c$ (e.g. for short wavelengths), my spectrum of $s(t)$ will run into the noise floor of $\eta$. The noise floor due to the (ideal) Gaussian noise $\eta(t)$ in Fourier space is given by $\int \sigma^2 dt$ and thus depends on the length of sampling interval.

My question is:

Is it possible to modify the noise-floor of the frequency spectrum in Fourier space by reducing the length of the sampling interval in the time-domain and thus gain SNR for a certain $q$-range of interest? In other words, could I do something like high-pass filter the whole signal and then take the FFT of a short region to reduce the noise. Or perhaps do something similar.
If this is conceptually flawed, why?
If it is not flawed, how would I do this and what are the limits/tradeoffs to doing this (obviously there has to be a limit). Also, what are the implications/requirements for the stationarity vs. non-stationarity of signal $s(t)$ in order to justify this?


texts: basic hsb skin detection, neon illumination

texts:
i hope this is the right place to ask. otherways sorry for my mistake and pleace advice me a better site.

i'm trying to implement a super simple skin detector using some range of hsb image. i'm using approach described here and here.

i'm try to use a video source from my webcam. if i use sun illumination it works quite well (not so good but quite good), but with neon light.. it is a mess. a lot of white region are detected and a lot of noise everywhere.

why?

i'm using the algorithm described in the second source:

convert image ho HSV color space
put white on the range 0 < H < 38
dilate filter
erode filter
blur filter


texts: Fit a line pattern on curve with unknown number of points

texts:
I've got a sample curve which ends theoretically with decreasing exponential. The curve end falls into noise. The sample points are given in log scale.
What I want to do, is to find and fit the linear part of the log curve to retrieve the exponential factor. The trick is that I don't know the starting point neither the ending point of the linear part of the log curve.

The strategy I'm using is to fit a line at each point with at least say 20 points and until the end of the curve is reached. Then from all these regressions, I keep the one with the best determination coefficient.

I did several tests and found that the RMS error increases with the number of points systematically as the curve becomes more and more noisy, so the extracted factor is always computed on the minimum number of samples (20 in this example case).

My question is, is there a more efficient method to compute this factor ? Does increasing the minimum number of samples improve the accuracy of the fit ?

Here a sample curve I want to fit

The computed slope regarding the position in the curve

And the corresponding RMS error


texts: How Can I Detect Peaks and Regions of Highest Variance in a 1D Signal?

texts:
I'm not a signal processing person at all so hopefully I'm not asking an obvious question (if I am, I'd appreciate any resources that would help give more context).

I have a 1D vector where the values give temperature at some position. I want to find out where the regions of greatest change are and then mark off those regions for future sampling.

My current method is to take the gradient of the signal and either convolve that gradient with some window or average past signals (in time) with this current one. Both approaches are in an effort to reduce noise and/or overfitting to one particular signal in time. Once I get this smoothed signal, I fit a Gaussian function to it and mark off the regions that are within 4 standard deviations of the mean. (If there are multiple peaks, the hope is that the smoothing or convolution will make it smoothed enough so that the Gaussian will capture both peaks, but this fails sometimes which is why I'm looking for something more robust. An extension to this would be to try and fit multiple Gaussians as well, if it is a sensible idea in general.)

Here's a quick plot I was using to compare the different smoothing windows (the original signal is real data that I'm working with, which usually only has one large peak but may have more).

(Also, the convolution seems to center the peaks away from where they actually are. If there are no better solutions, how can I stop that from happening? EDIT: Peter K.'s comment helped me fix this silly error.)

But this is a pretty noob approach that I just came up with. Is there a better way? The places I want to sample around are obviously regions around local maxima, but defining what local maxima means seems to be tricky, and it doesn't always give great results. In general, though, I will want to sample continuously around the regions of peaks, i.e. if I have two peaks, one at 5m and one at 10m, I want to sample between, say, 2m and 13m, not chopping it in the middle. It may be worth noting that these signals are a snapshot in time, so perhaps I can take advantage of past signals as well somehow?

EDIT: As per @Phonon's suggestion, I thought I'd add some more detail about the problem. The signal is actually coming from a sensor that samples along a water column in a lake (the x-axis of the graph is depth, up to 40 meters). Seasonal changes and other variables (like wind speed, humidity, etc.) will create changes in this water column. What I'm trying to do is to figure out how to catch the most pertinent information using the least amount of energy (the sensor has to move up and down). So hence the approach to find the maximum gradient and threshold around it for sampling. However, I wonder if there is a better way. Another one I can think of is to look at how much the signal varies at various depths over time, and sample those regions. I was mainly wondering if there existed some standard methods to do this sort of thing already.


texts: Comparing 2 sinusoids: Discrete case vs Continuous case

texts:
I'm doing MIT's OCW course with Allan Oppenheim - "Signals and Systems".

I'm given 2 continuous signals$$x(t)=\cos[\omega_x(t+r_x)+\theta_x]\tag1$$ and $$y(t)=\cos[\omega_y(t+r_y)+\theta_y]\tag2$$

Assuming their phases are the same, the notes tell me that the signals are identical if $$\omega_x=\omega_y$$which is quite obvious.

Now, the discrete case:

Again, I'm given 2 signals $$x[n]=\cos[\Omega_x(n+P_x)+\theta_x]\tag3$$ and $$y[n]=\cos[\Omega_y(n+P_y)+\theta_y]\tag4$$

This time, assuming that the phases are the same, the notes say that the signals are identical if $$\Omega_x=\Omega_y+2\pi k \tag5$$

Why is the $2\pi k$ present in equation 5?


texts: Find the Autocorrelation and Cross Correlation of The Wiener Filter

texts:
I am dealing with a problem with Wiener filter. Assume the original function is $s(t)$ with observation $x(t) = s(t) + n(t)$. And $s(t)$ and $n(t)$ are WSS (wide sense stationary) and they are independent. Now I want to find the filter to estimate $h(t) = \frac{d s(t)}{dt}$.
The wiener filter involves finding the correlation functions. One step is to find $R_{x, h}$ which denotes the cross-correlation between the observations and the desired function.
Hence,  $R_{x, h}(\tau) = E\left[\left(s(t+\tau) + n(t+\tau)\right)h(t) \right] = E\left[s(t+\tau) h(t) \right]$ (indept.)
Also, how to find the autocorrelation function $R_{h, h}(\tau) $?
It seems that this involves partial integral, and finally we would arrive the solution involved with $t$. So is there any mistake in my solution?


texts: Maths behind why removing values from DFT is not a brick wall filter

texts:
I sort of understand that when removing values from a signals DFT is not the same as a brick wall filter since it will only zero the frequencies that are perfectly periodic. Other spectrum frequencies who are not exactly periodic will have their energies spread over the whole DFT result. Is this right?

I'd like to know how you can mathematically prove that zeroing frequencies is not a brick wall filter using the DFT and inverse DFT.


texts:
in radar systems how does one measure the precision and accuracy on a radar?
I'm confused with differen definitions in the references:

Richards define (Principles of Modern Radar: Basic Principles - Chapter 18):

Accuracy = Bias

Precision = Standard deviation

Skolnick define (Introduction to radar systems - Chapter 11):
Accuracy something related to noise and then compare the accuracy with RMS error (which makes sense in definition of richards sice RMS error = $\sqrt{bias^2+\sigma^2}$

Peebles (Radar principles - Chapter 10):

Accuracy = Variance

Which setting should I use in context of Radar Systems?

Thanks!


texts:
As shown underlined in attached photo
Overshoot is mentioned as 9%
I am confused in understanding it
It is 9% of error or size of jump(1)?


texts:
In the last paragraph of this article, the author gives an example of the DFT of a song and his window's resonant frequency. As he points out (and it is a bit intuitive), if he listens to this song, the window is not likely to break, despite the song's spectrum being centered around the natural frequency of the window.
The question is, if we are given a range of resonant frequencies (the "dangerous" range around the resonant frequency), can we decide whether "the window would break", so to speak, based on the DFT alone, without a physics model (and therefore regardless of the problem, i.e. a window, a vibrating wire, etc.)?
Also, if we have two different signals and we compute their DFTs, how does the real-world physical effect of those signals (say, on a window) compare to their difference in amplitude for the resonant frequency? That is, if the amplitudes are equal, are the effects on the window's vibrations also equal? If one amplitude is half the other one, are the vibrations proportional the amplitudes' ratio (1/2)?


texts:
I have to do a demonstration.
If we do the Parseval identity of the signals $x(t)$, $y(t)$ and $z(t)$ that go from $0$ to $T$ and that are real, we have:

$\int_{0}^{T} x(t)^2dt=\int_{-\infty}^{\infty}|X(f)|^2df$

$\int_{0}^{T} y(t)^2dt=\int_{-\infty}^{\infty}|Y(f)|^2df$

$\int_{0}^{T} z(t)^2dt=\int_{-\infty}^{\infty}|Z(f)|^2df$ (1)

If we sum up the these 3 equations, and we divide both sides by the interval $T$, we obtain:

$\frac{1}{T}\int_{0}^{T} (x(t)^2+y(t)^2+z(t)^2)dt=\frac{1}{T}\int_{-\infty}^{\infty}(|X(f)|^2+|Y(f)|^2+|Z(f)|^2)df$ (2)

Can you confirm me that everything is ok in this demonstration? I am trying to demonstrate this because my advisor says that since the PSD of the signals $x$, $y$, $z$, which are $S_{X}$, $S_{Y}$, $S_{Z}$, respect this relation:

$\int_{-\infty}^{\infty}(S_{X}(f)+S_{Y}(f)+S_{Z}(f))df=\frac{1}{T}\int_{0}^{T} (x(t)^2+y(t)^2+z(t)^2)dt$ (3)

then (and this is the point that is totally wrong for me) he says that $S_{X}+  S_{Y}+S_{Z}$ is the Fourier transform of  ( $x(t)^2 +y(t)^2+z(t)^2$):

$S_{X}+  S_{Y}+S_{Z} = \int_{-\infty}^{\infty}( x(t)^2 +y(t)^2+z(t)^2)\exp(-itf2\pi)dt$ (4)

this cannot be possible in my opinion. I already tried to show him the procedure that leads to the PSD of a signal etc. but he still believe (maybe because I am young, not expert and just arrived) that is true what he said.
So I am trying to do the above mentioned demonstration, saying that since $|X(f)|^2$ is different from the absolute value of the Fourier transform of $x(t)^2$, it cannot be contemporary true what it is stated in the eq. (4) and the application of the Parseval identity (2).

I beg you to tell me if my procedure is good. I want to convince him with something that is unassailable. (I am almost desperate, I have been trying to convince him that is wrong since 3 month ago)


texts: What is the right way to downsample using Fourier method?

texts:
I want to know what is the right way to downsample a sampled signal using Fourier transform as the implementation in scipy.signal.resample confuses me.

Reading through the code it first converts the signal to frequency domain, then discards the middle half of the frequencies (i.e. second and third quarters), then inverse-transform back to time domain. Therefore it is trying to keep the lowest and highest frequencies of the signal.

Due to Nyquist-Shannon we know that we cannot reconstruct a frequency of $f$ without at least $2f+1$ samples of the signal. Then when downsampling, shouldn't we instead discard the second half of the frequencies?

I already read some related answers but no one seems to address this specific question:

Scipy resample, "fourier method" explanation

Python's $\tt resample$ vs $\tt resample\_poly$ vs $\tt decimate$


texts: which is the relationship between domains (x and k) in FFT?

texts:
I need to plot an escalar field f(x,y) in an interval  xv= (xmin,xmax) in Nx steps and yv= (ymin,ymax) in Ny steps. I have the analytic formula of this field in terms of its Fourier transform, lets say F(a,b).

I have trouble sampling F in a correct kx / ky interval, so when I do f2=ifft(F) I can plot it in the xv /  yv interval. I can't find the correct relationship between x and kx intervals.

lets make it very simple

if

fx= exp(-a*abs(x))

whe know its fourier transform is

Fk=2*a./(a^2 + k.^2)

so, supose i only know Fk and want to recover fx only in the interval x=0:dx:L

first i should sample Fk in a proper interval wich depends on L and dx (wich i cant figure out ) , then make

f2=ifftshift(ifft(Fk))

if I plot plot(x,f2), it should be the same as plot(x,f).

here  is my code in matlab:

L=10;
dx=0.1;
x=0:dx:L ;
N=length(x);

dk=2*pi/L;
K=dk*(N-1);

k=0:dk:K ;

a=2;
fx= exp(-a*abs(x));
Fk=2*a./(a^2 + k.^2);
f2=fftshift(ifft(Fk));
figure
plot(x,real(f2),'or')
hold on
plot(x,fx)
grid on


texts: Downconversion / Demodulation of RF signal to DC

texts:
My question is around down conversion of a signal (e.g. RF) to DC and the affect of negative frequencies.

If I have a signal whos spectral content is say between 2-4kHz and I mix this with an intermediate frequency of 3kHz, ignoring the upper mirror, I now have a signal whos spectral content is centered around DC +- 1kHz with a bandwidth of 2kHz.

What does the signal at -1Khz to DC represent- I believe this is mirrored onto the DC-1kHz signal but does this create artifacts if the spectral content is asymmetric?


texts: Difference between MATLAB hough and my implementation

texts:
I am trying to recreate MATLAB's hough function with mine. My code follows

function [H,T,R] = my_hough(x,dr,dtheta)
    rows = size(x,1);
    cols = size(x,2);
    D = sqrt((rows - 1)^2 + (cols - 1)^2);
    Nr = 2*(ceil(D/dr)) + 1;
    diagonal = dr*ceil(D/dr);
    R = -diagonal:dr:diagonal;
    T = -90:dtheta:90-dtheta;
    Ntheta = length(T);
    H = zeros(Nr,Ntheta);
    for i = 1:Ntheta
        for n1 = 1:rows
            for n2 = 1:cols
                if x(n1,n2)==1
                    r = n2*cos(T(i)*pi/180) + n1*sin(T(i)*pi/180);
                    [~,j] = min(abs(R-ones(1,Nr)*r));
                    H(j,i) = H(j,i) + 1;
                end
            end
        end
    end
end

where dr and dtheta are distance and angle resolution. Printing the difference between my Hough table and MATLAB's there are many zeros, but there are also some non-zero elements. Any idea why this is happening?


texts: Examples of mixture of 'almost periodic' signals/data in nature or practice

texts:
I am working on algorithms to separate mixtures of 'almost periodic' signals. One such example is composite ECG consisting of maternal and fetal signal.

Can anyone help with examples of such signals? The signal can also be from internet data.


texts: change function from continuous to discrete

texts:
I have function that I want to sample with sampleing rate 20 Msamples/sec.

The funciton is the one below

$w_T(t)= \left\{ \begin{array}{ll}
         \sin^2(\frac{\pi}{2}(0.5+\frac{t}{T_{TR}})) & \mbox{if $-T_{TR}/2 < t<T_{RT}/2$};\\
        1 & \mbox{if $T_{TR}/2 < t<T-T_{TR}/2$}\\
 \sin^2(\frac{\pi}{2}(0.5-\frac{t-T}{T_{TR}})) & \mbox{if $T-T_{TR}/2 < t<T+T_{TR}/2$};\\
\end{array} \right. $

I saw the solution is

$w_T(n)=\left\{ \begin{array}{ll}
         1 & \mbox{if $1<n<79$};\\
        0.5 & \mbox{if $0,80$}.\end{array} \right. $

I tried to see why it so so I put $t=n T_s= n \frac{1}{20\times10^{-6}}$. It is also given that $T_{TR}= 100 ns$ and $T=4
\mu sec$. But i fail to reach the discrete funciton.

Is there any way to reach solution?


texts: Sharpen Defocused Image (Deconvolution / Image Restoration)

texts:
Using OCR, I want to extract text from product packages using Google Glass. However, because of the fixed focus of the camera the package pictures are blurred. Is there a way to sharpen the image? Currently I use unsharp masking to enlarge the gradients of the edges, which gives me OK results.

Is there a better way to do this? I thought about taking a picture of a point-spread-function and using this to deconvolve, but I doubt this gives me a good approximation of the distortion kernel.

Here is an example: