texts: Adaptive Predictive Coding: Transmit signal AND prediction coefficients

texts:
I'm not well versed in the literature so please forgive/inform me if my terminology is wrong:

I have a bounded real-valued, discrete-time signal $x_n \in \mathbb [0, 1]$, and I want to (lossily) transmit this signal via a bitstream $q_n \in \{0, 1\}$, so that it can be reconstructed into $\hat x_n$, and the average reconstruction error $\frac1N \sum_{n=1}^N (x_n - \hat x_n)^2$ is minimised.

$x_n$ will in general be temporally redundant, and I'd like to exploit this redundancy to make the most efficient use of my bits.  In my case, I expect $x_n$ to settle towards a fixed point for a long time and then suddenly jump towards a new fixed point (as you may expect from the trace of a single pixel in video).

Example Signal: It goes though "settling" phases where it remains fairly static, and "dynamic" phases where it transitions quickly towards a new settling point.

From what I gather, Predictive Coding is the standard approach here - subtract the predictable component of the signal, encode the rest, and reconstruct the predictable component on the other end.  The trouble is that the optimal predictive coding parameters (at least for a Linear Predictive Coder) will change depending on the state of the signal: When $x$ is dynamic, I expect to encode it at a coarse resolution.  When $x$ is static, I expect to use my bits to communicate fine increments to the value of $x$.  So I need to communicate my predictive coding coefficients along the same bitstream $q_n$.

Is there a standard approach for this kind of problem?


texts: Coefficient Cancelation on Particular Solution

texts:
I am stuck on a problem about finding the complete solution of a Discrete Linear System by using the parametrization $y_{c}(n) = y_{h}(n) + y_{p}(n)$ where $y_{h}(n)$ and $y_{p}(n)$ are, respectively, the homogenous and particular solutions.

The System, in this case, is given by the following difference equation:

$y(n) = y(n-2) + x(n) + x(n-2)$ $\{y(-2) = 1; y(-1) = -1\}$

The input sequence is $x(n) = n^{2}u(n-1)$.

I had no problems finding the homogenous solution. It was pretty straightforward. The next step would be to find the particular solution and then calculate the constants that appear on the homogenous solution. I chose a model for $y_{p}(n)$ by looking at a table, which, in this case, yielded: $y_{p}(n) = (K_{1}n^{2} + K_{2}n + K_{3})u(n-1)$

The problem was that after plugging this model on the system's difference equation and doing some algebra, the constant $K_{3}$ canceled out and I arrived at the following expression:

$-4K_{1} + 4nK_{1} + 2K_{2} = 2n^{2} - 4n + 4$

That was the first example where a constant got canceled and where I found no expressions of $K_{n}$ multiplying $n^{2}$, in order to create a linear system of equations and find the constants. My book hasn't yet talked about such cases, and I don't know how to proceed. Am I doing things right? How can I proceed in order to solve this problem? Thanks in advance.


texts: Why sampling rate is not an option with normalized frequency in Matlab Filter Designer

texts: My Matlab version is 2017b. When I use Filter designer with normalized frequency specifications, I cannot set the sampling rate. May you tell me why the sampling frequency cannot be specified? As I know, the normalized frequency mapped $[0,\pi]$ to $[0,1]$, so the sampling rate is not dropped out.


texts:
I want to find the direction of a sound source in 2D space. I use two microphones and one sound source for that. I have recorded audio data into two arrays. When a sound is detected, it starts to record data into arrays and stop the recording when no sound is detected. I am confusing about the next step.

How I take the cross-correlation of these two signals using python3?
How I find TDOA using that data?


texts: Anisotropic Diffusion Filter - Intuition Behind Parameters

texts:
I need to know what is iteration and divergence in anisotropic diffusion filter technique.

  Isotropic diffusion $$\frac{\partial I(x, y, z)}{\partial t}={\rm div}\left[c\cdot \nabla I\left(x, y, z\right)\right], \quad
\text{where } c \text{ is the diffusion coefficient}$$
  Anisotropic diffusion $$\frac{\partial I(x, y, z)}{\partial t}={\rm div}\left[g\left(\left\| I\left(x, y, z\right)\right\|\right)\cdot \nabla I\left(x, y, z\right)\right], \quad \text{where } g \text{ is the anisotropic diffusion coefficient }\textbf{(Edge stopping function)}$$

Here $t$ refers to iteration, what is this iteration ? How is it related to filtering ? I know that iteration refers to number of rounds but how it is related with filtering ?
Also explain to me why we use divergence in these equation what is the purpose of divergence.


texts: Understanding Asymptotic Equipartition Property

texts:
I have some problems in understanding the precise meaning of the Asymptotic Equipartition Property, related to a large number n of independent and identically distributed random variables (X1, X2, ..., Xn). Here an example is shown (here you may find the complete material):

I do not understand the precise difference between the sentences:

"Clearly, it is not true that all 2n sequences of length n have the same
probability."
"One might be able, however, to predict the probability of the sequence that is actually observed. The question is: what is the probability p(X1,X2,...,Xn) of the outcomes X1,X2,..., Xn, where X1,X2,..., Xn are i.i.d. according to p(x)"
"the typical set has probability close to 1, all the elements of the
typical set have same probability"

Then I read this sentence, which increases the confusion in my mind.


texts:
Why can we know the best precoding direction after we do the SVD to the channel?for example

$\mathbf y=\mathbf H\mathbf s+\mathbf n$,now we do the SVD to the $\mathbf H$

If the $\sigma _1$ is the biggest singular value,after we normalize $V_1$,why can we say the $V_1$ is the best precoding direction?Is there any theorem can prove this?


texts: SNR calculation with Noise Spectral Density

texts:
I am having difficulty in calculating the SNR for the following scenario:

In a cellular network

Transmit power=36dBm
Noise spectral density=-174dBm/Hz (AWGN)
Bandwidth=10MHz

I have some other parameters such as pathloss and Rayleigh fading, but I think my biggest problem is the conversion of dB to power.


texts: What is the Autocorrelation of the Impulse Response if the Magnitude of Frequency Response is >1

texts:
So by the DTFT pairs, if the magnitude of the frequency response of a signal is 1, then the autocorrelation is the Kroneker Delta Function.

What if I find that the magnitude of the frequency response of the system is greater than one?

Is the autocorrelation just the constant multiplied by the Kroneker Delta Function?


texts: Applying a filter on an audio signal with Python

texts:
Let's say I have a filter described by its transfer function:

$$
H(\omega) = \frac{1}{1 + j\frac{\omega}{\omega_0}}
$$

And I want to apply this filter to an audio signal (a .wav file) using Python. My initial idea was this:

Split the signal into fixed-size buffers of ~5000 samples each
For each buffer, compute its Fourier transform using numpy.fft.rfft
Apply my filter to the coefficients of the Fourier transform: ft[i] *= H(freq[i])
Compute the inverse Fourier transform of the result using numpy.fft.irfft
Join the buffers together into the output file

It seems like I am doing something wrong, because if I set H to a constant factor ($\neq 1$), then the sound gets completely noisy and unrecognizable. I also tried with different values for the buffer's size.

Here is my code:

import wave
import numpy, numpy.fft as fft
from math import *

inputFile = wave.open('input.wav', 'r')
outputFile = wave.open('output.wav', 'w')

params = inputFile.getparams()
sampleRate = params.framerate
bufferSize = 5000

outputFile.setparams(params)
samples = []

for i in range(params.nframes//bufferSize):
    signal = inputFile.readframes(bufferSize)
    ft = fft.rfft(signal)
    for i in range(1, ft.shape[0]):
        ft[i] *= 0.5 # This does not do what I want...
    ift = fft.irfft(ft)
    samples += list(map(lambda x: max(min(int(x), 255), 0), numpy.abs(ift)))

outputFile.setnframes(len(samples)//params.nchannels)
outputFile.writeframes(bytes(samples))

Thanks for your time and patience :)


texts:
At work we run a physics simulator (video game) that operates in an inner loop at 360 Hz.  Data from that inner loop is collected 60 times a second and sent out to hardware (a force feedback steering wheel) in order for playback to the user.

I have two questions on this system.

First what is the best way to decimate the 360 Hz data down to 60 Hz.  Right now we do a straight average of 6 samples together, but I suspect that this is causing some aliasing of the data and we are very sensitive to high frequency noise.  We are also extremely sensitive to latency and even adding in 4 samples of latency (in the 60 Hz loop) would cause a noticeable delay between the onscreen display and the force feedback device that the users would pick up on.

Second, the hardware (steering wheels) is typically made to very poor tolerances and usually has a difficult time playing back data above about 20 Hz before the signal significantly degrades.  Would it be better to low pass filter the 360 Hz data down to 20 Hz, or to low pass the 60 Hz data to 20 Hz, and what would be the most efficient way to handle this.

I currently have a single pole IIR filter that you can optionally define on the 60 Hz signal, this does smooth the data out, and adds in a considerable amount of latency as well.  Mixing less than 0.20 of the current sample causes an odd disconnected feeling in the wheel so that is my lower bound.  I would assume that going to a more complex filter would give me a much faster falloff and would both smooth out the high frequency chatter and noise in the wheel without increasing the latency beyond 4 samples (66 ms)

I'm half way through Steven W. Smiths book "The Scientists and Engineer's Guide to Digital Signal Processing" so I have a limited understanding of DSP's.  I do have 20+ years of programming experience in 2D image manipulation so I have been using dsp's all along without knowing what they were.  The point is go easy on my poor mind :)

I should also point out that the 60 Hz loop is running in 'real time' that is timed to the pc clock, and all communication with the wheel is also in real time, however the inner loop is processed 60 times a second and there is no way to get access to the inner loop data at a faster rate than 60 Hz.


texts: How to detect directional signal in three dimensions?

texts:
I have three orthogonal accelerometers that give accelerations in x,y and z dimensions. I'm trying to detect directional vibrations between certain frequencies.

In other words, my input is 3d vector and I would like detect signal coming from unknown direction, filter out noise from other directions and turn the signal into normal scalar for further processing.


texts: What windowed Sinc might be closest to a Parks–McClellan low-pass filter?

texts:
In another question on dsp.stackexchange, a statement was made that the output of MATLAB firpm() or firls() for an anti-alias low-pass filter was "close" to the coefficients of a windowed-Sinc low-pass filter.

If so:

What window (applied to a Sinc "perfect" reconstruction waveform) would provide low-filter kernel coefficients closest (In least squared error or other commonly used metric) to those of a same-length FIR filter designed by the Parks–McClellan or Remez-exchange methods?  Is it one of the well-known named window functions (Nuttall et.al.)?  Or is there a good numerical or tractable equation approximation to this window?


texts:
It's a beginner question, but useful to users from python - signal.lfilter, I was using lfilter from
Find reverse one pole lowpass filter

The doubt now is, how to rewrite the iir filter to 'revert' the low pass filter, without using lfilter function:

low pass:

y[i] = y[i-1] * 0.8702 + x[i] * 0.1298
y[i] = signal.lfilter(b,a,x)

low pass revert:

y[i] = y[i-1] * ?? + x[i] * ?? + ??
y[i] = signal.lfilter(a,b,x)


texts:
I have microphone array which records sound. There is one main sound which direction I know and some noises in the background. Now I want to selectively amplify sound from known direction. This looks like reverse problem of antenna signal beamforming. I tried to find some information on internet on how to do it but only information I found told that I need to shift sound signals from microphones. But Wikipedia says it works only for narrow band signals while my signal will be more complicated than single sinus.

I tried to search internet for beamforming but all I found is about EM waves and antennas. Are there some known methods to solve this problems?


texts: Please clarify the mandatory condition on Vestigial Sideband Modulation filter?

texts:
In VSB filter we have the Transfer function condition as $H(F-F_c)+H(F+F_c)=1$
So can we accept that for the range of $F$ in $(F-df,F_c)$ we have $H(F)$ and for $(F_c,F+dF)$ we have $A-H(-F)$  where $A=H(F_c)$.
I am learning Latex so need some time:(


texts: Difference between cv::subtract and operator - in cv::Mat OpenCV

texts:
What's the difference between cv::subtract and operator - in OpenCV?

Mat original = imread...;
Mat smoothed, difference, result;

smoothed - original image processed with Convolution with Gaussian kernel;

1)

difference = original - smoothed;

2)

cv::subtract(smoothed, original, difference);


texts: understanding discrete-time convolution in LTI systems

texts:
I'm trying to understand the discrete-time convolution for LTIs and its graphical representation. standard explanations (like: this one) start with the idea of decomposing an input signal $x[t]$ into a sum of unit impulses. We have unit impulse function $\delta$:
$$
\delta[n]=
\begin{cases}
    1,& \text{if}\ n = 0\\
    0,& \text{if}\ n\neq0
\end{cases}
$$

then $x[t]$ can be represented as:

$$x[t] = \sum_{k = -\infty}^{+\infty}x[k]\cdot\delta[t-k]$$

so the input signal at $t$, $x[t]$, can be represented this way because $\delta[t-k]$ is going to be 1 only if $t = k$, and 0 elsewhere. this makes great sense.

the confusion for me begins in Transparency 4.2 of above link. the left hand side makes perfect sense, but what does the right represent? how does one unit impulse generate a sequence of responses? what does $x[0]h[n]$ represent here? How do you go from this to Transparency 4.9 where $h$ is used instead of $\delta$?

put differently: can someone explain the intuition behind $h$ (the response of a an LTI system) being reflected and time shifted? in the above trick for representing simply the input signal $x[t]$, there's no time shifting really; $\delta[t-k]$ seems like just a mathematical trick for getting a $1$ in the right place and zero elsewhere; it's not intuitive for me to think of it as time shifted.

if we use the fact that in LTI, the response of a system to input $n$, $y[n]$, is just the superposition of the responses to unit impulses of input signal $x[n]$, why can't we write convolution this way instead?

$$y[n] = \sum_{k=-\infty}^{+\infty}x[k]h[n]$$


texts: Conceptual Question from Signal Processing - Impulse Response and AR Coefficients

texts:
In continuation to the previous question Conceptual questions from signal processing I have a doubt which is: Consider an Autoregressive model (AR(2)):
$$
y(t) = ay(t-1) + by(t-2)
$$

and a FIR (Moving Average, MA(2)) model

$$
x(t) = a\epsilon(t-1) + b\epsilon(t-2).
$$

According to the reply in the prev question, in time domain

$$
y[n] = h[n]\star x[n]
$$
$h$ is the impulse response.

Is there any relation between impulse response and the coefficients of AR and MA model?
What is the intuition of the coefficients and how do we get them?


texts: How to convert A/D data to the needed representation

texts:
I have an Analog-Digital Converter used for getting digital data from LoadCell scales.
In order to use this data in my formulas I need to convert that data to the millimeters.
But how do I do it?


texts: Beginner Question: Extracting Features for Image Classification

texts:
I'm a Python programmer, but a beginner to image processing :) Apologies if this isn't a suitable question for the forum, happy to rewrite or move.

I want to create a supervised classifier to distinguish between the two images in this album (or more generally, with more training data, this scene containing some pavement for available parking, and this scene containing no pavement).

My question is about how to extract features, using Pillow or scikit-image, that would be appropriate for classification.

Right now, I have skeleton code for an SVM classifier:

data = []
classes = []
for imagefile in glob.glob('./img/training/*/*.bmp'):
    data.append(extract_features(imagefile))
    if 'nospace' in imagefile:
        classes.append('nospace')
    else:
        classes.append('space')
clf = svm.SVC(gamma=0.001, C=100.)
clf.fit(data, classes)

And I have a very simple feature extraction method, which just returns a colour histogram for the image:

def extract_features(imagefile):
    im = Image.open(imagefile)
    width, height = im.size
    im = im.crop((0, int(height * 0.4), width, int(height * 0.8)))
    # Improve on just returning a colour histogram?
    return im.histogram()

The problem is that this doesn't give great results - particularly if the car is nearly the same colour as the tarmac, as in my example album.

I looked at edge detection. This seems to be quite easy to do with Pillow:

im.filter(ImageFilter.FIND_EDGES)

But just passing this in to the classifier also doesn't give great results - I'm guessing because I should turn it from a matrix of pixels into something more meaningful?

Could anyone suggest a good approach for extracting features for this problem? I think ideally I want to detect "blobs", i.e. cars.


texts: Downsampling an image by an integer factor

texts:
When downsampling an image by an integer factor $n$, the obvious method is to set the pixels of the output image to the average of the corresponding $n \times n$ blocks in the input image.

I remember vaguely having read somewhere that this method is not optimal (sorry I don't remember any details)

Is it true that there is a better method (and if so, where does the above method fail, although it seems "obviously" correct)? I do not know a lot about signal processing, this question just interests me.


texts: How to determine the "variability" in a frequency range?

texts:
This is a continuation of a previous question.
I'm trying to analyze breathing and snoring sounds, and while I can fairly well detect snoring now, breathing is a bigger challenge.
I've learned that if I break the analyzed frequency range (about 4KHz, sampled at about 8KHz, with a framesize of 1024) into about 5 subranges, very often one of the subranges exhibits a good sensitivity (using spectral difference) that is buried in the noise in the overall range.  The trick is to determine which subrange to "trust" when.
Presumably the "trustworthy" subrange would exhibit variability at a rate between about 2Hz and 0.05Hz, while the "bad" subranges would behave more randomly, with most of their variation being at shorter intervals.
I could cobble together some sort of algorithm to smooth the values at a sub-second resolution and then calculate the variability over longer intervals, but I wonder if there isn't a "canned" algorithm for this sort of things -- something with maybe a modicum of theory behind it?
Any suggestions?
[Note: I realize that one could, in theory, use an FFT to extract this info, but that seems like using a baseball bat to kill a flea.  Maybe something a little more lightweight?]
Added:
In a sense (to use an analogy) I'm trying to detect a "baseband" signal in an RF transmission (only the "RF" is audio frequencies, and the "baseband" is below 8Hz).  And, in a sense, the "RF" is "spread spectrum" -- the sounds I want to detect tend to generate lots of harmonics and/or have several separate frequency components, so if one band of the spectrum is too noisy I can probably make use of another.  The goal is to basically determine some metric resembling SNR for the various frequency bands, on the assumption that most "noise" is > 2Hz and my signal is less than 2Hz.
I have as input to this algorithm the raw amplitudes (sum of FFT amplitudes at all included frequencies) for each band, measured at 8Hz intervals.
(It should be noted that, while I have not done any formal SNR measurements, the overall SNR across the processed spectrum appears to frequently be near or below 1.0 -- if you visually observe the sound envelope in a tool like Audacity no modulation of the envelope is noticeable (even though the ear can clearly discern breathing sounds).  This is why it's necessary to analyze bands to find those with decent SNR.)


texts: Meaning of Real and Imaginary part of Fourier Transform of a signal

texts:
Say $f$ is a signal of time $t$, $F$ its Fourier transform of the variable $v$.

It is known that in polar coordinate, $|F(v)|$ tells us how much the frequency $v$ is present over the signal, and $Arg(F(v))$ tells us how much the contribution of this frequency is phase-shifted.

What information do its real and imaginary part tell us ?

Or if I reformulate my question : can we give an interpretation of the Fourier transform in Cartesian coordinate like we can do in polar coordinate ?


texts: How to get the phase offset from the instantaneous phase

texts:
The phase components of a signal that they are got from the Fourier Transform, are simply, the phase offset of each sinusiod. Which is the $\phi$ in equation $1$. However, in case of Hilbert transform, the instantaneous phase is the argument of the sinusoid function. Which is $x(t)$ in equation $2$. I know that we can get the instantaneous frequency by taking the derivative of the $x(t)$, but how to get the phase offset from $x(t)$? In other words, how to write equation $2$ as equation $(3)$

I understand that the equation $(2)$ should be the complex combinations of $sin$ and $cos$ but I ignored that for the simplicity sake.

$$\begin{align}
\sin(2\pi ft +\phi ) \tag 1\\
\sin( x(t) ) \tag2\\
\sin(2\pi x'(t) + \phi) &&\text{or}&& \sin(2\pi x'(t) + \phi(t)) \tag3
\end{align}$$


texts:
A complex Morlet wavelet looks like this:

$$\psi(t) = C \cdot e^{i \omega t} \cdot e^{-t^2/2}$$

Here $\omega$ is the frequency and $C$ is some normalization constant. The first exponential represents the oscillation, and the second exponent is the Gaussian-like envelope. However, what should $C$ be?

First, why is $C$ even necessary? Admissibility of a wavelet is based on finite support (which the Morlet wavelet has practically, if not really) and its integral over its whole range summing to $0$, which is does regardless of $C$'s value.

Torrence and Compo's A Practical Guide to Wavelet Analysis, on whose work mlpy's wavelets are based, argue for the constant $\pi^{-\frac{1}{4}}$ to "ensure a total energy of unity". Wikipedia's Morlet wavelet page gives the more complicated coefficient $\pi^{-\frac{1}{4}} \left(1 + e^{-\sigma^2} - 2e^{-\frac{3}{4}\sigma^2}\right)^{-\frac{1}{2}}$, where $\sigma$ is a parameter allowing some kind of tradeoff between time and frequency resolution. I'm having a hard time rectifying these two different approaches.

Finally, does $C$'s value have any relation to whether you want the resulting frequencies to be on a logarithmic scale, or a linear scale?


texts: What is the type of noise in this image?

texts:
what reason could make the noise/effect in this image?

Below is the original

Thanks!


texts: Audio template matching - power correlation?

texts:
I'm looking at some code that matches audio templates in a longer audio file. The calculation correlates the power spectra of the template and audio file, maximizing over the possible alignments. This seems sub-optimal to me, because by going over to the power spectrum we're throwing away phase information. Yet when I try doing a full correlation I get worse results. I'm not 100% sure yet my implementation is correct; I could have made a silly mistake.

Is there any reason it could be better correlating the power spectra than doing a full correlation? E.g. is it more noise resistant? (I don't see why it would be. As it happens, I do have something resembling white noise in my test data.)

The only obvious thing I can think is that the power spectral correlation is probably better if the alignment error is >= 1/highest frequencies in signal because then the template and signal will be out of phase. I don't think this should be the case for me: I'm optimizing to within more temporal precision than that.

Other ideas?

EDIT: in view of Peter K's comment, I should clarify that I'm using the short time Fourier transform, summing over windows of size around 0.01s. That's how the alignment dependence enters.


texts: Can I have some feedback on this research paper on vibration diagnostics?

texts:
I have submitted this paper "Detecting a Valve Spring Failure of a Piston Compressor with the Help of the Vibration Monitoring" to figshare.com.

I would like to get some feedback on the methodology of the same. Inputs of any sort are welcome. Can you please take a look at it and give me some feedback/suggestions/critics?

  Abstract:  The  article  presents  problems  related  to  vibration
  diagnostics in reciprocating compressors.  This paper presents the
  evaluation of several techniques of the digital signal processing,
  such as the spectrum calculation with the Discrete Fourier Transform
  (DFT), Continuous Wavelet Transform (CWT), Segmented Analysis for
  detection the spring failure in reciprocating compressor valve with the
  help of the vibration monitoring. The experimental  investigation  to
  collect  the  data  from  the  compressor with both the faultless
  valve and the valve with spring failure  was  conducted.   Three
  112DV1  vibration  acceleration probes  manufactured  by  TIK  were
  mounted  on  the  cylinder of the compressor.   The keyphasor probe
  was mounted on the compressor’s flywheel.  The signal of the vibration
  acceleration probe  mounted  on  the  top  of  the  cylinder  was
  used  for  the Condition  Monitoring  and  Fault  Detection  of  the
  valve.   The TIK-RVM system of monitoring and data acquisition was
  used for gathering the signal samples from the probes. The sampling
  frequency was 30193.5 Hz, signal length was 65535 samples. To imitate
  the spring fault, the exhaust valve spring was replaced by the
  shortened one with the same stiffness. It has been shown what the
  signal acquired from the vibration acceleration probe mounted on the
  reciprocating compressor cylinder can be used for reliable detection of
  the spring failure of the compressor’s valve  with  the  help  of  the
  mentioned  signal  processing  techniques.   As  it  can  be  seen
  from  the  signal  processing  results in  the  article,  the
  techniques  used  are  showing  quite  different results  for  the
  cases  of  the  normal  valve  spring  and  the  short one.   It seems
  what for this type of the compressor and valve, the  valve  spring
  failure  can  be  quite  reliably  detected  with  the help  of  the
  vibration  monitoring.   To  see  if  this  is  a  case  for other
  compressor  types  and  other  valve  types,  the  additional
  experiments are needed.

  Signal processing methods: spectrum, wavelets, fragmentation,
  decision trees (classification)


texts: Why does filtering the same discrete dataset while choosing different sampling rates yield different results?

texts:
If I have a two-dimensional discrete dataset (one space, one time), and I create subsets of this dataset by "sampling" (although the original dataset isn't continuous) it at different rates, should I expect that the same filter performed on different subsets would produce the same field (although sampled at different times)?

To elaborate, I have a discrete dataset that contains a four-times daily sampled field. If I choose every fourth data point in time after the first, I can get a discrete sub-dataset of a once-daily sampled field, although the fields in the 4x and 1x datasets are still the same at the same time. The filtering method is then as follows:

Choose the sampling rate of the discrete dataset
Perform an FFT in space and time to get a wavenumber-frequency spectrum
Filter the spectrum to retrieve signals propagating only in a certain direction
Invert the time and space transforms to get the field propagating in that direction

Now, the field I get with the 4x rate and that with the 1x rate are wildly different - not just a matter of magnitude or phase (that I can tell), they are almost entirely incomparable. However, my expectation is that signals propagating in one direction in the 4x dataset should still propagate in that direction in the 1x dataset given that they are actually the same dataset! All relevant signals are well below the Nyquist frequency, and I have accounted for scaling by the dataset length.

I have confirmed that the 1x (sampled from the 4x dataset) and a native 1x-daily sampled dataset produce similar results, as I would expect - and I have a physical reason for believing both 1x results are correct. The output is much different when I try to employ the entire 4x dataset.

My only guess is that there is an extra need to account for the dimensional frequency spectrum being different between the 4x and 1x datasets, but I also thought that the FFT shouldn't care what the time step is. Is there any mathematical source of the difference, and if so, how can I correct it?


texts: Why eigen values and poles of a system are equivalent?

texts:
In control systems engineering, the stability of a system (modeled in the form of Transfer Function) is determined by the poles of the system in the right or left hand sides.
When the model is represented using State Space approach, the eigen values of the (A) state matrix are equivalent to the poles in the Transfer Function approach.

why are both eigen values and poles equivalent? why do they give the same information?


texts:
My goal is to replicate the procedure described on pages 15-16 (1461-1462) in this paper, prior to adaptive mixture ICA (AMICA): Overlearning in Marginal Distribution-Based ICA: Analysis and Solutions

Using MATLAB,

How do I estimate the AR-coefficient for a one-tap AR process?
How do I remove the AR-process from the data? (The sample rate is 1000 Hz)
Is there any basic literature, manual, or tutorial that you could recommend?


texts: How to tell, which coefficient corresponds to which frequency while computing wavelet transform?

texts:
I am applying wavelet transform on functional Near Infrared Spectroscopy (fNIRS) signal.

My aim is to get the info that which coefficient corresponds to which frequency in the signal. Is it possible to do so, moreover if there can be some other way please mention it.


texts: Can I use standard computer vision techniques for images taken in the NIR spectral range?

texts:
I'm relatively new in Computer Vision and I need some advice with respect to the general possibilities and shortcomings of images taken in the near infrared (NIR) range. I passed a great deal of time researching about that matter but I rather found specific papers in areas like pedestrian detection and face recognition which not completely answered my question.

The background is that I have to chose camera and lens for a stereo-vision system which will be used for object detection tasks.To make the system robust against variations in illumination I thought about the feasibility of employing active illumination with NIR-light and a NIR-bandpass filter. Thus, working exclusively in the NIR spectral range.

I found publications about stereo matching in the far-infrared range, which come to the conclusion that it is not possible to obtain a dense depth field. However, I could not find anything related to the NIR range. It may be because it is too obvious but unfortunately not to me at this point.

Thats why I would like to know in particular:

if it is possible to employ standard stereo matching algorithms like block-matching to images taken in the NIR spectrum and if so would it be possible (of course depending on the conditions) to obtain a dense depth map.
if standard feature detection and description techniques like SIFT, HOG,etc produces similar results in the NIR spectrum.
if a neural network which was trained with visible-light images would be also able to detect an object in an NIR image. (I am aware that this is somehow connected to the prior question)

I would be grateful for any advice, personal experience, book/paper references you may could share with me.

Thank you!


texts:
I have a periodic time domain sensor signal sampled at $500 \text{ Hz}$ whose amplitude spectrum I compute and obtain. From the periodicity of the signal, I was expecting the fundamental frequency to be around $f = 1.2\text{ Hz}$, and this is what I observe with amplitude say $A_1$. But besides the minuscule diminishing harmonics at integer multiples of $f$;  what may be the cause of having the harmonic at $f_2$ around $2.4 \text{ Hz}$ that has an amplitude $A_2\approx1.25A_1$  ?

The signal is of $29 \text{ sec.} \Rightarrow N = 14500 \text{ samples}$. Down is a section with a full period of the signal, the blue one.

Below is a section of the amplitude spectrum. NFFT = 2^nextpow2(N);
I have rectified the question.


texts: Real-time frequency recognition in python

texts:
I'm a newcomer to signal processing, so forgive my ignorance. I'm working on a project in Python that will play a .wav file and pick out the dominant frequency as it plays. I've found a few examples on the web, but none seem to be accurate for stereo files. It seems like I need to do something with an FFT, but I don't know too much about it.
Any help would be greatly appreciated. Thanks!


texts: The relationship between downsampling and frequency resolution

texts:
I am having trouble understanding a concept that I have seen in many published papers. For example, in this paper (http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0082748) they wrote in their methods that to "obtain adequate frequency resolution we downsampled from 44.1 kHz to 8 kHz".

My understanding is that the sample rate is how many times (per second) the actual sound wave was "sampled", and that the maximum frequency that can be detected is 1/2 the sampling rate (or the Nyquist frequency). So by downsampling, you will lose the ability to detect higher frequencies, and in a sense downsampling acts as a sort of filter, as it gets rid of the higher frequency sounds from the recording.

This makes sense to do if your signal of interest is at lower frequencies, but I still don't understand how this gives "adequate frequency resolution". Does downsampling have any influence on the ability to detect lower frequencies? What do they mean by "frequency resolution"? Thank you so much in advance!


texts: Energy and power of the product of an exponential and sinusoidal signal

texts:
Can somebody guide me on how I can find the energy and power of the signal $$x(t)=e^{-10t}\cos(30\pi t)u(t).$$

Whether we have to split the $\cos$ to exponential and solve or go with the usual method of solving, both seems to be challenging.


texts: Creating a music note filter (notch/peaking)

texts:
I'd like to make a filter which essentially masks the spectrum except for frequencies around music notes in the standard tempered scale, i.e. $frequency \in 110 \times 2^\frac{i}{12}, 10 \le i \le 64$, in the case of a violin. The passband around each note should be narrow, perhaps 1% of the space between notes. The idea is that the sound of a violin will be loudest when the played note is in tune, and quieter when not quite hitting the correct note.

What would be the best way to do this? I was thinking perhaps a series connection of 10 comb filters, with the final output subtracted from the input signal. The filter for the $2^\frac{7}{12}\approx1.5$ will be covered by the comb filter $F_c\times 3, F_c\times 6, etc.$, albeit a little out of tune.

Another way would be 55 notch/peaking filters. Would these be best in series or parallel?

Is there a better way?

The solution will be done using 16 or 32 bit fixed-point on a microcontroller, depending on what sounds good enough. I'll try for $F_s$=44kHz, 16bit audio in/out.

Thanks,
James


texts:
I need to create an algorithm for sound of waves. So I imagine it should be a white noise with doppler effect. However I understand doppler is just change of frequency. But white noise have all the frequencies in it.
What's the basic idea? Is there a simple code already?


texts: What is the essential bandwidth with the given function?

texts:
Let the function be

$$
f(t) = e^{-3t} u(t -1)
$$
The criterion is set at 70% of the total signal energy.

I know how to find total energy, but not how to find the the $W$ (or frequency) at which the signal is a certain amount.


texts:
Does anybody know a simple way to recognize vowels from MFCCs? (not words, just phonemes: a,e,i,o,u).

I heard this is a vastly known problem in DSP with several solutions like SVM, GMM and cosine distance. I tried this last method using a good audio processing library and a representative training set, but seems that my classification work is not giving good results.

In a gisp what I'm doing is this: given a set of recordings belonging to the same phoneme, I'm taking the average of the frames of all the recordings to create a feature vector of 13 entries. Later I'm applying a normalized dot product with the testing vector to find the cosine distance.

I also read this thread but they make emphasis in the problem of recognizing a sequence of phonemes via DTW, not in the previous vector's classification problem.

Are LPC a better approach? I mean, the formant position are known a priori...

Thanks in advance!

Ok, I'm gonna change the question. The method in essence works (after implemented it), it recognizes when I say A,E,I,O,U. The problem is that it doesn't identify when the phoneme is NOT a vowel (e.g. consonants, transient noises). Is there a method that allows to distinguish vowels from other sounds?? Perhaps the MFCCs are good, due that they get the timbre properties, but the cosine classifier is not the best solution. Anyone? please


texts: Why is dirac delta used in continuous signal sampling?

texts:
Why this concept is the most widely accepted model of signal sampling? By multiplying the continuous signal value with the dirac delta we get an infinite value. However if we perform convolution of our signal and the dirac comb, we get our signal again - how is it useful?

The answer to a similar question has been given here, but it's still not 100% clear to me.

Sampling of a continuous function: Kronecker's or Dirac's delta?


texts: What is the Reference tap of an equalizer (FIR Filter)

texts: Currently I'm using the built-in Equalizer (EQ) object from Matlab to equalize my signal. For the EQ there is a parameter called the Reference tap. With different value of the reference tap i got also different results and maybe also different delay of the EQ. My question is: what exactly is the reference tap of a FIR filter and how should i set it to achieve the best performance ? Thank you in advance LA


texts: Response of a system to a step function (heaviside)

texts:
I'd like to compute the response to a step function of a electrical/thermal system. Generally I can "easily" compute the transfer function $H$:

$$H(\omega) = \frac{V_{out}(\omega)}{V_{in}(\omega)}$$

Since the Fourier transform ($\mathcal{F}$) of the Heaviside function is (computed with WA):

$$\mathcal{F}(\theta(t)) = V_{in}(\omega) = \sqrt{\frac{\pi}{2}}\delta(\omega)+\frac{i}{\sqrt{2\pi}\omega}$$

Hence, noting $\mathcal{IF}$ the Inverse Fourier transform:

$$V_{out}(t) = \mathcal{IF} \left\{ \left( \sqrt{\frac{\pi}{2}}\delta(\omega)+\frac{i}{\sqrt{2\pi}\omega} \right) H(\omega) \right\}$$

To check my math I tried to compute the response for a simple RC system:

I should get the well known charge of the capacitor. The transfer function:

$$H(\omega) = \frac{1}{1+i\omega R C}$$

Computing the Inverse Fourier transform ($\mathcal{IF}$) with WA ($R=C=1$) I get:

This would be correct if we were going backward in time :/. So the question is... What am I doing wrong?

I did the same using Laplace Transforms and everything works fine... But I don't understand why.

P.S. I don't want another method, I just want to understand what's wrong in my approach.

P.S. the reason why I am using WA is that for my more complicated system I need to compute the Fourier transforms using WA.


texts:
I have a signal $s(t)$ of duration $T$. This signal doesn't have a limited bandwidth. To solve this problem, I filter it with a pulse shaping filter (raised cosine filter).

My question:
Does filtering change the duration of the signal?


texts:
I know how to compute the 1D  FFT  (and interpret values from 0 to Nyq).
When computing the 2D FFT,  do we compute the FFT of row[1]
then the FFT of row[2]  then the FFT of row[3] up to the last row.
And then compute the  FFT of col[1]   col[2]  for each of columns across ?
But to report the RESULT of the 2D FFT ( do we report the complex value of each final   row from col[0] to  col[N/2]   for each row from top to bottom ?

What INFO does the  2D complex FFT result convey ?


texts: Is possible reach the DFT if I have the DTFT?

texts:
My teacher told me that DFT is DTFT sampled, i.e.:

$$X[k] = X(e^{j \omega})\Bigg|_{\omega = \frac{2\pi k}{N}}$$

But, if I have the sine

$$ x[n] = \sin(\omega_0 n) $$

the DTFT is:

$$X(e^{j \omega}) = \frac{\pi}{j} \big(\delta(\omega - \omega_0) - \delta(\omega + \omega_0)\big)$$

(periodic in $\omega$ with period $2\pi$). How is it possible to reconcile this with the DFT for $N$ values for this sine or any signal?

Thanks people. Sorry for the English.


texts:
I'm trying to understand the concept of spectral leakage for the DFT, without going deep to the mathematical intricacies (it's for practical purposes). I've read from the book "Introduction to Digital Signal Processing Using MATLAB with Application to Digital Communications" that:

  One reason for using DFT is to determine the spectrum of a
  discrete-time signal. If a frequency in the input signal does not
  coincide with one of the DFT bins, then the magnitude of the DFT of
  that particular signal will not be an impulse-like in shape. Instead,
  it will spread over the entire DFT bins. That is to say that the
  energy of the input discrete-time sequence in a particular frequency
  will leak into other neighboring bins. It smears the impulse-like
  frequency over the entire frequency bins. Therefore, the corresponding
  spectrum is only approximate. This is what is called the DFT leakage.

However it seems not clear to me. Are you able to explain more clearly the concept of spectral leakage for the DFT ? Maybe with an example if you can


texts:
My objective is to demodulate QPSK signal. At the receiver I apply RRC filter and interpolate the signal to get the values of the signal (approximately) at the sampling instances. Then I am concerned with the symbol timing recovery to get the correct sampling timing. The filtered and interpolated signal is represented in the figure below.

Red vertical lines indicate the symbol intervals. Obviously, the symbol timing recovery is needed.
My idea is to apply PLL in order to track the phase error to zero and then sample the corrected signal at correct time instances.
So I have the following python code:
import pdb

class SimPLL(object):
    def __init__(self, lf_bandwidth):
        self.phase_out = 0.0
        self.freq_out = 20*pow(10, 6)  # Arbitrarily set, because I expect to get the input signal in the range of 20 MHz. Thus with this frequency I think the PLL can be locked faster
        self.vco = np.exp(1j*self.phase_out)
        self.phase_difference = 0.0
        self.bw = lf_bandwidth
        self.beta = np.sqrt(lf_bandwidth)

    def update_phase_estimate(self):
        self.vco = np.exp(1j*self.phase_out)

    def update_phase_difference(self, in_sig):
        self.phase_difference = np.angle(in_sig*np.conj(self.vco))

    def step(self, in_sig):
        # Takes an instantaneous sample of a signal and updates the PLL's inner state
        self.update_phase_difference(in_sig)
        self.freq_out += self.bw * self.phase_difference
        self.phase_out += self.beta * self.phase_difference + self.freq_out
        self.update_phase_estimate()

pll = SimPLL(f_symb//20) # I have read in one post, that with the bandwidth of the loop filter between f_symb/100...f_symb/20 PLL performs well
num_samples = 100
phi = 0
ref = []
out = []
diff = []
for i in range(0, num_samples - 1):
    in_sig = sig_interpolated[i]
    phi = np.angle(sig_interpolated[i])
    pll.step(sig_interpolated[i])
    ref.append(sig_interpolated[i])
    out.append(pll.vco)
    diff.append(pll.phase_difference)
#plt.plot(ref)
#plt.plot(ref)
#plt.plot(out)
#plt.plot(diff)

ref, = plt.plot(ref, label='ref')
out, = plt.plot(out, label='out')
diff, = plt.plot(diff, label='diff')

plt.legend(handles = [ref, out, diff], loc = 'upper right')

plt.show()

And the result I get is represented in the figure below:

So it seems like the PLL cannot lock the loop and the signal cannot be corrected.
Does anybody know, how to fix my code or can point me to the relevant example?
Thanks!


texts:
I'm preparing for my exams I stumbled across this exercise. Now I can't seem to figure it out. Anybody can help me ?

The exercise:

For the 8bit data word: 00111001 the check bits are: 0111. Now if the word is read from the memory and the check bits are 1101, what is the dataword?

The text is translated from another language to English.

I started by doing a check :

The entire word is the dataword (8 bits) combined with the check (4 bits).

In this case: 0 0 1 1 0 1 0 0 1 1 1  1 (the check bits on position 1, 2, 4 and 8, with the right bit being the least significant bit)

Then the check itself:

The check consists of searching for all the bit that have the value one from the dataword in the combined word. It can be seen that position 3 7 9 and 10 have the value one and didn't come from the check. These 4 values are written binary and added up. When this is done. the check is found again. (To confirm that this method works)

  3:  0 0 1 1

  7:  0 1 1 1

  9:  1 0 0 1

  10: 1 0 1 0

0 1 1 1

So this is correct (Just to see if this method is correct)

Then I have another check (1101), but how can I find the data word ?

Thx in advance


texts: What really means stochastic in field of signal processing

texts:
I met two definitions of word stochastic, the first one (cited from wikipedia Stochastic)

  The word stochastic is an adjective in English that describes
  something that was randomly determined

The explanation of stochastic and deterministic what is used in textbooks really make sense according to definition above. The second definition is

  Stochastic means sample by sample

For example SGD - stochastic gradient descent.

This seems to be a little confusing for me. I do not really see any relation between random and step by step.

Do I miss something? Or it is really different meanings for the same word?


texts: When we apply pulse-width modulation (PWM) on controlling the brightness of a LED or the speed of a DC motor, is it the lag in our eyes that is responsible for the feeling of a continuous powering or the inertia of the devices?


texts: Find signal power in a band by integrating the PSD in a frequency band (and zeroing the out-of-band DFT bins)

texts:
I know that directly zero DFT bins outside a frequency band has the side effect of introducing ringing, as this post says Why is it a bad idea to filter by zeroing out FFT bins?. But what about calculating the power by summing the PSD in a frequency band. In my opinion, this is similar to first setting the out-band PSD amplitudes to zeros (which may cause ringing in time domain) and then summing the remainning nonzero amplitudes.
I guess it is different from first applying a bandpass filter to the time domain signal(which has no ringing) and calculating the power by averaging the squared time domain samples. Can you point out how much error the frequency domain method has? or maybe these two methods are equivalent?


texts:
Does anybody know any open voice/speech annotated database for Voice Activity Detection? Or any other corpus for speech evaluation purposes?

The ones I know are private: AURORA, TIMIT, SpeechDat-Car, Speecon, Catalan Speecon.

The other option is to create hand-labeled annotations for own recordings, or use a method like the Short-Term Energy Contour. But in the first case the amount of files to process would be insurmountable, and in the second, the energy based methods only work fine for free-noise recordings.


texts: Applying Wavelet on energy disaggregation as denoising technique to remove uncertainties

texts:
I would like to apply Wavelet in MATLAB as a denoising technique on Non-Intrusive load Monitoring data. The data was captured by sensors on each appliance and one sensor on the smart meter (Normally called Aggregated Data). The dataset contains the following:

timestamp
Aggregate
and Appliance from 1 - 9

Why Denoising and with Wavelets

Research has shown that denoising signals before passing it through your Machine Learning Algorithm give better results. This result can improve prediction accuracy.  And I am interested in investigating using wavelet to remove uncertainties since my dataset is in the time domain.

This is a sample dataset

Approach Used

function allXd = denoiseSignalToCsvFile(filePath,saveAs)

allData=csvread(filePath,1,1);
allXd = [];
%allX = [];
[row,col] = size(allData);
% disp(col);
% disp(row);

for applicantIndex = 2:col

   % disp(applicantIndex)

       x=allData(:,applicantIndex);
       xd = waveletTransform(x);

       allXd = [allXd; xd];

       %allX  = [allX; {xd}];

end
    allXd = allXd' ;

csvwrite(saveAs,allXd);

end

function denoisedOutput= waveletTransform(input)
%Wavelet Function
wname = 'db7';
% number of levels
n = 4;
denoisedOutput = cmddenoise(input,wname,n);
%denoisedOutput = wdenoise(input,n);
end

Question:

Is the approach corrects?

Thank you.


texts:
I am using a Kalman filter to fuse gyro and inclinometer data. The prediction step is given by:

$\hat{\alpha_{i}}^- = \hat{\alpha}^+_{i-1} + \omega_{i}$

Where $\hat{\alpha_{i}}^-$ is the prediction for the angle, $\hat{\alpha}^+_{i-1}$ is the previous a-posteriori state estimate and $\omega_i$ is the change in angle measured by the gyro.
The innovation of the filter is given by:

$\alpha_i - \hat{\alpha_{i}}^- $

where $\alpha_i$ is the current measurement of the inclinometer. As far as my understanding of the Kalman filter goes, the innovation is expected to have a zero mean. However, the following Figure shows the histogramm for some 25000 datapoints of the innovation:

The mean is obviously non-zero. Would it be correct to claim that this means that some error source is present, for example an uncorrected gyro offset? Or is the non-zero mean more an "academic" property of the filter, can't be expected to be true in a real-world implementation, and thus a non-zero mean should not be overrated?


texts:
We send the data in bytes to the RS Encoder block. The RS Encoder block encodes the data with the Reed Solomon (225,223) code. It waits for 223 bytes and after this encode them to make a codeword of 255 bytes.
What happens if I can send only 219 bytes instead of 223 bytes? Does the length of the virtual fill increase only?


texts: FPR for time series of 1 hour epilepsy recording

texts:
I am working on epilepsy seizure prediction classification using a convolution neural network. My dataset consisting of multiple recording of each record for 1 hour, first I segmented each record into several 30 seconds segments then I apply a discrete wavelet transform on each segment. Now, I want to calculate the false positive rate to test my model, I found in all the papers that worked on epilepsy prediction that the FPR results in FPR/h I don't know how can I get FPR/h like all those papers. I use this formula for FPR but it is not per hour.
FPR=FP/FP+TN


texts: Fourier Like Spectral Analysis with Uneven Intervals and Redesigned DFT Matrix

texts:
I intended to use a discrete Fourier transform (DFT) on a time series sampled at uneven intervals. What I did was to calculate a DFT matrix where the elements are the values at the uneven locations like this
$$
{\displaystyle {\begin{aligned}X_{k}&= \frac{1}{\sqrt{N}}\sum _{n=0}^{N-1}x_{n}\cdot e^{-{\frac {2\pi i}{time_{N-1} - time_0}}k \cdot time_n}\\&\end{aligned}}}
$$
where $time_n$ is the time location in the sequence and $time_{N-1} - time_0$ is the entire time span of all samples.
I realize that orthogonality of the basis vectors in the DFT matrix might get somewhat lost. Is anything more lost? Can I do something more to make the transformation more comparable to an ordinary DFT?
Here is an implementation of it you can try with your own data: David Jonsson
(bodavid) - Fourier Transform for Unevenly Sampled Data.
Orthogonality between basis vectors are visualized in a colorized matrix.


texts: Shouldn't the Sampling Theorem imply that there should be no information loss at all after a signal is processed?

texts:
I am very, very new to signal processing (only started a few days ago) so please bear with me because I may be missing the big picture.

Consider an arbitrary signal $x(t)$ with varying frequency to be processed by a computer.

Given the right sampling rate w.r.t the frequency, shouldn't the Sampling Theorem essentially imply that no information will be lost at all after the sampled signal is converted back to its continuous form, since there will be a sufficient number of discrete points for which the signal is described?


texts: Finding the system output by convolution

texts:
pretty new to this concept, so do bear with me.

A linear dynamic system is described by the following differential equation:

Transfer function H(s) is calculated to be  =

I've already found the transfer function by assuming that the initial conditions are set to 0, getting the calculated stuff as shown above. I will then inverse Laplace it in order to find h(t), which turns out to be (exp^(-4t)t)

I will then use the formula, which is :

This is what I got, and I was wondering if it is correct:

If so, why did the questions give me the initial conditions? What should I do with them?
Also, how do I determine whether the system is stable? Unclear of this.

Thanks :)

As per EDIT:

I've converted them into differential equations where by:

In this case, how do I find the TF? I'm supposed to divide by X(s) in both sides, but the equation on the right will have a problem won't it?

EDIT 2:


texts:
I have simple smooth time signal with different time period. I would like to transfer period over the time to frequency, and to track frequency changing over the time, I would call it Instantaneous frequency?

PF-period frequency (1/T)... any suggestion?


texts: What subclass of nonlinear systems can be represented by Volterra series?

texts:
Can every possible nonlinear time-invariant Volterra series be represented by a Volterra series?
If not, which ones can?
Also, are there any time-variant systems that can be represented by Volterra series? I don't see how from the equation, but want to be sure I'm not missing something.


texts: Relation between SER and the channel capacity

texts:
Is there a relation between Symbol Error Rate (SER) and the channel capacity?

What is {Modulation Order x (1-SER) / symbol duration [bps]} called?


texts: Bilinear Transform (Tustin's Method) applied to the Derivative

texts:
I hope that I have not misunderstood something terribly wrong, but the continuous derivative $D=d/dt$ can be considered a transfer function in Laplace space $D(s) = s$, right?

So when I try to discretize it using the bilinear transform (Tustin's method) I trivially get

$D(z) = \frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}}$

When I apply this to a series containing one discrete impulse, the response oscillates at the Nyquist frequency. Even worse, the spectrum around $\omega=0$ is quadratic and not $\sim i\omega$ like it would be expected from the derivative. (Edit: the latter was just due to roundoff error, because the low-freq amplitude got swamped by the Nyquist-peak)

Although I know of course how well the bilinear transform works for discretizing all kinds of filters, it is hard for me to understand, why it is considered superior if it seems to fail so miserably for something as simple as the derivative, which can otherwise be easily represented by first order finite differences:

$D(z)=\frac{1-z^{-1}}{T}$

or even second order (symmetric) finite differences

$D(z)=\frac{1-z^{-2}}{2Tz^{-1}}$

I am sure it all has a very simple explanation, but I can't see it.

PS: What is all the more confusing: when I apply the bilinear D(z) to a step function, the result is (correctly) a single peak. Consequently the inverse of the bilinear D(z) applied to an impulse yields the step function, like it has to be. What is going on there?


texts: Reason for bimodal behavior while low second fourier coefficient

texts:
If I have a time series (for eg. for 23 timestamps) and if I plot it and see that it is bimodal, that means it might be having high value of second fourier coefficient (with frequency = 2). But when I do the fourier transform I find that the value of second fourier coefficient is very low.

Now, is the following reasoning meaningful for this?

It might be the case that although second coefficient has low value but other coefficients having high value are in phase with the second coefficient, hence adding to its amplitude, and that is the reason we are seeing bimodal behavior in original time series.

PS -
1) By second coefficient, I mean that when we do fourier transform we get a zeroth term for zero frequency, then first and then second.
2) By coefficient I mean the amplitude of the fourier coefficient.

For example, if I have a time series (bimodal i.e. with two peaks) and I do its fourier transform, 3rd term has an amplitude of x and phase of p1, where x is a very low value.

Now I also see that 2nd term has an amplitude of y and phase of p1 and 4th term has an amplitude of z and phase of p1. y and z have high values.

Now do you think that two peaks in the original time series can be attributed to the following reasoning -
Although 3rd term (for frequency=2, having two peaks) has low amplitude (x) but because 2nd and 4th terms have high amplitudes and same phase, they have added to the amplitude of 2nd term and hence we see two peaks in the original time series?

In general, instead of 2nd and 4th terms, it can be any coefficients having phase same as the 3rd term.


texts: Extended Kalman Filter measurment vs input vector

texts: What is difference between measurement and input vector in Extended Kalman Filter? Isn't always input also measurement? If so how to update input vector if I have acceleration or yawrate as input vector and they aren't constant.


texts:
I am trying to learn shift invariance(time invariance) and i came across a function/system

$$y(t)=3x(t)+2\cos(\pi t/3)$$

I am confused.If it was alone 3x,it should be definitely time invariant(i verified it through MATLAB)

But now it contains two terms, cos term in addition to 3x term,making function complex

Here is MATLAB code i tried to make for this system:

clc
clear all
close all
t=-5:.001:10;
x=heaviside(t)-heaviside(t-5);
y=3*x+2*cos(pi*t/3)
plot(t,y)

legend('y(t)')

figure
plot(t+3,y)

legend('y(t-3)')

figure
t=-5:.001:10;
x_shifted=heaviside(t-3)-heaviside(t-8);
y2=3*x_shifted+2*cos(pi*t/3);
plot(t,y2)

legend('S[x(t-3)]')

Its output shows that my system/function is not time invariant(please correct me if i am wrong)


texts: Hough lines and Convex Hull methods give jagged lines

texts:
I need to do a perspective transformation on an image section from newspaper, here the girl's image. The section's coordinates are given as rough estimates. I need to find the boundary of the section and do a perspective transformation. I had been referring the following link.

  http://opencv-code.com/tutorials/automatic-perspective-correction-for-quadrilateral-objects/

However, Hough Transform and Convex Hull method on contour finding give jagged lines. This is how the edge detection on the section looks like.

edges = cv2.Canny(gray, 50, 150)

How can I improve the Canny Edge lines to make them straighter so jagged lines are removed? The Convex Hull finds the boundary but not with a number of smaller lines and the boundary is not complete. Here is how the Convex Hull method's boundary looks like.

contours, hierarchy = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    for i, cnt in enumerate(contours):
        if hierarchy[0,i,3] == -1 and cv2.contourArea(cnt)>5000:
            hull = cv2.convexHull(cnt, returnPoints = True)
            print "hull", hull
            for tempodd, itemodd in enumerate(hull):
                if tempodd % 2 == 0:
                    tempeven = tempodd
                    itemeven = itemodd
                    continue
                cv2.line(img, (itemeven[0][0], itemeven[0][1]), (itemodd[0][0], itemodd[0][1]), (255,0,0), 4)
                print "itemodd", itemodd, "itemeven", itemeven

Here since the Canny is getting jagged lines, the convex hull method gives multiple lines too. Point me where I am going wrong. Thank you.


texts: I am trying to make a method in my simple application which is like SetSilence(); Now If I have audio (mono) PCM 16 bit Signed - should I fill all data with 0 values? And for PCM 16 Unsigned with 32768 values?


texts: Any references for the trade-off between software and mechanics/optics in industrial machine vision systems?

texts:
I explain my question with a simplified example.

I can design an industrial vision system for the automatic inspection of an item with these main requirements:

the image of a good piece must be a black background and the piece must be grey.
the defect must appear as a white area inside the grey area.

These requirements simplify a lot the software part of the system: in order to classify an item as defective the algorithm just counts the white pixels.

But in order to get this straightforward algorithm I have to be very good at designing the lighting/optical/mechanical part of the system and maybe that part will cost more than the software.

Maybe in the past I read a sentence like "do as much as possible with the mechanics and as little as possible with the software"; it seems to me it was in a book of the 1990s (or 1980s) about practical machine vision but I can't find the proper citation/reference.


texts: 2D deconvolution of recorded electron beam data

texts:
I'm currently working on a project that involves using an electron gun and it would be really nice to know the spot shape of the electrons coming out of the gun (the frequency of electrons at some x,y away from the center of the beam).  Our current assumption is that the beam's spot shape is somewhat gaussian.

We have a picoammeter hooked up to a detector that outputs that current corresponding to the number of electrons that hit the detector.  The detector is circular with some radius, R.

If I'm not mistaken, sweeping the beam and recording readings from the picoammeter will result in an matrix that is the convolution of the beam spot shape and a 2D step function that's 0 outside of R and non-zero inside R.  I have looked through a few previous questions about deconvolutions related to images with a gaussian blur and it seems like this is very similar except the function is a step function instead of a gaussian.

I have tried using Matlab's conv2, FFT2, and iFFT2 functions to get the deconvolution as this thread suggests, but it produces something looking like this:

The code that produced this is:

mu = [0 0];
Sigma = [1 0; 0 1];
x = -3:.2:3;
[X1,X2] = meshgrid(x,x);
F = mvnpdf([X1(:) X2(:)],mu,Sigma);
F = reshape(F,length(x),length(x));
for i=1:31
    for j=1:31
        if x1(i)^2+x2(i)^2 >= 4
            circ(i,j)=0;
        else
            circ(i,j)=1;
        end
    end
end
conv = conv2(F,circ,'same');
D = ifft2( fft2(conv) ./ fft2(circ) );
surf(x1,x2,D);

Is there something inherently wrong with trying to deconvolves a step function?  Also, I tried using the full convolution, but that seemed to produce an even weirder deconvolution...

Am I just going about this the wrong way? (I've included python because I would prefer to use python if a solution exists, but matlab is fine too)


texts: Undesirable zeros in sampled signal using train of impulses

texts:
I'm trying to analyze a signal like the example below, but it contains undesirable zero value samples, is there any way to eliminate them? I'm using Matlab.

Actually, the problem is this: in a sampling process I am using a train of impulses but that train I formed it with the cardinal sine function and it has generated values with zeros. Then, that train multiplies it in time to the sinusoidal signal and obtain samples (samples with zeros).

k=5;
t=0:Ts:T;
for n=min(t):k*Ts:max(t)
    pdirac=pdirac+sinc(100*(t-n));
end
signal=signal1.*(pdirac);


texts: Does convolution violate duality of a Fourier Transform

texts:
Duality says that
if
$$
x(t) \iff X(\omega)
$$
then
$$
X(t) \iff 2\pi \cdot x(-\omega)
$$

Given that
$$
f(t)\circledast g(t) \iff F(\omega)G(\omega)
$$
By duality, shouldn't that imply that
$$
f(t)g(t) \iff 2\pi \cdot F(\omega) \circledast G(\omega)
$$
since
$$
f(-t) \circledast g(-t) \cdot 2 \pi = 2 \pi \cdot f(t) \circledast g(t)
$$

When I look at the theorem in my textbook it states that
$$
f(t)g(t) \iff \tfrac{1}{2\pi} \cdot F(\omega) \circledast G(\omega)
$$

I'm confused as to why the constant  is divided by $2\pi$ instead of multiplied by $2\pi$.  Does that mean that duality is violated?


texts: Why is there a negative in front of the phase response equation for this complex exponential?

texts:
first time on here!

I'm working through "Digital Signal Processing using MATLAB" by Vinay and Proakis. Good book.

I am stuck on this example tho.

Shouldn't the imaginary part in the denominator (magnitude calculation) be (-0.9sin(w))^2 since the Frequency Response equation has an e^-jw?

Also why does the angle calculation include a -arctan instead of just a regular arctan.

Thanks


texts: For filters with impulse responses on a specific $x[n]$, how do you calculate DFT of $y[n]$?

texts:
Basically I'm talking about N-point moving average/difference filters and not one where $\delta[n]=k$. For example given say a two-point moving average filter:

$$h[n] = \dfrac{\delta[n]+\delta[n-1]}{2} $$

and a defined input signal like

$$x[n] = \sin[2 \pi n]$$

$x(n)$ is discrete and the window size = the period size.

How would you find $Y_k$ (the coefficients of the DFT of $y[n]$)?


texts:
I have done a lot of research and found out methods like adaptive thresholding , watershed etc that can be used of detecting veins in leaves . However thresholding isn't good as it introduces a lot of noise

All my images are gray image please could anyone suggest what approaches to adopt while considering this problem in urgent need of help

EDIT:My original image

After thresholding

As suggested by the answer i have tried the following edge detection

Canny

Too much noise and unwanted disturbances

Sobel

Roberts

EDIT: Tried one more operation i get the following result its better than what i tried with canny and adaptive What do you feel?


texts: Is there any way to do 3D (Voxel Data) feature detection?

texts:
In the 2D image processing, there are ways to find and match features of the image (like corner of the edges). However, I could not find the equivalent of that in the 3D-voxel data (Here voxel means a 3D grid with a gradation of values allocated to each box).
So, Is there any algorithm for 3D voxel feature matching?


texts: Feature normalization (scaling) for Hyperspectral images

texts: have been straggling with the concept of feature normalization for the hyperspectral images. Respect to my problem I have attached a picture of my problem which clearly stands the issue which I have.


texts: Derive velocity and acceleration from position

texts:
I generate random spike data that represent the ouput from a rotary encoder. Here the output of my algorithm:

The first plot is position, then velocity and then acceleration. Even though I downsample my position vector and pass it to a average filter of 20 points, the derivative are very sensitive as you can see. I check the following question:
have position, want to calculate velocity and acceleration. Few option seem to be available , but I don't get the answer , the Savitzky-Golay Filters  is just a smoothing function, I don't get how he get the velocity, also what are the orther alternatives.


texts: Convert one sound sample in different sample where each sample's pitch is a note (do-re-mi...)

texts:
For example, I would like to do like in this video:
https://www.youtube.com/watch?v=YBhneZuAb5k

We have for example a goat yelling sample and from this sample, we can change the pitch according to the pressed piano key. I would like to make a script that will, from one input sample, generate all samples for each pitch/note (do re mi...).
What is the algorithm for doing that?


texts: What should I do know to know the frequency from complex signal?

texts:
Now I'm trying to digging the DFT function.
But nobody tell about the what do we need it at least to solve the dft from the complex signal- a signal with many frequencies

If I got the complex signal as the below,

then what should we have to know at the first time to do DFT?
Especially, What kind of things should I have to know to solve a signal with many frequencies?

I've seen some parameter from example as the below when I googling.
sampling rate, N, nyquist rate, ..., sort of things.
In the practically field for engineer, if they got a that kind signal, how do they do at the first time?

as I know the below image is DFT equation.

then how do we decide the "N" and "m"?


texts: Understanding the frequency scale of a spectrogram

texts:
The graph below was derived from a raw seismogram recorded during an earthquake over a timespan from t=0 to t=1400 seconds (not shown on x-axis).

The original seismogram $s(t)$ is not shown, but it is known that the original signal is the convolution between the source wave $w(t)$, the effects of the medium $g(t)$, and the effects from instrument itself $i(t)$; that is,

$$s(t)=w(t)*g(t)*i(t)$$

The graph above is what remains after removing the instrument response as shown below:

I think this instrument response is telling me that the amplitudes of the original seismogram $s(t)$ at frequencies higher than $0.02Hz$ were amplified at a constant gain of approximately $1E9$, while amplitudes lower than $0.01Hz$ are effectively dampened (by gains significantly smaller than at those frequencies higher than $0.02Hz$).

But what exactly can I effectively say about the shape of the original seismogram from this information?  If these frequencies are 'dampened' in the broadband representation above, what, if anything, can be said about the amplitudes and shapes observed in the original graph?  Can I simply say that longer waves should be present in the original signal but not say anything about when they occur?  Could I somehow convolve these graphs to generate the original signal (or at least closely approximate it)?


texts: Why does the Hamming window attenuate the FFT?

texts:
I am working on a very simple voice recognition system using the msp430. In my research I've read that for real life audio signals its necessary to apply a window to the FFT data because the audio signals won't be periodic. In my code, I've applied the hamming window and plotted it against the non-windowed FFT spectrum. It appears that the hamming attenuates the signal in the lower valued N data points.

I think this makes sense based upon the equation of the hamming window, but why would I want this attenuate for my signal? It seems that identifying the spectral characteristics would be more difficult after the window. Any thoughts?


texts: What exactly do we do in non-rigid registration?

texts:
I found many readings on Non rigid registration, also saw some videos but didn't find a clear explanation anywhere.

What I understood is the following

Rigid Registration: It is the alignment of two point clouds without changing the shape (ie only by rotation and translation). ICP algorithm is used. The closest point in the other point cloud is assumed to be the corresponding point.

Correspondence detection is not necessary for all the points.
All the points are applied the same transformation.
Iterative

Non-rigid registration: In this case, the shape of the point cloud might change. But what exactly are we doing? Are we finding the corresponding points using Spin Images, and then applying separate transformations (translations in this case) for every corresponding point?

Correspondence detection has to be done for all the points.
All the points are applied their separate transformations (might be same).
Not iterative: Just apply a translation

Piecewise rigid registration: We divide the non-rigid point cloud into many rigid parts and then apply separate rigid transformations per part. This lies between rigid and non-rigid registration.

Correspondence detection is done for only some of the points.
Same transformation is applied to those points in a particular rigid part, but different parts might have different transformations.
Iterative

Please correct me if I'm wrong somewhere.

Also, is there any role of SIFT in correspondence detection. I've seen some links for SIFT in 3D.


texts: Fundemental scintific publication in up conversion down conversion

texts:
Prior to performing DSP on a signal and afterwards, up and down conversion of the same in order to transmit and receive the signal is important.

I would like to know if anyone knows a fundamental scientific publication of good clarity (preferably from a reputed publisher e.g. IEEE, ACM, Science Direct, SIGCOMM, etc) which introduces this concept. I understand that this publication will be an old one.


texts: Complex exp. Fourier series, finding $x(t)$ when $X(j\omega)$ is given as magnitude and phase plot

texts:
I'm watching Neso Academy series on Signals and Systems, and in one of the videos the problem is to find $x(t)$ when magnitude and phase plot are given. The plot looks like this:

When he finishes calculation he gets:

$4 + 4cos(3 \omega t+ \dfrac\pi2) + 8cos(4 \omega t- \dfrac\pi2)$

I understand the steps that are required to get this, but I don't understand why is it cosine? When you look at magnitude plot you have just 3 components: DC offset = 4 and 2 harmonics.

As far as I know the values on magnitude plot represent sine value and phase plot represents just phase shift of that sine wave. Without doing anything but looking at the plot I would write following:

$4 + 4sin (3 \omega t+ \dfrac\pi2) + 8 sin(4wt-\dfrac\pi2)$

And it's completely wrong, why is it so?

BTW link to the video.


texts: Detecting Pattern from Signal Data by Gaussian Mixture Model?

texts:
I'm a machine learning newbie.

I have sensor data which is generated by several sensors.

The data is a series of 'time's. (it is not labeled, in other words, I cannot know which sensor generates which 'time').

And each sensor basically generates data periodically, but sometimes it generates other data.

For example, there are two sensors (sensor A generates a 'time' every 2 seconds, sensor B generates a 'time' every 5 seconds.).

Then the data can be: {2.1, 4.3, 5.2, 6.1, 7.9, 9 (noise from one of the sensors), 10.1, 10.2} .... (there are some noises)

What I want to know is that, when another data is given, it is possible to know that the same sensors generate it? (We know the period)

What method should I have to use?

I found the Gaussian Mixture Model. Am I right to use it?

Thanks.


texts:
I was wondering if any one with experience with both sensors can give some insight on this.

I've heard there can be problems with alignment of the different signals using a 3CCD.

However, when using the Bayer filter, you need to convert, and you have problems of lower resolution, introducing colors that are not there in reality, etc.

Is one of the two best usable? Or is it application specific?

EDIT:
Maybe I can add some extra questions to make the question more clear. For the record, I'm not asking this question for a specific project, I'm just interested in the differences between 3CCD or Bayer in general. I know the basic (hardware) differences between 3CCD and Bayer, but I'm looking for general details about the differences.

These type of questions come to my mind:

In an application that is based on color will it always add significant color information when using 3CCD instead of Bayer?
Are there other solutions instead of 3CCD to overcome the problems with Bayer? (thanks Ktuncer)
What exactly are the significant differences between 3CCD and Bayer (not application specific, and if application specific, in what kind of applications could it be significant)?


texts: SNR in one-dimensional additive channel with uniform noise and binary antipodal input

texts:
A one-dimensional addictive noise channel, $Y=X+N$, has uniform noise distribution $N \sim U(-\frac{L}{2}, \frac{L}{2})$ and binary antipodal input constellation with equally likely input values $x=\pm 1$. Find $\rm SNR$ as a function of $L$.

I know that the $\rm SNR = \frac{\rm Signal \, \,Power}{Noise \, \,Power}$, yet I couldn’t figure out how to find these power. Any hints?


texts:
Suppose I've got an audio signal sampled at $48000$ Hz, and I'd like to design a low-pass filter that isolates everything below ~$60$Hz. In the digital world, this is a low-pass filter with the passband at $[-\frac{\pi}{400} , \frac{\pi}{400} ] $. Also, the transition band should be reasonable as well. Building a FIR filter for this can have a lot of taps which in the long run affects precision. An IIR filter is too not ideal because audio suffers for non-linear-phase response in filters, so unless the signal is filtered, then reversed and filtered again, it is not really an option.

Could a wavelet transform be better at this than in-one-go regular filtering?


texts: Are the frequencies a histogram in the frequency domain?

texts:
I'm new to signal processing, and was learning about wavelets from this site.

In the graphs above, the time domain signal is obvious. The x axis shows the signal varying according to time. I don't understand the frequency domain though (even after watching a few videos).How does the frequency graph relate to the time graph above? Is it showing the frequency value for every amplitude value of a different signal (assuming "amplitude" is "Module" of the y axis) of the temporal graph?

Part of my assumption is obtained from this answer. But the question still remains, since if there are two signals of the same frequency but different amplitude, wouldn't they have a representation on the frequency graph where it's not possible to distinguish between them?

I'm even more confused because this example shows 20 millisecond samples being taken from a Fourier spectrum and being fed to a neural network like as though the x axis of the Fourier spectrum was the time domain rather than a "Module" value as shown in the graph above.

ps: I'd appreciate a plain-English explanation rather than one supplemented with equations that I won't understand.


texts:
Where to learn about "analog prototype filters"?

I've heard about them, but I'm unsure about what they really are and how they're constructed.


texts:
What would be the effective sampling rate of an op amp analog integrator (such as the one described here ) taking in a rapidly varying signal be? Ie what time resolution would such an integrator have?

The need for this to solve a practical problem has passed, as a different method of testing was ultimately selected, and so I intend this question to be as theoretical as possible, but in order to understand situation better I shall provide the original motivation. I was attempting to use a load cell in order to measure the momentum change of an object colliding with my load cell by taking the force reading of output of the load cell over time and numerically integrating the result. Unfortunately, my data logger only sampled at 1Khz and the impulse event was estimated to take only a few ms, thus providing much too small time resolution to accurately integrate afterwards. So, My thought was to hook the load cell output directly to an analog integrator and I should get a step function output that would read off to me a value proportional to the momentum change. From the transfer function of 1/s, it would seem as though I could do it for any signal regardless of how rapidly changing the signal is, however there must be some practical limit on how fast the integrator can respond. Can I assume a transistor switching speed (on the order of many Mhz and thus much faster than needed here) for the time resolution?


texts:
Using the DTFT property, find h[n] of a system where:

Is it an FIR or IIR system?


texts: I am currently trying to implement a GMSK demodulator, using Java. I am actualy trying to use the model of this block diagram. However, I really do not know what goes on within the mode selector and the differentiator. Does anyone have an understanding of this?, or is there a better method i can employ which may or may not be different from this ?


texts: What pattern maximises a JPEG file's size?

texts:
As I understand the JPEG algorithm, it smooths (ignores) gradual variations in colour and brightness in favour of high frequencies.  This loss of information is what creates the characteristic high level of compression relative to lossless algorithms.

So the grey square would result in a small JPEG file, whilst the grids should generate larger files:-

Clearly such grids /patterns could be of any pitch right up to single  pixels.  I'm stipulating that all the images are grey scale types. Is there some way to determine the type of pattern to maximise the size of a JPEG file, or must this be done experimentally?


texts:
I am unable to understand the discrete wavelet transform on images. I followed Robi Polikar's tutorial and got a brief idea about the theory. But I'm unable to understand w.r.t images.

Using Matlab's ndwt2('chess.jpg', 2, 'haar') function on the chess board , I obtained the other 7 images in the album. (Link to the album given in the end)

ndwt2() returns a structure, whose member dec contains the approximation (A), horizontal (H) , vertical (V) and diagonal (D) details.

This is where I have problem. What does A, H, V and D details of the image mean?

Also, how come is 1st image in the album approximation of the chessboard (assuming approximation means a rough estimate of the image) ? It just has lines where the borders of chess boxes are there. How is that an approximation, or have I understood it wrong?

EDIT

I was doing the mistake of converting the datatype of image returned by ndwt2 (which is the double datatype) to uint8.

these are the images that I now get.

Why does H details image contains some V details also, though the V in H are noisy? Same for V, it also contains some H details.

This was not the case previously, there H had exclusively vertical lines, V had only horizontal details, D was blank.

previous album


texts: Why not stop with the first level decomposition in wavelet?

texts:
Typically, We do wavelet decomposition with the last one level.
But I wonder, why do decomposition withh the last one level?
In the other word, why not stop with the first decomposition level?


texts: Intuition behind image derivative using Fourier Transform for edges detection

texts:
This equation can be shown mathematically:

$\frac{\partial f}{\partial x}=\frac{2\pi i}{N} \mathcal F^{-1}\left(u\cdot \mathcal F(f(x,y)\right)$

I am struggling to understand the intuition behind it when talking about 2D fourier for images and the use of derivatives to detect edges.

How does multiplying the Fourier transform of the image with $u$ help us detect edges in the x direction? Why does it make the "edges" white and the rest of the image darker?

Any help would be appreciated.
Thank you!


texts: Normalize speech features per dimensions or across dimensions

texts:
I am working on pipelines for audio processing (audio features that will go into a neural net to create some embeddings).

We are using two features : Filter banks, or MFCC.

I was wondering what was the good approach with normalization :

Should we normalize those frames on each dimension (each frequency / mfcc coefficient), or normalize across all dimensions ?

This could lead to important differences in the relative importance of features .


texts: Channel Capacity - is this only for discrete/digital signals?

texts: The units of channel capacity is bits/second. Does this mean this only refers to discrete/digital signals? Is channel capacity analogous to bandwidth in case of an analog signal transmission?


texts: Sample and Hold Circuit at Digital to Analog Converters

texts:
Does DACs contain sample-and-hold circuits? I am a bit confused
thanks


texts: what are the vector formats similar to hash codes to store user's voice for future voice verification?

texts:
I have wav file of ~2-10sec of user's voice, taken from a conversation.
Maybe it's SIMILAR TO a hash code.
the general voice verification should look like:

wav file -> vector
new wav file ->vector
compare 2 vectors with cosine similarity

which is the convenient way to store wav file to be able to verify it later on with another wav voice file?


texts:
I need to design a filter to reduce noise from accelerometer readings and use this data to a control system. One of the problems of a simple low-pass filter (like a single pole IIR filter) is the delay introduced by the filter. As an alternative I saw many people using a kalman filter or a median filter. I'm very interested in this median filter due to its simple formulation. But then I realize that it will always have some samples lag in the output. For the filter being able to output the present term, it should be able to read N/2 (or (N-1)/2) terms from the future which is obviously not possible in real time systems. So, at best, its output would be N/2 samples late.

The only difference I see in terms of delay between these two filters is that the low-pass may have different delays for different frequencies input while the median-filter has a constant sample lag. The larger the window size is(which is also related to how smooth our output will be), larger will be this lag. So it might be interesting to reconsider a single pole filter.

Is that reasoning correct?


texts:
I want to find the fundamental frequency for human voice in an Android Application. I want to use autocorrelation method. My code is this:

public double calculateFFT(double[] signal)

     {
      final int mNumberOfFFTPoints =1024;

      double[] magnitude = new double[mNumberOfFFTPoints/2];
      DoubleFFT_1D fft = new DoubleFFT_1D(mNumberOfFFTPoints);
      double[] fftData = new double[mNumberOfFFTPoints*2];
      double max_index=-1;
      double max_magnitude=-1;

      final float sampleRate=44100;
      double frequency;

      for (int i=0;i<mNumberOfFFTPoints;i++){

       //fftData[2 * i] = buffer[i+firstSample];
       fftData[2 * i] = signal[i];  //da controllare
       fftData[2 * i + 1] = 0;

       fft.complexForward(fftData);
      }

      for(int i = 0; i < mNumberOfFFTPoints/2; i++){

       magnitude[i]=Math.sqrt((fftData[2*i] * fftData[2*i]) + (fftData[2*i + 1] * fftData[2*i + 1]));

       if (max_magnitude<magnitude[i]){
        max_magnitude=magnitude[i];
        max_index=i;
       }
      }
      return frequency=sampleRate*(double)max_index/(double)mNumberOfFFTPoints;

 }

I used "edu.emory.mathcs.jtransforms.fft.DoubleFFT_1D;"
Is my "return"  the value of fundamental frequency or not?

thanks

I changed my code in this mode:

    public double calculateFFT(double[] signal)

    {

        final int mNumberOfFFTPoints =1024;
        double[] magnitude = new double[mNumberOfFFTPoints/2];
        DoubleFFT_1D fft = new DoubleFFT_1D(mNumberOfFFTPoints);
        double[] fftData = new double[mNumberOfFFTPoints*2];

        double max_index=-1;
        double max_magnitude=-1;

        final float sampleRate=44100;
        double frequency;

        for (int i=0;i<mNumberOfFFTPoints;i++){

            fftData[2 * i] = signal[i];
            fftData[2 * i + 1] = 0;

            }

        fft.complexForward(fftData);

        for(int i = 0,j=0; i < mNumberOfFFTPoints/2; i += 2,j++){

            magnitude[j]=Math.sqrt((fftData[2*i] * fftData[2*i]) + (fftData[2*i + 1] * fftData[2*i + 1]));

        }
         fft.complexInverse(fftData, false);

         for(int i=0;i<magnitude.length;i++)

            if (max_magnitude<magnitude[i]){
                max_magnitude=magnitude[i];
                max_index=i;
            }

            return frequency=sampleRate*(double)max_index/(double)mNumberOfFFTPoints;

}

in this mode I calculate autocorrelation thanks inverse transform "fft.complexInverse(fftData, false);"; isn't it?
And also in this case isn't the "return" the fundamental frequency?


texts:
Preamble: I want to stress that I don't know anything about photo-editing or signal processing. But I am a composer who happens to be working on a project in which sound / light overlap.

Question: Am I correct in understanding that a pixel of a given image contains a single RGB value?

Many thanks.


texts: Is the definition of recursion and iteration in signal processing different from computer science?

texts:
I was talking to my advisor today about this. He is a very experienced professor in this field, so I assume he is very knowledgable about it.

He pointed out that in signal processing, the word iteration means the repeated process that you repeat to gain a more accurate result (not the exact word, but generally this meaning). On the other hand, the word recursion means the actions that go on with every time instant. Basically, iterations happen within the same time instant, and recursions happen along the time instants.

However, as far as I can remember from the algorithm course that I took in undergrad, recursion means a function that can call itself repeatedly until there's no data left. The wikipedia page of recursion is consistent with my understanding.

What I guess is the situation now is, probably the definitions of recursion and iteration are different in SP than CS. I wanted to know, how exactly they are defined in signal processing. It is also possible that there is a different layer of the meaning of recursion that I didn't know, which made the two ways of understanding consistent. If there was a textbook or material that has the formal definition of them, it would be great.

I wanted to bring up the wikipedia page today during the meeting, but we ran out of time. I tried to google but couldn't find the answer. Guess I will ask him about it next time when we meet. :)


texts: Meaning: channel unknown and known at the transmiiter

texts:
What does "channel unknown" and "known at the transmitter" mean?

In books about signal processing, it has always mentioned it if capacity or transmission (estimation) is discussed. I can't understand the difference.

If I simulate the transmission, the channel is given to me (the channel is known at the Transmitter). I can model it using the standard function in Matlab or as a random function.  In estimation algorithms, like ZF, it is also used as a channel ( inverse of channel matrix) for an estimate. What is the difference? How can channel be unknown?

edit 1.

It is unclear what difference is between CSI unknown and known. If I  simulate transmission system, I need a channel. If H is given as a matrix or via rayleigh-function, it means CSI is known, isn't'?  The Capacity is computed using a channel matrix (in its equation).  I cant understand then why there are two difference equation: CSI known and unknown to the transmitter.


texts:
A signal $x=\sin(\pi t/4)$
sampled at every $t=1$ sec.
so $T=1$ sec
Sampled signal is then $x=\sin(\pi n/4)$,
What is the sampling rate in this case?,
And according to Nyquist sampling rate what should be the minimum sampling rate to sample this signal?


texts:
Does these codes hold true for up sampling and down sampling processes?
%for up sampling

unction Y = upsmpl(X,L)
 %X : input sampled signal
 %L  : up sampling rate
 n = length(X);
 Y = zeros(1,n*L+1);
 for i = 1:n
     Y(L*i+1)=X(i);
 end
 stem(Y)
end

%for down sampling

function Y = dnsampl(X,T)
%X : input sampled signal
%T : down sampling rate

for i=1:length(X)
    if(T*i<length(X))
        Y(i) = X(T*i);
    end
end

end


texts:
I listen to a podcast with interesting talk separated with horrible music.
I'd like to rewrite the podcast automatically to delete this "noise".

Edit: the talk and music is not simultaneously, it's talk for a couple of minutes, then a horrible song, then talk etc.
Erring on the side of caution is OK, some seconds of the beginning and end of music is OK.

Ideas?


texts: How do you find the position of when a signal changes frequency?

texts:
Suppose I have a signal which varies between two frequencies (which represent a stream of binary data). I think this is called BFSK. I have the entire signal already sampled. Let's say each 'bit' lasts 10ms. My plan was to have bins of 10ms, and do FFT to find the dominant frequency, and deduce the bit from that.

My problem is finding the start position of the sequency. The signal is garbled with noise, and has a significant RMS white noise. I have attached a picture of what I'm trying to convey. Note that the actual signal's amplitude won't be as differentiable between the unwanted noise and the wanted frequencies.

How can I find where the 'wanted' signal starts? Should I be trying a binary search tree (halving each window or something), or is there a more direct approach?


texts: I know how to determine if a filter is FIR or IIR, but I don't understand the question. What is a "jump response"?


texts: How to calculate the scale, rotation angle and translation between 2 images if we know the homography result matrix?result

texts:
I got the result of findHomorgraphy in OpenCv. As below:

Homography transform matrix:
[-1.1534205416542787    0.7834287271121142      527.9064589440736
-0.2415444621693116     0.16412191792642924     110.54458949396778
-0.002184845612886825   0.0014838718631386306   1.0 ]

I dont know how to calculate the rotation angle, scale, translation betwwen 2 iamges?
Could you please show me how to calculate these parameters?


texts: What's the difference between the Hough and Radon transforms?

texts:
I'm familiar with the Radon transform from learning about CT scans, but not the Hough transform.  Wikipedia says

  The (r,θ) plane is sometimes referred to as Hough space for the set of straight lines in two dimensions. This representation makes the Hough transform conceptually very close to the two-dimensional Radon transform. (They can be seen as different ways of looking at the same transform.[5])

Their output looks the same to me:

Wolfram Alpha: Radon
Wolfram Alpha: Hough

So I don't understand what the difference is.  Are they just the same thing seen in different ways?  What are the benefits of each different view?  Why aren't they combined into "the Hough-Radon transform"?


texts: Confusion regarding wav to MFCC conversion

texts:
I have to compare two .wav files.

I am converting the wav file to an MFCC file. Why am I getting different MFCC matrices when using different Matlab toolboxes (one of them is giving a matrix having 20 rows while the other two are giving matrices having 13 rows, and even those two matrices are not same)?

Why are the two matrices different? I have heard that there are 13 MFC coefficients. Does it have something to do with the number of rows?


texts: possibilty of extracting a tone from MIDI values

texts:
I have a project of recording human's sound via Android's SoundRecoder API, and then displaying the extracted note on The screen. It is specific for Android platform (can't use Jmusic or Jfugue API as javaSE environment is not supported).

Now suppose I get to record a sound using this API . How can I then deploy FFT to extract notes from this sound?  Basically as it is not pure sinusoidal wave it might involve multiple frequencies and overtones. Are there any good algorithms to do so? If yes, where I can simulate and the last of all whole of the extracted tone should be rendered on musical sheet?


texts:
I have to test whether the following system is invariant or not: $T[x[n]]=\sum_{k=n-1}^{n+2}x[k]$, so I want to verify that, if $y[n]=T[x[n]]$, then $y[n-N]=T[x[n-N]]$.
$$T[x[n-N]]=\sum_{k=n-1}^{n+2}x[k-N]$$
$$y[n-N]=\sum_{k=n-N-1}^{n-N+2}x[k]$$
In the first equation, if $k'=k-N$, we have that $T[x[n-N]]=\sum_{k'=n-N-1}^{n-N+2}x[k']$, so both sums are equal and thus the system is invariant. Is this correct or am I making wrong assumptions? Thanks in advance!


texts: How can the FFT be used for estimating linear chirp parameters?

texts: Consider a linear chirp signal, i.e. $f(t) = f_0 + kt$, where $f_0$ is the starting frequency, and $k$ is the chirp rate. After applying an FFT, how would I find the starting frequency and chirp rate?


texts:
I'm trying to find the zero crossings of a sine wave to transform the sine wave into a square wave. The only problem is that the sine wave is noisy, so I'm getting lots of jitter and false zero crossings.

Can anyone recommend any simple psuedocode or relevant materials? So far I have something like this:

 if (sample[i]>0 && sample[i+1]<0) || (sample[i]<0 && sample[i+1]>0)

Can anyone recommend a more robust method?


texts:
I have recently started reading about image processing, my knowledge in image processing is still very limited.
What I understood that DCT can help in image compression using Huffman, JPEG or MJPEG encoding.
My question, If we have an image as below:

which means that we have only three possibilities, 1, -1 or 0 in every pixel. they are distributed randomly, what I know that every column has 4 zeros and other values either 1 or -1. they are distributed randomly.
After performing DCT transformation, Does that compression for that image can be done efficiently,  Compared with the image which is full of 1 and -1 without any zeros.  How far can we compress that image perfectly? Finally, which encoding algorithm can be used perfectly in that case ?
Thank you so much in advance.