texts: How can I find the transfer function from this Bode diagram?

texts:
I've been given this bode diagram :

I've been asked to find the transfer function only by using the bode diagram.
It's the first time I'm doing this so here's what I thought.

The starting value is zero so the multiplying constant of the the transfer function has to be 1 and it is positive since the phase diagram starts from 0 degrees( it would start from 180 had it been negative)

From the fact that the starting degrees are 0 we derive that we have no pole or zero that is at the origin.

Also, the final degrees are -270 and the dBs are decreasing so I must have 3 poles.Am I correct?
Also ,I know that I can look at the curve , the dBs per decade at any point to see how many poles or zeros are acting. I can't get a good estimation though.It seems like it's 10 dBs per decade until the frequency reaches 10 rad/sec while I know it has to be a factor of 20 dBs. 60 dBs per dec mean 3 poles/zeros,40 dBs per dec mean 2 etc.

How do I know where the poles are if I can't tell where the angle of the curve changes? Is it clear and I can't see it?

By the way, I've been given the answer to check if I do it right in the end and it's as follows: $$ G=\frac{500}{s^3+20s^2+200s+500} $$ Also p =

-8.2390 + 8.6072i,
  -8.2390 - 8.6072i,
  -3.5220 + 0.0000i


texts: What is the best way to separate data using compressive sensing?

texts:
In the book Compressed Sensing by Kutyniok et al, the author talks about data separation using sparse representation. In summary, if we have a signal vector

$x = x_1 + x_2$

Then, it would be possible to have vectors $x_1$ and $x_2$ as a result. In order to do that, they use two basis $\Phi_1$ and $\Phi_2$ on which $x_1$ has a sparse representation in $\Phi_1$ but not in $\Phi_2$ and $x_2$ has a sparse representation in $\Phi_2$ and not in $\Phi_1$.

I am working with thin signals (spikes) and thick signals (sinc functions, gaussians, plateaus). There is a paper that intends to do this but uses sparsity in $x_1$ (thin signals) and sparsity in Daubechies 8 (D8) space for thick signals. This last point does not make sense to me since spikes and some thicks signals are sparse in D8 space.

Am I getting wrong something? Do you have any experience separating signals using CS? My mainly concern is what bases should I use to reconstruct thick signals.

Best regards.


texts: Codec Output has "Wavy" Amplitude on Chirp Input

texts:
I am sending a chirp that sweeps form 20Hz to 500Hz to an audio codec, CS42L52, connected to an MCU, STM32F405, and I am receiving a "wavy" amplitude output.  There is no processing on the MCU, I pass the signal straight from the DMA in to the DMA out.  The DMA services the I2S lines.  If I change the time that the chirp takes to get from 20 to 500 Hz, the amplitude wave changes its frequency.

This picture shows the chirp with a 10 second duration on top and 5 second duration on bottom, and shows that the amplitude frequency is twice as fast in the 5 second chirp vs the 10 second chirp.

(!

Looking at the codec block diagram, it shows that I can bypass the MCU in two different spots. The first being right after the PGA inputs and the next after gain adjust and ALC.

Both of these pass to the codec's DSP and then out to the codec's DAC according to this block diagram.

When I pass the signal through either of these lines, skipping the MCU, the output has a constant amplitude as it should.  The input signal is clean, no "wavy" amplitude. If I put one frequency through the device, no chirp, the amplitude stays constant.  I have played with a lot of the settings on the codec and can't seem to find any that affect the amplitude wave.  Maybe I am overlooking a setting?  This almost makes me think it is an MCU problem, but I am not manipulating the signal at all on the MCU.  Is it a problem that the DMA stores it as an unsigned integer?  What could be the problem?

My sampling frequency is set at 48 kHz, but I measure it at 48.5 kHz, could this affect it?


texts: Problem with Smoothing experimental data (Savitzky-Golay & C++)?

texts:
I'm trying to use Savitzky-Golay Filter to smooth experimental data. Savitzky-Golay computes $c_{n}$ in the following equation
$$ g_{i} = \displaystyle\sum\limits_{n=-n_{L}}^{n_{R}} c_{n}f_{i}+n$$

According to Numerical Recipes book by William H. Press. I've bought the library. The next step to calculate $g_{0}$ which represents the smoothed data. To fulfil that, we need to convolute $c_{n}$ with $f_{i}+n$. Luckily, there is a function to do so namely "convlv()". I'm passing 17 points of the stream data ( nl = 7, nr = 7, m = 4 ). To compute $c_{n}$, I'm using "savgol()". The sample rate of the experimental data is 1KHz ( 0.001 second ). After smoothing the data, the sample rate decreased to 100Hz WHY?.
The unsmoothed data is

and the smoothed data is

This is my code

    #include <iostream>
#include <fstream>
#include <vector>
#include "nr3.h"
#include "ludcmp.h"
#include "savgol.h"
#include "fourier.h"
#include "convlv.h"

int main(void)
{
    std::ifstream raw_data;
    std::ofstream smoothed_data;
    std::vector<double> x;

    raw_data.open("data.txt");
    smoothed_data.open("smoothed.txt");

    VecDoub_IO ans(17);
    VecDoub_IO data(17);
    VecDoub_IO respns(17);

    const Int np(17), nl(8), nr(8), ld(0), m(4);
     savgol(respns, np, nl, nr, ld,  m);
    for (int i = 0; i < 17; ++i)
    {
    std::cout << respns[i] << " ";
    }

    if (raw_data.fail())
    {
        std::cout << "Error in open xdata file";
    }
    if (smoothed_data.fail())
    {
        std::cout << "Error in Opening xdot file";
    }
    double line(0);
    while ( raw_data >> line )
    {
        x.push_back(line);
    }

    int xdata_counter(0);

    // void convlv(VecDoub_I &data, VecDoub_I &respns, const Int isign, VecDoub_O &ans)

    while ( xdata_counter < (x.size() - 25) )
    {
        for (int i = 8; i <= 17; ++i)
        {
            data[i] = x[xdata_counter];
            ++xdata_counter;

        }
        //four1(&data[0],data.size()/2,isign);
        convlv(data, respns, 1, ans);
        smoothed_data << ans[0] << std::endl;

        for (int i = 0; i < 8; ++i)
        {
            data[i] = data[i+1];
        }
    }

    raw_data.close();
    smoothed_data.close();

    return 0;
}


texts:
Using a micro-processor of 48MHz, I am trying to output a sine wave from the DAC (digital to analog ), and I am not sure if my Nyquist and calculations are good.

I have to output sine in frequencies range of 1KHz to 3MHz
I have created an array of a sine samples that has 1000 points(for 1 period )
I am running a timer between samples, and the frequency calculation

float timerFrequency=sineFrequency*1000; //(timerT*1000=finalSineT)

But then I was thinking that for 3MHz sine wave, I will need a timer frequency of 3GHz with this approach(!). (3Mhz signal * 1000 sine samples)

Something here is very wrong with everything, because if I have a processor that is 48MHz, I can probably output a 3MHz , isn't it ?

Whats wrong with my approach, and what are my limits with these assumptions ?
Can I reduce the sine samples array to lets say 100 ? what would it do to the Nyqvist at 3MHz ?
How many samples should my sine array needs? (the min), and my timer frequency?


texts:
I have to use Matlab with the iirnotch()-function to design a notch filter. The notch should sit at 520Hz, the Bandwidth should be 100Hz and I have a sampling frequency of 8000Hz.

The syntax for iirnotch() is

iirnotch(w0, bw)

See the example at the Mathworks-page. After reading the doc, i now know how i should use the w0
-property, but I don't really understand how I should use bw to include my given bandwidth!


texts: How to apply the provided wave transforms on an image

texts: I want to implement one of the following mappings in MATLAB and verify its performance on an image, but I couldn't. Please help me with the implementation


texts:
So here is the "seminal" YIN paper:

  Cheveigne A, Kawahara H. - YIN, a fundamental frequency estimator
  for speech and music

and the new, improved probabilistic YIN:

  Mauch M, Dixon S. - PYIN: A fundamental frequency estimator
  using probabilistic threshold distributions

Now, I am already at a point where I am unimpressed with the only new idea in YIN which is this "cumulative mean normalized difference function" (CMNDF) which seems to have, for its only purpose, to avoid picking the minimum of the "average squared difference function" (ASDF) that always exists at zero lag.  Big deeel.  There are other, better ways of avoiding that obvious error.

What I am trying to figure out with this pYIN is the pitch tracking and pitch candidate evaluation model.  I understand Markov processes and I think I understand what the Hidden Markov Model (HMM) is.  And I believe that they are trying to connect pitch candidates of the previous frame to pitch candidates of the current frame.  I have done this with my pitch detectors (but not so much using an HMM).  We do this to avoid glitches and bleeps arising from an octave error when either the presence of a subharmonic causes the period to appear to be twice as long as the desired period, or weak odd-harmonics causes the period to appear to be half as long as the desired period.  I am quite familiar with this problem and have attacked it with my own bonehead technique which seems to work pretty well, is simple, and makes very few assumptions about the model of the quasi-periodic signal of which we wanna know the period.

I haven't groked from the pYIN paper how a finite (hopefully small) number of pitch candidates are chosen in the current frame and how they are related to pitch candidates of the previous frame.

And then I wanna grok how they eventually score each pitch candidate for the final decision.

In my pitch detectors, I use a variant of autocorrelation computed directly from the ASDF function, and maxima of the autocorrection always correspond to minima of the ASDF.  Avoiding the peak at zero lag is trivial if you guarantee that the input to the pitch detector is DC free, but then of each peak that exceeds a very gross threshold, I handicap peaks at larger lags only slightly so that I do not spuriously pick the lag at two periods simply because it looks slightly better than the lag at one period.

Not shown in that SE answer of mine is how each peak that I consider a candidate to be a pitch candidate (these are peaks that exceed a gross threshold), determine the exact location (to fractional sample precision) and height of the peak using parabolic interpolation, and if that peak is one of the, say, five highest peaks, I call it a "pitch candidate" and associate that candidate with a candidate in the previous frame closest to the current candidate in log frequency (which is pitch).  Then a score is made to each current candidate that is a heuristic function of the current peak height and the previous frame assuming this current peak is tied one of the previous frame.  And for "stickiness", whatever candidate wins in the previous frame, if there is a candidate in the current frame that is tied to the previous frame winner, there is an extra boost to that candidate score.  A slight preference is give to the candidate that I had previously chosen.

But, what is Mauch and Dixon doing?  If there was some code outlining this, I would be interested.  I want to ditch the YIN thing but consider their candidate scoring method.  But I cannot decode it from the paper.


texts: Calculating THD where peaks are not exact harmonics

texts:
I have captured an FFT of a 1 kHz signal that I am generating using a WM8904 codec running at 48k samples/second connected via I2S to a ARM microcontroller (Atmel SAME70).  It appears to have some jitter in it, which I believe is due to a small delay in restarting the DMA after each block (which I know how to fix, but I was more interested at this point in the particulars of taking this measurement).  I am using a Agilent MSO7054B to make the measurements.

The fundatmental is clearly visible at 1.0 kHz.  But the next peak is at 2.1 kHz, not 2.0; the one after that at 3.2 kHz, etc.  Is that due to the jitter?

Can I still use those peaks to calculate a THD value?  When doing so, I got a value of 4.12%.  Does that seem reasonable?


texts: Audio signal processing book suggestions

texts: I want to start learning about audio signal processing but I cannot find a good starting point. Please suggest books or lecture series.


texts:
For digital images, noise is assumed to be additive gaussian white noise. I remember noise in images is considered as high frequency. However, from the link
https://en.wikipedia.org/wiki/White_noise, it says

  a random signal is considered "white noise" if it is observed to have
  a flat spectrum over the range of frequencies that is relevant to the
  context.

Does it mean frequencies of noise will extend from low frequencies to high frequencies? Why do we try to only remove high frequency component? Is human visual system  not sensitive to low frequency noise?

From the same link, https://en.wikipedia.org/wiki/White_noise

  In digital image processing, the pixels of a white noise image are
  typically arranged in a rectangular grid, and are assumed to be
  independent random variables with uniform probability distribution
  over some interval.

It reads that the pixels of a white noise image are assumed to be independent random variables with uniform probability distribution over some interval.
Does it mean that one pixel and its neighbors are i.i.d?


texts:
I am on chapter 6 of "Understanding digital signal processing", 3rd Edition by Richard G. Lyons. But I am stuck on question 6.15. Here is the network in question.

I wrote down the difference  equation as $$y(n)=x(n)+y(n-1)-Qy(n-1),$$ where $x(n)=D$(i.e. constant for all $n$), $Q$ is positive and less than $1$ and network is at rest at $n=0$ (i.e $y(n-1)=0$ when $n=0.$) In order to answer the question, I need to develop the series equation for $y(n)$ and find its closed form.

I have developed the series expression for $$y(n)=D\sum^n_{k=0}(-Q)^k {{(n+1)}!\over{(k+1)!(n-k)!}}.$$

And the terms without simplifying the factorials are $$y(n)=D{(n+1)!\over n!} - DQ{(n+1)!\over 2(n-1)!} +DQ^2{(n+1)!\over 6(n-2)!} -DQ^3{(n+1)!\over 24(n-3)!} . .. +(-Q)^nD$$.

My issue is that I cannot find where I have gone wrong because this series for $y(n)$ does not seem to have a common ratio which makes it hard for me to write it in the closed form as in  $$\sum^{N-1}_{n=p}r^n={r^p-r^N\over{1-r}}.$$

My question is, is my developed $y(n)$ suitable? If it is suitable, does it have a closed form?

Thanks


texts: Can I compute my IIR faster given limited possible input values?

texts:
I have an IIR routine in C++ I'm trying to speed up.

Currently I'm using a DF2 implementation. Since my input signal will always be either 1.0 or -1.0 is it possible for me to optimize the algorithm, removing some calculations or precomputing values for given blocks of input?

Thanks!


texts: systematic way to determine best bit mapping policy

texts:
So in class, we've been asked to find the best bit mapping policy for QAM modulation schemes (4-QAM, 8-QAM, 128-QAM, etc). Best meaning the one that will provide the lowest bit error Probability ($P_{be}$). I think I understand the concept, which is for each point closest to a given point, try to change the fewest number of bits. The absolute best case is gray coding, but that would only be possible for 4-QAM.

For example, I can come up with the best bit mapping policy for the star 8-QAM constellation below. ( the points are numbered in red)

for outside points (points 1,3,5, and 7) I'm making sure that the two closest points to each only 1 bit changes. So point 1 = 000, and point 2 = 100 (only the Most significant bit changed) and points 8 = 001 (only the least significant bit changed). For the 8-QAM, it's small enough that Just pick a random bit combination for the outside points, and then try to only change 1 bit to get to the center, but for a 16-QAM, for even a 256-QAM this starts getting difficult to just go about picking at random.

So my question is this; Is there a systematic way to go about selecting the bit mapping for these larger constellations?

Also, once we find the bit mapping policy, how can we calculate the bit error probability $P_{be}$? I know how to find the symbol error probability $P_{es}$, and i know for gray coding $P_{be} = \frac{P_{es}}{log_2 M}$ where $M$ is the number of symbols (for 8-QAM $M = 8$). but since everything higher than 4-QAM can only be partial gray coding, how do we determine $P_{be}$ in terms of $P_{es}$?


texts:
I'm doing a Machine Learning project that incorporates many DSP elements in feature extraction.  I am looking at the STFT of a piece of audio and trying to search for specific spectral features within it - for example, the exponential decay of the fundamental frequency of a kick drum - to determine what kind of sound the piece of audio is.

One thing I've looked into is finding the frequencies of all the local maxima of a DFT, unquantized.  This includes being able to identify when the peak is "between" bins based on contextual information.  A possible path to go down is to find all of the changes in direction within the spectrum, and then for N changes fit an $(N+1)$-degree polynomial using a regression, then finding all the zeroes of the derivative of this polynomial.

But does an algorithm for this already exist?  It seems like something that might have been done before.


texts:
I can't find a solution for my problem and I need your help.

I have to create an application to detect if a valve is open or close like this :

https://www.youtube.com/watch?v=VY92fqmSdfA

Some valves had a handle with color, but some valve don't, I dont know how I am going to resolve this problem to detect the valve position "close" or "open" without colors, I can't use machine learning because I have only 3 valves without colors and I can't create a large database.


texts: Why Runge-Kutta for Quaternion integration in Kalman filter?

texts:
I'm reading up on Kalman filtering at the moment. In particular, I'm interested in using the "extended" and "unscented" variants for IMU sensor fusion and calibration.

In A comparison of unscented and extended Kalman filtering for estimating quaternion motion, quaternions are used to represent 3d rotation.

I understand unit quaternions can be used to represent a 3d rotation. They suit for representing absolute attitude (a rotation from a universal reference), relative rotation, or angular velocity (a rotation representing rate per second, or some other fixed time period).

However, this papers discuss using Runge-Kutta integration, specifically RK4. It uses RK4 with the quaternions but doesn't seem to furnish details of what this involves or why it is necessary. Here's the part of the paper that mentions it…

  Given the state vector at step k − 1, we first perform the prediction step by finding the a priori state estimate xˆ−k by integrating equation 1 [f = dq/dt = qω/2] through time by ∆t (i.e., 1.0 divided by the current sampling rate) using a 4th Order Runge-Kutta scheme.

I've encountered Runge Kutta before for integrating positions in kinematics. I don't really understand how or why it would be needed here.

My naive approach would be to simply multiply the existing attitude q by the angular velocity ω to get the expected new q – I don't see why numerical integration is necessary here? Perhaps it's to "scale" the unit time ω to the change that occurs in in ∆t, but surely that can be done very simply by directly manipulating of ω (raising it to fractional power ∆t)?

Anyone know?


texts: Accessing Maximum Value from a Singular Value Decomposed Matrix

texts:
I have read few image enhancement papers, where an image is enhanced in transformed domain using either DCT (discrete cosine transform) or DWT (discrete wavelet transform) with SVD (singular value decomposition). An example is given in  Enhancement of low contrast satellite images using discrete cosine transform and singular value decomposition, 2011.

In these works, once the image matrix is factored into three matrices (say $U$, $S$, and $V$) using the SVD, then only the maximum value of matrix S is taken for processing. Can anyone please tell that why only the  maximum value is taken for processing?


texts:
With the following code, I get the "envelope" of a sound signal.
However in the "envelope" there are small oscillations (high frequency) : it is not smooth enough...

I imagine that it's possible to apply a low-pass to the "envelope signal" in order to  remove the high frequencies oscillations, but I also imagine it's probably better to do it directly by modifying this code :

double attack_coef = Math.Exp(Math.Log(0.01)/( 10 * 44100 * 0.001));   // 10 ms
double release_coef = Math.Exp(Math.Log(0.01)/( 100 * 44100 * 0.001));  // 100 ms
double envelope = 0.0;

for (int n = 0; n < file.Length; ++n)
{
 double tmp = Math.Abs(x[n]);
 if (tmp > envelope)
  envelope = attack_coef * (envelope - tmp) + tmp;
 else
  envelope = release_coef * (envelope - tmp) + tmp;

 env[n] = envelope;
}

Do you have an idea for that ?


texts: Question regarding AC power of ergodic process

texts:
We know Ergodic process is the subset of Weakly stationary process which permits us to substitute time average for ensemble Average

My teacher said If $X(t)$ is Ergodic random process then following relationships holds true and we even solved many questions based on these relations in which either graph of ACF(autocorelation function) or expression of ACF or PSD (fourier transform of ACF) is given and we're asked to find AC power,total power,Dc power etc.

but i don't know how to derive these expressions by exploiting property of ergodicity in mean and Auto-corelation .
$\lim_{\tau \to\infty}R_{XX}(\tau)=\text{d.c power}$

and $R_{XX}(0)$ = $\text{Total power}$

so, $R_{XX}(0)-R_{X}(\infty)=$$\text{A C power}$

any help or referance material will be appreciated.thank you


texts:
Im trying to tackle the following problem while still not having a firm idea on what "frequency resolution" means :

  Suppose we sample a continuous time signal with sampling period Ts = 1/2000, and then use a window of length 1000 on the resulting discrete time signal. If we transform it using a 2000 point DFT what would its frequency resolution be ?

Can anyone help me figure this out ?


texts: Why is $x$ not considered a primitive polynomial while being considered an irreducible polynomial?

texts: In "Shu Lin, Daniel J. Costello-Error Control Coding (2nd Edition), Prentice Hall 2004" it is given that in $GF(2)$, if $f(x)$ is an irreducible polynomial of degree $m$ it divides $x^n+1$ where $n = 2^m -1$. And as per mathematica documentation, $x$ is an irreducible polynomial, here is the conflict.  $x$ does not divide $x+1$.  Also $x$ is declared non-primitive!  Just want clarification.


texts: Blind Estimation of Signal Parameter and Noise Variance

texts:
Let $y[n]= h*x[n] + w[n]$, where $h$ is an unknown but deterministic parameter, $x[n]$ is a BPSK random variable with equal probability of +1 and -1, $w[n]$ are i.i.d. Gaussian with zero mean and unknown variance . Given $N$ observations find the estimate of $h$, and variance of noise.

$x[n]$ and $w[n]$ are independent.


texts:
I'm reading this paper about about an algorithm to measure image sharpness, and am confused by these sentences in the 6th paragraph:

It is well known that the attenuation of high-frequency content can lead to an image that appears blurred. One way to measure this effect is to examine the image’s magnitude spectrum $M(f)$, which is known to fall inversely with frequency, i.e. $M(f)\propto f^{-\alpha}$, where $f$ is the frequency and $-\alpha$ is the slope of the line $\log{M}\propto-\alpha \log{f}$.

I don't know what frequency this is referring to as the images this paper and algorithm are concerned with are grayscale, does anyone have a clue?


texts: Dependence of correlation peak height on GPS C/A signal's SNR, noise floor level (dBFS), correlation period length and ADC resolution

texts:
Assuming correlation at 2X the chip rate (2046 chips per period) and 500 Hz frequency search bins.

There are probably additional variables here that I'm missing and I'm not sure how to quantify a good peak but.

I'm trying to determine how much amplification I need in my acquisition setup to get good correlation peaks when correlating over 1 C/A code period.

I'm using a ceramic patch + 33dB gain GPS antenna with a 3m RG174 coax + RTL-SDR v3 (7 bit ADC) with 49dB gain (I'm not sure both are probably actually less gain, I've no way to measure).
The original data was sampled at 2.048MSps complex baseband.

I'm correlating in Octave with the signal re-sampled to 2.046MSps and using circular cross-correlation with the C/A code extended to be 2046 chips per period.

I'm only getting good correlation peaks over at least 5 periods for the strongest of signals and 10 or 20 periods for weaker ones. I also had to use 100Hz frequency bins, 500Hz was not enough to get good peaks.

I think my Octave script is fine, I've cross checked it with this script https://www.mathworks.com/matlabcentral/fileexchange/26035-joint-frequency-and-delay-correlation (feeding it my data) and the results are similar, I see a weak peak for the strongest signal in the recording.


texts: What is an approach in computer vision that can be used for tracking players in hockey games?

texts: It differs from human tracking in random environment in that detail that we have fixed environment. And players move pretty fast and it is important to resolve collisions and occlusions, keep track of right person. So please tell me what you think about this problem. Or what paper can be used to implement state-of-the-art approach for human tracking that you are aware of?


texts: Conflict with the properties of convolution

texts:
excuse me in advance for the lenghty question, consider the following signals:

$x_1[n]$, $x_2[n]$, $y[n]$ and

$z_1[n] = x_1[n] * y[n]$

$z_2[n] = x_2[n] * y[n]$

In addition, we know that:

$x_2[n] = x_1[n] - x_1[n-3]$

Thus, we can write:

$z_2[n] = (x_1[n] - x_1[n-3])*y[n]$

$z_2[n] = (x_1[n]*y[n]) - (x_1[n-3]*y[n])$

$z_2[n] = z_1[n] - (x_1[n-3]*y[n])$

Now for the question; the solution to the exercise I'm working on states that:

$z_2[n] = z_1[n] - z_1[n-3]$

Now this would mean that the following:

$z_1[n-3] = (x_1[n-3]*y[n])$ is true.

Isn't $z_1[n-3] = x_1[n-3]*y[n-3]$ ?

What makes me hesitate is that this development seems to support the given answer:

$x_1[n-3] = x_1[n]*\delta[n-3]$

$x_1[n-3] * y[n] = (x_1[n]*\delta[n-3])*y[n]$

$x_1[n-3] * y[n] = (x_1[n]*y[n])*\delta[n-3]$

$x_1[n-3] * y[n] = z_1[n]*\delta[n-3] = z_1[n-3]$

Which answer is correct and why is there a conflict with both reasonings? Thank you!


texts: DC bias from ADC in frequency detection scenarios

texts:
In real-world applications where a frequency or multiple frequencies need to be detected from a digital signal that comes from an analog-to-digital converter (ADC), what are the typical 0 Hz (direct current, DC) bias levels in the digital signal in comparison to general noise levels and the levels of the frequencies of interest?
I'm asking the question because, if the answer is that DC bias typically has a significantly higher level than the general noise level, then it may be important to give special attention to it when designing frequency detection methods, for example by doing the frequency detection after a digital DC-blocking filter, or by ensuring that frequency detection is done using a transform such as discrete Fourier transform (DFT) that has basis vectors (aside from the 0 Hz basis vector) that are orthogonal to the DC bias, or by employing windowing to reduce spectral leakage.


texts:
We can describe a BPSK signal, x, as:

$$x=cos(2\pi f_c t+n\pi),\;n\in \{ 0,1 \}$$

The BPSK signal is then transmitted through a narrow band frequency flat Rayleigh channel, described by a single complex exponential $h=Ae^{i\theta}$. $A$ has Rayleigh distribution and $\theta\sim\mathrm{Unif}(0,2\pi)$. The received signal at the destination is given as:

$$y=hx=Ae^{i\theta}[cos(2\pi f_c t+n\pi)].$$

My question is, what does the exponential term of the channel $e^{i\theta}$ represent? Clearly:

$$y\neq A[cos(2\pi f_c t+n\pi + \theta)].$$ This can be verified by expanding the sinusoids terms into their complex exponential forms.


texts: FFT averaging with different block sizes - how to scale the amplitudes

texts:
I need to analyze a real-valued time signal with a length of 300000 in the frequency domain. The sampling frequency is 100000Hz. In order to increase the signal-to-noise ratio  reduce the "fine-grain" fluctuation when your number of bins is too large I decided to split the whole signal in smaller blocks, calculate the FFT of the smaller blocks and average the spectra. I used Gnu Octave to implement this:

function A = fft_average(x, win_length, samp_freq)

%overlapping samples
step = win_length / 2;

% calculate frequency range
freq = 0:1/win_length*samp_freq:(win_length-1)/win_length*samp_freq;

%fft_win = ones(win_length,1);
%fft_win = hanning(win_length);
%fft_win = hamming(win_length);
fft_win = blackman(win_length);

y = zeros(win_length,1);
start = 1;
stop = win_length;
nsteps = 0;
while (stop <= length(x))
    nsteps = nsteps + 1;
    ytemp = abs(fft(x(start:stop).*fft_win));
    start = start + step;
    stop = stop + step;
    % add (and scale)
    y = y + ytemp;
end
% average
y = y./(nsteps);

%copy to result array, omit negative frequencies
A(:,1) = freq(1:win_length/2);
A(:,2) = y(1:win_length/2);

endfunction

Here are the results with 3 different block sizes of 1024, 4096 and 16384.
Additionally, I tried 4 different window functions. I only post results for rectangle and Hann Window due to lack of reputation.

I did not apply any scaling to the amplitudes yet. What I would expect from a correct scaling is consistency of the results for different block sizes. Hence no offset like in the second image for the Hann window.
If I scaled the amplitudes by the square root of the block size, the results for the Hann-windowed FFTs match. But I have 3 problems with this approach:

What would be the mathematical foundation to scale by the square root of the block size? Or is it the square root of the block size because I made an obvious mistake?
The amplitudes for the rectangle window do not match if I apply this scaling. Is this rather caused by spectral leakage?
Do I have to apply an additional scaling to account for the shape of the window function, i.e. so the integral remains the same?


texts: Is there a way to break down a signal into its respective phases (4 in this case) to be later analysed individually

texts: Is there a way to extract amplitude information but over 4 phases of the same frequency. That is, if the frequency is known could I extract amplitude peaks (between given values)in the time domain in lots of four, then separate them into "bins" or "arrays" ready for four individual FFTs?


texts:
I've got in total 6 images, from 2 cameras (thus 3 per camera) storing 16 bit data.

What I need to feedback to the user is like some sort of sharpness coefficient, preferably live while he is adjusting the focus of the whole system (since its looking into the eyes, it depends on the dioptres of the patient).

What I am currently using is a contrast coefficient combined with standard deviation, which should work fine, but with a change of the focus the field of view changes slightly, which can impact the contrast.

Now I wonder when I move to use the FFTW library to get the FFT of my image, it results in an array of fftw_complex (which is double[2]).

For my purpose, it should be fine to calculate the average of the resulting array, but I don't understand how to mangle real / complex components in this. Do I iterate over the whole array, calculate sum equalling sum of double[0] and double[1], or am I totally wrong here? I don't really understand why there is a real and a complex component. I understand that the FFT results in coefficients for different frequency sinus waves, but the frequency of the wave depends on its position in the array, while the amplitude should be the real component. Is the combination of real and complex variable responsible for the direction in the image, or what is it used for, and how would I use it to get an idea of an "average" frequency (sharpness) in the image?


texts: The similitude of interference cancellation and the use of earplugs

texts: I am trying to model a network for performance evaluation on a wireless system with interference cancellation. Then I stumbled upon a question that I needed to answer before I can proceed. Can interference cancellation be likened to the use of earplugs? For instance, if receivers in the network are interference cancellation-enabled i.e they can cancel interference from the transmitters in the network. Does canceling interference imply that the interference within the network as a whole has reduced OR does it mean that "the receivers now have earplugs ON" i.e. although there is interference present within the system they have been able to systematically prevent such interference from "disturbing" their reception. This would be useful for instance in a cognitive network where devices of another class might "want" to harvest such interference.


texts: An Intuitive Way to Understand the Sharpen Convolution Filter in Image Processing

texts: Can someone explain sharpen in a non-technical way. So, I don't mean that you need to multiply every pixel with 5 and subtract it with the pixel left, under, above and right.


texts: Does the use of a sparse basis in Compressed Sensing imply the need to have access to all the information beforehand?

texts:
According to literature, the CS framework operates on the knowledge that most natural signals are sparse in some domain given by a sparsifying transform operation $\Phi$ (Fourier, Haar, WHT, etc.).

Following a single-pixel camera example, if we are trying to image a phenomenon described by a signal $x$, we use a sampling matrix $A$ to obtain a compressed measurement $y=A\Phi x$ of a representation of $x$ in the $\Phi$ domain, which is sparse.

My question is, assuming we have some kind of physical single-pixel device (using a DMD to project linear combinations of $x$ (given by the sampling matrix $A$) onto a detector to obtain a measurement vector $y$), where does the sparsifying transform operation $\Phi$ manifest in this device?
Do the DMD patterns correspond not to the sampling matrix $A$, but to the $A\Phi$ product?
Must we provide the DMD with the signal in the sparse domain, $\Phi x$? In that case, don't we require previous knowledge of $x$ in its entirety in order to obtain its transform in the $\Phi$ domain? It is my understanding this is not the case, but I fail to grasp the mapping between the mathematical framework and hardware implementation in this matter.


texts: recover image by only magnitude of image fourier transform

texts:
I have a image and I want calculate fft2 of it, after it I want recover image only by magnitude of it. how can I achieve this work?

I=imread('1.bmp');
I = rgb2gray(I);
imafft = fft2(double(I));

 % Gets magnitude and phase.
 mag = abs(imafft);

 % Generates the modified spectrum
 newfft = mag.*exp(0*angle(imafft));
 ima_out = ifft2(newfft);
 imshow(abs(ima_out));

this is return me white page.


texts: What's the difference between calculating the FFT of a constant sound for 5 seconds versus every 1 second and taking the average?

texts:
I'm interested in learning the frequency spectrum of a constant sound. However, there is background noise. My plan is to record the sound for 1 second, take the FFT, and then doing this 5 times and taking the average (for each frequency bin). This should decrease the variance of the magnitudes across frequencies.

But I wonder what's the difference (ie, pro/con) of this versus just recording for 5 seconds and calculating the FFT?

Thanks


texts:
Is the system $y[n]=x[n]+2=T\{x[n]\}$ an LTI-System?

Linearity:
$ \alpha \cdot T\{x_1[n] \} + \beta \cdot T\{x_2[n] \} = T\{\alpha \cdot x_1[n]\ + \beta \cdot x_2[n] \} \\\alpha \cdot (x_1[n]+2) + \beta  \cdot(x_2[n]+2)= \alpha \cdot (x_1[n]+2) + \beta  \cdot(x_2[n]+2)$

Time-Invariance:
$y_1[n] = y[n-n_0] = x[n-n_0]+2 \\ x_2[n]= x_1[n-n_0]\\ y_2 [n]=T\{x_2[n ]\}= x[n-n_0]+2 \\y_1[n]=y_2[n]$

So I would say it is an LTI-System, is that right?


texts: Why zig zag manner scan is used in DCT for image compression?

texts: I am not sure why zig zag manner scan is used in DCT. I can guess that might because it moves from low frequency component to high frequency component and as most of the energy is stored in low frequency component that's why this way of scan is favored but not quite sure.


texts:
I have a program running in python. It samples the demodulated FM output from an SDR. When there is no transmission, the input to the program is completely static.
How can I go about squelching the audio in a way like CSQ on a radio?
Here is what I have so far:
                    if tx_chan == 100:
                        print(np.max(abs(amplitude)))

                    if debug == True:
                        print('%s:%s '%(tx_chan,sqelch_count))

                    #Figure out if a chunk is recordable
                    if CTCSS != 'CSQ':
                        CTCSS = int(float(CTCSS))
                        for peak in peakutils.indexes(abs(np.fft.rfft(amplitude)),thres=0.2):
                            freq = (np.fft.rfftfreq(len(amplitude))*26666.66)[peak]
                            if int(freq) in range(CTCSS-2,CTCSS+2):
                                is_good = True
                                curr_ctcss = freq
                            else:
                                if sqelch_count == 0 and HighCount > 10:
                                    is_good = True
                                    curr_ctcss = 'CSQ Overide; Squelch Count: %s'%sqelch_count
                                if sqelch_count == 0:
                                    is_good = True
                                    curr_ctcss = 'CSQ Overide; Squelch Count: %s'%sqelch_count

                                else:
                                    is_good = False
                                    curr_ctcss = 'CSQ & CTCSS Fail; Squelch Count: %s; CTCSS: %s'%(sqelch_count,freq)
                            if freq > 255:
                                break
                        if is_good == False and total_count == 0 and sqelch_count == 0:
                            is_good == True```


texts: Estimate IR's from single channel speech audio

texts:
I have a dataset of single-channel audios containing speech, recorded in a single room. I need to extract the room IR's. The goal is to simulate the room acoustics and adjust new speech audios recorded with close microphone such that the reverberation is similar to the room in question. What are my best bets? I read a few papers about the topic, but they mostly assume that the distance between the speaker and the microphone is known and that the speaker produces white noise. I am looking for more literature regarding this problem. The papers I read:

MAXIMUM A POSTERIORI ESTIMATION OF ROOM IMPULSE RESPONSES
Estimation of TDOA for room reflections by iterative weighted l1 constraint

Impulse Response Data Augmentation and Deep Neural Networks for Blind Room Acoustic Parameter Estimation


texts:
Is it possible to use NMF for a sort of supervised polyphonic instrument recognition?

I have training data for a timpani and training data for a bongo (or a bongo, snare and box drum). How can I detect and classify them when they are played simultaneously, given the prior information?


texts:
I designed an FIR highpass filter which is causing a phase shift to the output. The output signal is also not stable (?) on start.
Are these normal or am I doing something wrong?
If these are normal, what causes these?
(Attached is a diagram showing the input in blue and the output in red).
Thanks.


texts: How do I compute the DC component given the other part of the Fourier spectrum?

texts:
I often see examples in textbooks where someone constructs a 2D Fourier spectrum of an image by fixing two (symmetric) pixels to a given value, and computes the inverse DFT to get a nice waveform image. I want to know how these images are created. It seems to me that they pick one pixel that would give them the desired spacing and orientation, fill in the symmetric opposite pixel with the conjugate value, and then somehow fill in the DC component.

This last part is what's confusing me. I want to answer the more general question: if you're given the non-DC frequency components of the Fourier spectrum of an image, how do you compute the DC component? I would be happy with an algorithmic solution, as I'm working on signals in Python with the scipy/numpy suite.


texts: Noise when dividing or multiplying signal in C

texts:
I'm trying to create a echo effect and have managed to add multiple delays but when i try to divide or multiply these numbers the signal is completely distorted and adds a lot of noise to the system.

This is my some of my program written in C.

            unsigned char txBuf0[AUDIO_BUF_SIZE];
            unsigned char rxBuf0[AUDIO_BUF_SIZE];

            int i, n, x;
            unsigned short Stor0[2000], Stor1[2000],Stor2[2000], Stor3[2000], z, ze;

            for(i=4; i < AUDIO_BUF_SIZE; i+= 4)
            {
                x= i/4;
                if(lastFullRxBuf == 0){
                    Stor3[x] = Stor2[x]/2;
                    Stor2[x] = Stor1[x]/2;
                    Stor1[x]= Stor0[x]/2;
                    Stor0[x] = 0;
                    Stor0[x] =((rxBuf0[i-4]) | (rxBuf0[i-3])<<8);

                    z = (Stor0[x]) + (Stor1[x])+ (Stor2[x]) +(Stor3[x]);

                    rxBuf0[i-4]= z;
                    rxBuf0[i-3]= z>>8;

                    txBuf0[i-4]=rxBuf0[i-4];
                    txBuf0[i-3]=rxBuf0[i-3];
                }


texts: Interpreting the accuracy of solutions to the correspondence problem

texts:
I have two pictures of the same object, taken by a car travelling down the road like shown on the right side of the image below. I want to find pixels of the object in each frame that correspond to each other.
Now, in the description of the Middlebury Stereo Evaluation v.3 dataset it says

Maximum disparities range from 200 to 800 pixels at full resolution.

This leads me to my two questions:

Do I understand correctly that algorithms working with the Middlebury dataset had to match pixels that were a distance of 200 to 800 pixels apart, like shown on the left side of the image?
Consider the leaderboard for the Middlebury Stereo Evaluation. Does an average absolute error metric of 1.4 mean, that above problem could be solved for the images in the dataset with an average accuracy of 1.4 pixels?


texts:
I'd Like to ask two questions :

What is the difference between studying Signal processing (both Deterministic and statistical) in Department of Electrical Engineering versus Department of Mathematics and statistics

What's All the mathematical topics (both time/n-domain and f/S f/Z domain ) which is a prerequisites of studying Signal Processing (Both continuous and discrete) or reading a book like "signals and systems" by "Alan Oppenheim" ??

Thanks All


texts: Solving LASSO ($ {L}_{1} $ Regularized Least Squares) with Gradient Descent

texts:
To the best of my knowledge, state of the art methods for optimizing the LASSO objective function include the LARS algorithm and proximal gradient methods.

I was wondering however, if the LASSO objective function
$$ ||y-Ax||_2^2 + \lambda ||x||_1$$ can be optimized using (vanilla) gradient descent?

I know that the 1-norm is not differentiable at zero, but numerically one is never exactly at zero. Therefore the gradient exists at each iteration point $x^{(k)}$ and I do not really need to resort to subgradients.

Unlike for the L2-penalized least squares, the gradient descent step would of course need a decreasing step size and would not yield exact zeros.

Can this method be called gradient descent or would it be better to call it subgradient descent or something else?

Many thanks!


texts: Comparison between Fourier transform, short-time Fourier transform and wavelets

texts: What is the difference between the Fourier transform, short-time Fourier transform and wavelets?


texts:
In the one-dimensional case of the DWT there is a decrease in temporal resolution for deeper decomposition levels but at the advantage of halving the bandwidth towards lower frequencies for every level. (The first frequency range being half the sample frequency to quarter the sampling frequency) This can also be understood intuitively by looking at the dyadic time-frequency tiling for the DWT or the detail and approximation coefficients of successive subbands.

Now I am trying to understand the analogous meaning of the 2-dimensional case for natural images. Is it true, that for every decomposition level, there is a loss of spatial resolution while the spatial frequencies of the image are captured increasingly better for decreasing frequencies? (of course now we have 3 detail subbands and one approximation band which is successively transformed again)
If so, what are then the concrete spatial frequency ranges that are subdivided?
I guess I am just having trouble grasping the transfer from temporal to spatial here. Would somebody be so kind and help me to understand the intuition here?
To check that I understood the concept: For a 2D FFT there is only one output giving information about the spatial frequencies in both directions with optimal orientation. For 2D DWT on the other hand, a single decomposition level only yields frequency information of that specific (quite broad range) but with the advantage of maintaining some localization information. However, several subband plots have to be combined for the full picture. Is this correct?


texts: What is the meaning of the sum of kernel components in digital image filtering?

texts:
When analyzing an image signal as a series of Dirac impulses in the continuous spatial domain, I applied continuous low pass filters (to reconstruct or smooth it) with area equal to 1 to preserve the low frequency amplitudes in the signal spectrum. When using a kernel (which, correct me if I'm wrong, is just the "sampled" discrete version of the original continuous filter in the spatial domain) I was wondering what is the meaning of the sum of the kernel components, and when I should care?

I often see examples with kernels with components which sum to one, stating they preserves the original image brightness. But if the original continuous signal integrates to one, it does not mean the discrete version will sum to one, so this left me a bit confused.


texts: Implementing Wavelet Transform using Equations

texts:
I want to implement Wavelet Transform from the scratch, that mean breaking the wavelet transform into its equations to implement in any Programming language. Matlab Comes with built-in functions to implement Wavelet Transform but It is really hard to understand which processes are exactly involved in the implementation if one wants to develop their own functions.

I know there are Low and High Pass filter involved and the other step called , Down-Sampling but I still have so many doubts on how exactly to combine these filters and samplers to design one's own Wavelet Transform function.

The wavelet tranform block diagram looks like this,

but there are so many Wavelet transform like Haar, db1, db2 etc. Which wavelet tranform does this blog diagram defines anyway.


texts: Please explain Multiplication property in Z transform?

texts:
I am having problem visualizing contour any example will be great help.
As far as as where I need it I was trying to find Z transform of a contracted signal by first multiplication by impulse train.


texts: Spatial and temporal frequency of a wave

texts:
I've sampled a propagating wave so that I know its amplitude at several equidistant points on a line, and at several points in time. That is, I have this discrete function:

f[t,x]

Now, I want to find the frequency of the wave. But there seems to be two frequencies I can calculate: by finding the FFT at different points in time (e.g. FFT{f[1,x]} ) and at different points in space (e.g. FFT{f[t,1]}).

Only the latter ("temporal frequency") gives me a main frequency in Hz. The other one gives one in 1/m, but I suppose that if I knew the wave propagation speed in m/s, I could convert one to the other. Is this true?

All of the above I've just reasoned through myself. Could someone point me to a source where I could read about the two different types of frequency?

Edit: I'll add that the time-space relation is "normal", i.e. the wave propagates like $g(kx-\omega t)$. Hope I'm not being too unclear. I realise that I'm lacking the terminology needed to explain what I mean.

Edit 2: It might be important to know that $f$ is a pulse that is localised in time and space.

Edit 3: I'll put this question here too: Is there a way to take advantage of all the sample points (a 2D matrix) to estimate the central frequency, assuming I know the wave speed?


texts: Why do we need different modulation techniques? Is it because we need to convert from analogue to digital data sometimes? Also what are typical applications where modulation schemes are used apart from wireless scenarios?


texts: With reference to the diagram below, is it correct to say that at the pass band the phase response is linear. It also remains linear in the stop band but it get chunks of π. These jumps happen when the magnitude response goes down to minus infinity dB (theoretically) ?


texts:
The Ornstein-Uhlenbeck (OU) process

$dX_t = -\frac{1}{\mu} X_t + \sqrt{\frac{2\sigma^2}{\mu}} dW_t $

generates coloured noise with autocorrelation function $R(t) = \langle X_t,X_{t'}\rangle = \sigma^2 e^{-|t-t'|/\mu}$.

I would be interested in modelling a process $ Y_t = \alpha t + X_t$. After some searching, I came across the terms "OU process with drift" or "trending OU process".

Does anyone know what is the autocorrelation function of the process $Y_t$? Thank you!


texts: How to handle edge effects with EMD (HHT)?

texts:
In the application of the Huang Hilbert Transform (HHT) (or aka EMD, Empirical Mode Decomposition), there is the notable challenge of handling the edges (boundaries) of the signals; as noted in the answer link to its mention in other question.

What are some practical techniques that can be applied to signals in which there is 'noise' padding already present and when there is no redundant signal information at the boundaries? (eg how would a mirroring strategy be applied?)


texts: What are some of the main high level approaches for analysis of kinematic sensor data?

texts:
I'm a computer vision and deep learning specialist. I've just started a project which will involve having to detect certain events in a stream of kinematic sensor data. By searching through the literature, I've found a lot of highly specific papers, but no general reviews.
If I search up on computer vision, I'm likely to get 100s of articles giving overviews of different types of architectures for various vision tasks. They would look something like this:

We mainly use CNNs which work like this ...
For object detection we use one or two stage detectors which look like this...
For video classification we can use 3D CNNs or RNNs...
.... etc

So I'm looking for something similar with regard to kinematic motion sensors.


texts: ًWhy we use fourier transform in most of spectrum estimation approaches?

texts: I wonder why in all spectrum estimation techniques, the analysis depend on the Fourier transform? Why not deal with the signals in time domain?


texts: What technique could I use to smooth the right amount these signals?

texts:
I'm developing an application which one of its capabilities is peak detection.
I expect to handle three types of the similar data (Acceleration vs Frequency) but measured in different laboratories and with different sampling and noise. The data is not equally spaced in frequency.

Here is the plot of each of them:

Detail of the previous one

The first contains about 2000 points and there are a lot of local maxima detected. I can't use an average-smooth because the last one contains only 100 points and if I do so I will be missing important peaks (each peak occupy only 3-7 points).

What can I do to improve the detection of peaks and how it could be done?

Thank you very much.


texts: Loop Filter Coefficients in Timing Recovery loop in Baseband Receiver

texts:
I am trying to design the Symbol timing recovery(#STR) block of #DVBS Receiver.  For reference, I am using the following matlab simulink design  (NDA timing recovery part within Digital Baseband Receiver)

http://www.mathworks.com/matlabcentral/fileexchang...

The design has considered a roll-off factor of 0.5. I need to design for a roll-off factor of 0.2.

All other parameters remaining constant, I believe the only factor that will change in the design would be the loop filter coefficients. But , I am not able to understand how the loop filter coefficients of PI filter are calculated in the design.

The value of the loop filter coefficients are C2 = 1.35e-4, C1 = C2/128.where c2 = proportional filter coefficient, c1 = integral filter coefficient.

C2 depends on k0,kd,zeta(damping ratio), natural frequency (wn),(zeta and wn determine loop bandwidth).

How to calculate kd? From my  understanding , it should be the slope of S-CURVE of gardner TED when error tends to zero.

Kindly clarify.

Regards avi


texts: Why LTI system cannot generate new frequencies?

texts:
Why $Y (\omega) = X(\omega)H(\omega)$ implies that an LTI system cannot
generate any new frequencies?
Why if a system generates new frequencies, then it is not LTI?


texts: Region of the coefficients of a quadratic equation that cause the roots of it to be in the unit disk

texts:
From Simon Haykin's Adaptive Filter Theory: consider the characteristic equation is $1+_1^{−1}+_2^{−2}=0$, then for the roots to be inside the unit circle (i.e. in the unit disk), the coefficients of the quadratic must satisfy the following conditions: $-1\le a_1+a_2$, $-1\le a_2-a_1$, and $-1\le a_2\le 1$.
I could figure this out some of the way. For complex roots it follows that the coefficients lie in the region defined by the intersection of $4a_2>a_1^2$ and $a_2<1$. For real roots, I could prove that $|a_2|<1$, and obviously $4a_2\le a_1^2$. But I cannot figure out how the other two line boundaries of the region can be derived. Can someone please explain how?
An approach for the case with complex roots is shown here: https://math.stackexchange.com/questions/1839654/show-the-roots-of-the-quadratic-equation-z2-bz-c-0-lie-in-or-on-the-unit
I've also asked this question here: https://math.stackexchange.com/questions/1839654/show-the-roots-of-the-quadratic-equation-z2-bz-c-0-lie-in-or-on-the-unit, although there is a typo in that posting in the third condition specifying the boundary of the region of the coefficients, and I don't have enough reputation there to fix it.


texts:
What are the best solutions to detect line in a point cloud? Comparison being made with and between Hough Transform, Radon Transform, RANSAC (see wikipedia) and Brute-Force Search (see wikipedia).
Which one is the most robust against the dispersion of points in point cloud?
Note:
1- The question is about 3D point cloud not image.
2- Points in point cloud are randomly dispersed (completely sparse locations).
3- There is no information about the object (line) being explored in terms of preferred orientation, size, etc.
4- A tolerance needs to be considered around the candidate line.
Updates:
According to my experiments: RANSAC could miss easily some lines. It is good for quick detection of edges however the complexity of point dispersion could produce undesired outputs. Hough and Radon are very similar and I had not chance to try for 3D point cloud however they work well on 2D cases. There is a difficulty in extraction of segments of found lines. BFS is simply impractical for large data set.


texts: What is the relationship between poles and system stability?

texts:
I see two notions that describe the relationship between poles and system stability. But they are not the same from my understanding

The system is BIBO stable if and only if all the poles are in the
left half of the complex plane
A LTI system with a rational system function H(z) is stable if and only if all of the poles of H(z) lie inside the unit circle.

Why these two notions are different? Is that in different conditions?


texts: Can a causal filter without phase shifts exist?

texts:
When I was studying dispersion of refraction index in semiconductors and dielectrics, my professor tried to explain that if a filter (like a dielectric absorbing some light frequencies, or an electric RC-filter) removes some frequencies, then the remaining ones must be phase shifted to compensate for those frequencies (which are infinitely spread in time as usual monochromatic signals) being subtracted from the whole signal, to preserve causality.

I intuitively understand what he was talking about, but what I'm not sure of is whether his argument is really justified - i.e. whether there can exist a non-trivial filter, which absorbs some frequencies and leaves remaining ones not shifted, but still preserving causality. I can't seem to construct one, but can't prove it doesn't exist as well.

So the question is: how can it be (dis)proved that a causal filter must shift phases of frequencies relative to each other?


texts:
I'm just learning about linear prediction and was wondering whether or not there are any signals that would produce no error if run through a linear prediction algorithm. I was thinking (maybe naively) that if we have a linear signal (one that changes linearly with time) that we should be able to linearly predict this with no error. Is my intuition on this correct? Are there any other signals that are like this?

First of all, thanks so much for the replies! Secondly, I'm glad my intuition was correct, but I was having doubts in the first place because I couldn't exactly predict future samples of my signal no matter what my input signal was. For example, here's an image of me trying to get the linear prediction coefficients using 'lpc' function in Matlab.

I've tried this for several of the types of signals suggested above, and didn't get the correct coefficients for any of them. Why does this happen? I doubt the 'lpc' function is incorrect so it just must be doing something different than what I thought it was doing.


texts:
I'm working in a computer vision project, where the goal is to detect some specific parasites, but now that I have the images, I noticed that they have a watermark that specifies the microscope graduation. I have some ideas of how to remove this noise, like detecting the numbers and replace for the most common background or split the image but if I split the image I'll lose information.
I would like to hear some recommendations and guidelines of experts.
Example image below.


texts: What are the advantages of wavelet transform for image multiresolution analysis?

texts: Compared to gaussian pyramid and laplacian pyramid, what are the advantages and disadvantages of wavelet decomposition for multiresolution image analysis? Thank you.


texts:
I'm writing a program to emulate a vocoder and it obviously works, but any speech that comes through is very difficult to understand. I'm going to explain exactly how my implementation works and then maybe somebody with experience with vocoders or DSP can help me.

128 samples of the voice signal go through a Fast Fourier Transform every audio frame. I then take the absolute value of the complex outputs to get the formant of the voice. I chose this rather than multiple band pass filters and envelope followers because it's faster just to do an FFT. I am 100% sure that this is all done correctly.

My carrier wave is run through several band pass filters centered around frequencies corresponding to the FFT output frequencies. To construct the output I multiply the output of these filters by the corresponding amplitudes in the voice formant obtained from the FFT and add all of these products.

There's a few things that I suspect may be causing issues.
The algorithm I used to implement the band pass filters is probably not the best. I feed the output of a low pass filter into a high pass filter. I got the algorithms for the filters under the "Algorithmic Implementation" section of the low pass and high pass filter articles on Wikipedia. I have a strong feeling that these simple filters may not be attenuating unwanted frequencies very well but I can't find a better way to make my band pass filter.
I also suspect that my carrier wave might not be very good. As I understand it, you need a carrier wave rich in lots of different frequency content (so obviously not a sine wave). I've listened to a lot of vocoders and the carrier wave usually sounds like it's got some dissonant notes in it. I've tried additive synthesis and FM synthesis but I just can't get a carrier wave that doesn't sound too "clean".

If somebody could give me a better band pass algorithm (if that's what I need), a good formula for a carrier wave, or point out some other likely problem I would be very grateful.

ALSO, "vocoder" is not an available tag. Maybe somebody with enough permissions could kindly add this tag? Also, there's a tag for signal-processing but not digital-signal-processing or DSP, I'm not sure if it would be appropriate to add one of these tags or not.


texts: Fail to separate sound signals by FastICA on real-world recording

texts:
I have written a program to perform FastICA on a stereo WAV file using the code on Python MDP FastICA Example

With the audio examples I get very good results.

Then I try to do real world recording using two computer mono microphones connected to the stereo mic in of my pc by connecting mic 1 to L channel and mic 2 to R channel. I test by playing some music at the background while I am talking in a quiet room.

However, running FastICA does not separate the signals at all. Is it possible that the quality of microphones is too poor? Do I need to do anything to the recorded WAV file (16 bits, signed PCM, 44100Hz) before running FastICA?

You can download the recording here.


texts: What is sound output delay of a band pass filter at different freqencies?

texts:
I measured that a 2-pole band pass filter, given imput audio of different frequencies, outputs an audio signal with different time delay.

At 440Hz, the time delay between of the input audio and the output audio is something in the order of (1/440)*200000 = 454 samples and at 1Khz it's about (1/1000)*200000 = 200 samples.

What is the theoretical correlation between filter peak frequency and the delay time of the output signal?


texts: Different values when calculating signal's energy by hand vs MATLAB

texts:
Given the following signal:
$$
x(n) =
\left\{
\begin{array}{ll}
      u(0.01n-0.025)2.3704e^{(-0.287682n)},   & n\ge 0 \\
      u(-(0.01n+0.025))2.3704e^{(0.287682n)}, & n< 0 \\
\end{array}
\right.
$$
I'm finding the energy using the summation formula:
$$E_{x(n)}=\sum_{n=-\infty}^\infty |x(n)|^2=\sum_{n=0}^\infty(2.3704e^{(-0.287682n)}u(0.01n-0.025))^2+\sum_{n=-\infty}^0 (2.3704e^{(0.287682n)}u(-(0.01n+0.025)))^2 =\sum_{n=0}^\infty(2.3704e^{(-0.287682n)}u(0.01n-0.025))^2+\sum_{n=0}^\infty(2.3704e^{(-0.287682n)}u(-(0.01n+0.025)))^2 = 2\times2.3704^2\times \sum_{n=0}^\infty (e^{(-0.287682\times 2)}u(0.01n-0.025))^n$$
So due to the sampling frequency and other information given about the problem, the sampling doesn't start until $n=3$ so I adjusted the limits of summation and removed the u(n) function:
$$=2\times2.3704^2\times \sum_{n=3}^\infty (e^{(-0.287682\times 2)})^n$$
And then adjusted the series to begin at $n=1$ so I could use the summation formula:
$$=2\times2.3704^2\times(\sum_{n=1}^\infty (e^{(-0.287682\times 2)})^n - (e^{(-0.287682\times 2)})^1 - (e^{(-0.287682\times 2)})^2)$$
So the series converges since the common ratio $<1$ and the sum of the series is:
$$S_{\infty}=\frac{a_1}{1-r}=\frac{(e^{(-0.287682\times 2)})^1}{1-e^{(-0.287682\times 2)}}=1.2857$$
Replacing the number above in the energy summation equation, I get:
$$E_{x(n)}=2\times 2.3704^2\times(1.2857-0.5625-0.3164)=4.5715$$
However, when I use MATLAB to find the energy of the signal using the following code:
E = 0
for i=1:fs+1
    E = E + abs(x(i))^2
end

where fs is the sampling frequency, the code yields the following result:
$$E=2.2858$$
which doesn't match my mathematical method. However, I noticed that the answer that MATLAB gives me is half the answer of what I got by hand. I also know with certainty that the MATLAB answer is correct.
So how do I go from $4.5715$ to $2.2858$? What's the step/reasoning that I'm missing?
Thank you!


texts: lock in detection based denoising using matlab?

texts:
What are the limitations of implementing the lock in detection technique in matlab?
I have time varying data with known frequency with huge background noise. The reference signal is also available. How efficiently can i recover the signal from the noise using the software implementation of the lock in detection?


texts: Calculating frequencies manually while plotting fft values

texts:
While calculating FFT(Fast Fourier Transform) of real data, to generate the frequencies I am using the formula:

(Index*samplingFrequency)/InputDataLength

What doubt I have is, in the above formula to generate frequencies should the index start from 0 or one. As, I know that the last frequency of the plot in general is the half of the sampling rate.
So, while plotting FFT values vs frequencies, frequencies should start from 0 or first frequency value.
I am using this library to plot the fft values:
corban Brook js library
I get only fft output spectrum values but not frequencies to plot so, I have to plot frequencies manually.
Any suggestion or input could be greatly appreciated.
Thank you.


texts: Channel models for wireless body area networks

texts: To transmit a signal over wireless body area network, the signal is transmitted over a fading channel with additive white Gaussian noise. The channel model can be obtained from the IEEE standards. My question is about the range of values of the SNR for the additive noise. In some papers, I found that simulation is done for SNRs ranging from zero db to about 20 db. Is this a suitable range? Do we need to simulate negative values for the SNR?


texts:
I'm trying to generate a modulated Gaussian pulse. First I'm generating the pulse in the time domain perform FFT and displaying both in time and frequency, then I'm multiplying it with cosine term (which is related to distance measurement - Interferometry).
The modulated pulse seems undersampled, I tried to increase 'L', still doesn't look to what I look for.
I also trying to rescale all the parameters, but I stuck with some of them.

clear all; close all;
f=374.7e12;%Hz
fs=f*10; %sampling frequency
T=1/fs;
L=4000;
sigma=40e-15;
t=(0:L-1)*T; %time base

x=(exp(-(t-400e-15).^2/(2*sigma)^2)).*exp(1i*2*pi*f*t);
subplot(2,1,1)
plot(t,real(x),'b');
title(['Gaussian Pulse \sigma=', num2str(sigma),'s']);
xlabel('Time(s)');
ylabel('Amplitude');
ylim([-1 1])
% xlim([1e-15 9e-15])

NFFT = 2^nextpow2(L);
X = fft(x,NFFT)/L;
Pxx=X.*conj(X)/(NFFT*NFFT); %computing power with proper scaling
f = fs/2*linspace(0,1,NFFT/2+1); %Frequency Vector
subplot(2,1,2)

plot(f,2*abs(X(1:NFFT/2+1)))
title('Magnitude of FFT');
xlabel('Frequency (Hz)')
ylabel('Magnitude |X(f)|');

Cav_len=0.3;%Meter
delta_L=-40e-6;
fr=1e9; %Hz
c=3e8;  %m/s
n=1:1:NFFT;
m=500;

S_w=abs(X).^2.*(1+cos((2.*pi.*n.*m.*fr.*Cav_len./c)+(2.*pi.*fr.*n.*delta_L./c)));
figure()
plot(f,2*S_w(1:NFFT/2+1))
xlim([3.6e14 3.9e14])

The attached images: The first is what I expected , The second is what I get. The terms source is from thesis that I am reading and trying to implement some of the theory.
I will attach to relevant pages,


texts:
I'm trying to visualize what would the following signal be like
$$[u(\tau)-u(\tau-4)]\cdot[u(t-\tau)-u(t-\tau-4)]$$
Consider that $\tau$ is the independent variable here, $t$ is the shift variable.

Note: I'm doing this to calculate the continuous-time convolution


texts: Analytical Expression for Convolution of Two 2D DFTs

texts:
I am trying to do an image analysis problem on some images, and I want to calculate some things in the frequency domain which are giving me problems. Say I have an (discrete) image $I(x,y)$ of size $N_x\times N_y$ (in practice this size is about $150\times40$ pixels). I want to calculate

$$DFT\left[\frac{\partial I}{\partial x}\cdot\frac{\partial I}{\partial y}\cdot\frac{\partial^2 I}{\partial x \partial y}\right]$$

and express this in terms of the DFT of $I$, which is an $N_x\times N_y$ matrix with entries $\hat{I}_{k,\ell}$. The product is to be interpreted pointwise. I discretize the derivatives with central differences, e.g.

$$\frac{\partial I}{\partial x} = \frac{I(x+1,y) - I(x-1,y)}{2\Delta x}$$
and so I can compute the DFT of various derivatives using the shift properties of DFT. I'm doing this in the frequency domain because other parts of my problem involve 4th derivatives which I think will be way too sensitive to compute in real-space, and I hope the frequency-space calculations will be more stable/robust.

I've attempted to calculate a slightly simpler case, involving only one derivative. My attempted solution is to use the convolution duality properties of the DFT and express multiplication in real space as convolution in frequency space. My attempted expression is below:

$$DFT\left[\left(\frac{\partial I}{\partial x}\right)^2\right]_{k,\ell} = DFT\left[\frac{\partial I}{\partial x}\right]*DFT\left[\frac{\partial I}{\partial x}\right] = \frac{-1}{N_x(\Delta x)^2}\times\sum_{m=0}^{N_x-1}\sin\left(\frac{2\pi m}{N_y}\right)\sin\left(\frac{2\pi (k-m)}{N_y}\right)\hat{I}_{m,\ell}\hat{I}_{(k-m),\ell}$$

However, I'm not sure if I'm properly generalizing circular convolution to more than one dimension, and even if I am, I don't know how to interpret the convolution property with a mix of derivatives (e.g. $DFT[\frac{\partial I}{\partial x}\frac{\partial I}{\partial y}]$). What am I summing to, $N_x-1$ or $N_y-1$? I suspect I might have something wrong in generalizing circular convolution from 1 to 2 dimensions.

  In general, how should I interpret circular convolution in 2D? And how
  can that shed light on calculating this particular DFT?


texts: How to reconstruct a time-discrete signal

texts:
German: Sie betrachten das zeitkontinuierliche Signal $s(t)$ mit einem digitalen Oszilloskop mit Abtastperiode $T_\mathrm{s}$ und messen das zeitdiskrete Signal $\tilde{s}[n] = s(n\:T_s)$

Nehmen Sie an, dass das Abtasttheorem eingehalten wird.

Können Sie $s(t)$ aus $\tilde{s}[n]$ rekonstruieren? Begründen Sie!
Skizzieren sie $s(t)$ für einen Bereich von $- 3\:T_\mathrm{s}\leq t \leq 3 \:T_\mathrm{s}$

English: You consider the time-continuous signal $ s (t) $ with a digital oscilloscope with sampling period $ T_\mathrm{s} $ and measure the time-discrete signal $\tilde{s}[n] = s(n\:T_s)$
Assume that the sampling theorem is met.

Can you reconstruct $ s (t) $ from  $\tilde{s}[n]$? Explain!
Sketch $ s (t) $ for a range from $- 3\:T_\mathrm{s}\leq t \leq 3 \:T_\mathrm{s}$

Sadly, that's all that's given. This is an exam problem from university and I don't have any clue how to get a useful solution.
Maybe some one is able to reconstruct it for me and tell me how it works?


texts: Why is the Fourier (or cosine) transform decorrelating?

texts:
The discrete Fourier transform (DFT) and the discrete cosine transform (DCT) both decompose a signal into its frequency-domain spectrum. One property that I have seen praised across various domains such as image processing, audio/speech processing and more, is that it tends to produce decorrelated coefficients. For example, subsequent coefficients of a signal might tend to be statistically correlated, but its Fourier- or cosine-transformed counterpart does not exhibit such behaviour. As a result, the statistical properties of the latter (e.g. covariance matrix) can be modeled much more efficiently using diagonal matrices instead of dense matrices, among other benefits.

However, I do not immediately see why this decorrelation should hold true in general. What are the reasons behind this fact? Where is the connection between the DFT or DCT's frequency-decomposing property and the described decorrelating property?


texts:
I am using a Chirp-Z transform (aka. czt) to analyze a short length sample of a sinusoid. In scilab the code that I use to generate the signal is:

sampleRate = 4000000
points = 2^8
t = (0:(points-1))/sampleRate
y1 = sin(2*%pi*t*510000)

When I take the transform I get:

I expected to see only one non-zero magnitude sample. Obviously this is not the case. Why the sinc(x) waveform?

Here is my scilab code:

clear()
clc()
clf()

function a = angle(c)
// return the argument a in rad of complex number c
   a = atan(imag(c), real(c))
endfunction

function [Y, f] = chirpZ(y, sampleRate, f1, f2, m)
    w0 = 1
    phi = 2*%pi*(f2-f1)/(m*sampleRate)
    w = w0*exp(-%i*phi)

    a0 = 1
    theta = 2*%pi*f1/sampleRate
    a = a0*exp(%i*theta)

    Y = czt(y,m,w0,phi,a0,theta)

    f = (((0:(m-1))*(f2-f1)/m) + f1)
endfunction

sampleRate = 4000000
points = 2^8
t = (0:(points-1))/sampleRate
y1 = sin(2*%pi*t*510000)

f1 = 300000
f2 = 700000

m1 = points

[y2, f2] = chirpZ(y1, sampleRate, f1, f2, m1)
y3 = y2/points

subplot(211)
plot(f2,abs(y3),'g.')
subplot(212)
plot(f2,angle(y3),'b.')

[mag1,ndx1] = max(abs(y3))

subplot(211)
plot(f2(ndx1),abs(y3(ndx1)),'r.')
subplot(212)
plot(f2(ndx1),angle(y3(ndx1)),'r.')


texts: Convolution theorem for cross-correlation

texts:
Forgive me is this is an ill-posed question.

Is there any such thing as a 'convolution theorem' for the cross-correlation.

Namely, the convolution theorem states that:
$$
x[n] * h[n] = \sum_{k=0}^{\infty}h[k] x[n-k] = X(f)H(f)
$$
Where $X(f)$ is the Fourier transform of $x(t)$.

Is there any equivalent theorem for cross-correlation, i.e.:
$$
\textrm{corr}(x[n],h[n])=r_{xh}[k]= \sum_{k=0}^{\infty}h[k] x[n+k] = F_?[X(f),H(f)]
$$

In other words, is there a way to express $r_{xh}[k]$ in terms of $X(f)$ and $H(f)$, or even in terms of the autocorrelation $r_x[k]$ and $r_h[k]$.

I tried self-deriving this but couldn't come up with anything.

Thanks!


texts: I would like to cite  "fred harris rule of thumb" for estimating filter order.  Is there a book or paper where I can find this rule of thumb?  Thanks a bunch.


texts: What approximation techniques exist for the square super-root function?

texts:
I need to implement an approximation to the inverse of $x^x$, i.e. the square super-root (ssrt) function. For example, $\mathrm{ssrt}(2) \approx 1.56$ means that $1.56^{1.56} \approx 2$.  I'm not as interested in any particular accuracy/bit-depth as I am in understanding what my options are in contrast to more straightforward approaches using power series.

Wolfram Alpha gives a nice symbolic solution in terms of the Lambert W function (i.e. $\ln(x)/W(\ln(x))$ ).  Wikipedia gives the same formula, as well as the equivalent $e^{W(\ln(x))}$. Given that there's a reasonable amount of information on computing $W(x)$ [1] [2], technically that's everything needed to implement something for a variety of requirements.  I know of at least two books that go into extensive detail about approximating $\ln(x)$ [3] [4], so there's even plenty of room to optimize from that direction.

However, I have two questions:

Have approximation techniques specific to this function been published anywhere?
Does it go by another name besides "square super-root" that would make searching for references at a little easier?

Wikipedia/Google has turned up some references dedicated to more general "tetration" functions that include $\mathrm{ssrt}(x)$ as a special case, but most of them seem to be more geared to exploring/defining the general cases.

--

Corless, R.; Gonnet, G.; Hare, D.; Jeffrey, D.; Knuth, Donald (1996), "On the Lambert W function" http://www.apmaths.uwo.ca/~djeffrey/Offprints/W-adv-cm.pdf
Digital Library of Mathematical Functions. http://dlmf.nist.gov/4.13
Crenshaw, Jack W. (2000), Math Toolkit for Real-Time Programming.
Hart, John F. (1978), Computer Approximations.
Chapeau-Blondeau, F. and Monir, A. (2002). Numerical evaluation of the Lambert W
function and application to generation of generalized Gaussian noise with exponent 1/2. IEEE
Transactions on Signal Processing 50, 2160-2165. http://www.istia.univ-angers.fr/~chapeau/papers/lambertw.pdf
Minero, Paul. Fast Approximate Lambert W. http://www.machinedlearnings.com/2011/07/fast-approximate-lambert-w.html

--

Update

After doing some more research over the past few days, I still haven't found the kind of hands-on "Crenshaw style" $[3]$ treatment of $\mathrm{ssrt}(x)$ I was hoping for, but I did find a new reference worth documenting here.  On page three in $[5]$, there's a section titled "Fast Approximation" that goes into great detail about approximating $W(x)$ in the context of noise generation. As an interesting aside, the probability density of "Gaussian noise with exponent 1/2" [in the paper] looks strikingly similar to the histogram in Kellenjb's answer to this question about detecting signal clipping.

In addition, the link given by rwong in the comments $[6]$ is a great resource for actually implementing $W(x)$, and it even links to the author's BSD licensed project called fastapprox, which includes the implementation described.


texts: Implementing wavelet transform for finding transients in the power supply

texts: I am new to the concept of wavelet transforms. Can somebody please help me in understanding this ? and also how to implement it in c. Is Short term Fourier transform more efficient than Wavelet Transform for finding Transients ?


texts:
I want to make a programm that can detect the differences between two similar images of an automotive fusebox. The fusebox will be placed inside a jig and so will usually will be in the same position in all the photos taken (won't be rotated, scaled or shifted. There might be subtle differences in lighting throughout the day). Here's an example of a fusebox:

Here's the application: the system will 'learn' a good image and then compare all subsequent fusebox images and check against the good image weather or not this the fusebox was assembled properly. For instance, if a 20A fuse is not placed where it should be, the fusebox is not good.

The fuses themselves are colour coded, blue is always 15A and red is always 10A etc. The fuses we use don't have clear markings on them as shown in the above picture so I can't rely on that, so this leaves character recognition out.

The question now becomes, how do I compare? Should I use histogram based image similarity tests? Would a simple subtraction of the image-under-test from the reference image suffice?


texts:
I seek a scaled audio file format for my dsp output.

I'd like to produce "scaled wav files", when I've done my pre processing. Eg. if the amplitude is 15.5 (of whatever unit), you should be able to open a standard wav/whatever file and see "15.5".

If you produce a normal 16 bit wav file, you have to tell the user, to scale all values with value xx.xx. This would be ok, if the scale factor could be included in the file, in a standardized fashion. But so far I haven't been able to find any "scale factor" field in the wav format?

Another way could be to produce a 32 bit float wav file. This could actually contain the value "15.5". Problem is that wav float values are defined to be in the range [ -1.0 : 1.0 ]. I've tried opening such a file in different freewares like eg. Audacity. But they don't take well to the larger scale. They still only display the [ -1.0 : 1.0 ].
Do you know a program that will display large scale float wav files?

(Btw I do realize that the "scaled audio" is not "audio" anymore.)


texts: Why use complex envelope to model raw measurements?

texts:
The usual answers when asking "why use complex numbers to model measurements?" is usually: (a) Because you are measuring a phenomenon like electricity and magnetism. (b) Because it is super useful for analysis- Fourier, convolutions, differentiation: these are easier on the complex plane.
When discussing seismology, acoustics, and other real-valued measurements, authors still use complex numbers, even if analysis in the time-domain, and no convolutions involved.
The usual argument is that the complex numbers represent the complex envelope of the real valued measurement. But why do that? Is this a sociological/communal habit, or is there a practical advantage in working with the convex envelope of a signal, and not its real version?


texts: Get level of wellness in a cascade classifier using LBP

texts:
I'm currently working in a Lolipop LBP cascade detector using OpenCV. The training is correctly done and the cascade classifier detects the sticks of the Lolipops correctly but with some minor errors.

Is there any way to obtain a "level of trust" or an index of how many features had been detected during the cascade detection process?


texts: Does the ROC (Z-Transform) always start/end from/in a pole?

texts:
Can I assume that the R.O.C. from a Z-Transform will always start from or end in a pole or 0/infinity?

Using an example:

$$H(z)=\frac{(z+1)(z-1)(z+j)(z-j)}{z^4}\space,\space\space j=\sqrt{(-1)}$$

So we have 4 zeros in the unit circle equally spaced by a $\frac{\pi}{2}$ angle and 4 poles in the origin ($z=0$). If not specified, can I assume the the ROC wil necessarily start from exclusive zero and go towards infinity? Or maybe possible to exist a ROC which is a ring in the Z-plane (which will not start/end in a pole)?


texts: How should someone start to learn machine learning and computer vision for mobile applications?

texts:
I am very interested in learning Machine Learning and Computer Vision for mobile apps, for iOS and Android.
But I have no clue or even a slight idea on how to even begin. I know this is heavy on math and some theory I am not familiar with.

Should I use a library for this kind of thing, when I build a mobile app? Or should I do native coding? For example, to create  photo effect from a camera?
What are all things I need to know to be able to learn this?


texts:
I have a 2D samples f(x,y) = z  in a circle (disc). Values x, y are not generaly uniform, but they can be resampled.

Is there a way how to obtain frequencies from this data without the knowledge of their order (basically, if I rotate the disc, the frequncies remain the same)?


texts: Feature extraction for sound recognition and classification

texts:
I am building an application that would "listen" to the microphone input, analyse it, and compare the analysis to a pre-analysed and pre-classified sound bank (small - maximum 20 sounds). It will then show the user what sound it was.

Now, I have a vague idea on how to implement this. I would like to choose a set of features that would best represent the sounds. The issue is that the sounds in the sound bank could be whatever the user recorded. From strong onsets and short sounds, to long onsets and long sounds.

The current features I'm thinking of are:

Spectral Centroid
Spectral Flux
Spectral Rolloff

What do you think? Would these be sufficient to properly classify the sound? Also, as these features output a single value for specific sound buffer, how would you go about handling the feature vector that represents the whole sound? I am using kNN for classification, and was wondering what's the best way to compare two feature vectors? would cross-correlation be a feasible technique?

Thanks a lot!

P.S
I have seen that a similar question was asked here, but it doesn't fully answer my issues.


texts: Calculate aliasing of $x_a(t) = \cos{(2\pi300t)} + \cos(2\pi600t)$ when sampled with $F_s = 1000$

texts:
I'm asked to sample the signal
$$x_a(t) = \cos{(2\pi300t)} + \cos(2\pi600t)$$
with sampling frequency $F_s = 1000$ and plot the magnitude spectrum for the resulting sampled signal.

My thinking is that the frequency of $300$ does not change, so it just results in the normalized frequency $\frac{3}{10} = 0.3$.

Since $600$ is above the nyquist frequency, aliasing arises. So we get the frequencies $\frac{6}{10} = 0.6$ and $\frac{6}{10} - 1 = - 0.4.$

So in total I would plot peaks at the frequencies $\pm0.3, \pm0.4, \pm0.6$, but the answer is supposedly:

Why? Where is my thinking wrong? And what is the method to always get the right aliasing peaks?


texts: How is wavelet center frequency computed?

texts:
PyWavelets (1) takes index of max  DFT magnitude, (2) adds 1 to it, (3) divides by domain, which is the range of input values to the wavelet ("support"). I don't see where steps 2 and 3 come from, or why 1 doesn't suffice.
MATLAB's docs suggest only step 1, also here - but closed source, can't verify. If "center frequency" is frequency that correlates the strongest with the wavelet at some reference scale, that's by definition what the DFT finds, so why the extra steps?


texts:
The following has been mentioned regarding spreading using a 32 chip sequence

32x spreading contributes a theoretical 15 dB gain to the link budget,

I have no clue, why so? Are we referring to the processing gain?

I thought spreading was  performed to mitigate narrow band noise and ISI.


texts:
The "textbook" OFDM block diagram is as the below figure. But I wonder if it satisfies the sampling theorem. Here, we have N points $X[k]$ before IFFT, and

$$x[n]=\frac{1}{\sqrt{N}}\sum_{k=0}^{N-1} X[k] \mathrm{e}^{\displaystyle -j\frac{2\pi k n}{N}}$$

This derives from the analog signal

$$x(t)=\sum_{k=0}^{N-1}\mathrm{e}^{\displaystyle -j 2\pi f_k t}=\sum_{k=0}^{N-1}\mathrm{e}^{\displaystyle -j 2\pi k\Delta f t} $$, where $\Delta f$ is the subcarrier space.

We then sample this signal with a  sampling frequency $f_s>2f_{max}=2(N-1)\Delta f$, which can be taken as $f_s=2N\Delta f$. The time domain sample points are at

$$nt_s=n/f_s=\frac{n}{2N\Delta f}$$

Then we define

$$x(nt_s):=x[n]=\sum_{k=0}^{N-1}\mathrm{e}^{\displaystyle -j \frac{2\pi k n}{2N}} $$

and then we define a expanded

$$\tilde{x}[n]:=\begin{cases}
x[n], 0\le n\le N-1\\
0, 2N-1\ge n\ge N\\\end{cases}$$
$$

That means we should do a length $2N$ IFFT rather than a length $N$ IFFT

$$
\tilde{x}[n]=\sum_{k=0}^{2N-1}\mathrm{e}^{\displaystyle -j \frac{2\pi k n}{2N}}$$

Is the textbook wrong?


texts: How can I reduce noise errors when detecting DTMF with the Goertzel algorithm?

texts:
Thanks a lot to whoever downvoted my question for no good reason.

I wrote an implementation of the Goertzel algorithm in JavaScript and made a demo that detects DTMF dial-tones.

You can find the code here:
http://github.com/ravenstine/goertzeljs

The demo is below, and you can try it out if you have a web browser that supports WebRTC(newer versions of Chrome and Firefox do).

http://goertzel.herokuapp.com

I have an issue where I need help:

I need a way to effectively filter out background noise.

There wasn't much information that I could find on the subject that didn't already assume that I knew a lot about DSP.  I heard about using a window function and while I could find some algorithms, implementing them didn't seem to make any significant difference(Goertzel.js uses Exact Blackman).

As a result, I came up with my own filter where if an energy peak is not distinct enough from the energies of other frequencies, the information from that sample isn't used.  This was actually tremendously effective when using a buffer size of 2048.

However, I want my DTMF detector to be as close to meeting ITU specifications as possible; the minimum duration of a DTMF tone to be detected is specified by ITU as 40ms, but my detector doesn't consistently detect tones unless they are around 110ms.

To deal with this, I want to make the buffer size even smaller, but if I do this then my method of removing noise becomes unmanageable(meaning it seems to either discriminate too-little or too-much).

At the moment, my detector works pretty well but background noise occasionally creates erroneous detections.

What are some other methods that I can implement to filter out noise with my DTMF detector?  Also, am I correctly employing the window function?


texts: Question about convolution of shifted function-simple

texts:
I memorized the convolution formula, all good. I started doing examples and in one of them I had to calculate the convolution of a shifted function with another one.

I know the property $$H(x)=f(x)\ast g(x)\\H(x-k)=f(x)\ast g(x-k)=f(x-k)*g(x)$$

So I had no trouble finding the result but I had trouble writing the integral. Which of the following is correct?

$$\int_{-\infty}^\infty f(τ)g(t-k-τ)dτ\\\int_{-\infty}^\infty f(τ)g(t+k-τ)dτ$$


texts: Any guidance on converting Time Domain to Frequency Domain in Matlab

texts:
Below is the graph of my load cell readings at 3 samples per second. I have collected 500 such samples. I want to stabilize the readings and read that first approach is to convert time domain data to frequency domain. I am new to DSP, so i seek your expert guidance on this.
My main aim is to stabilize the readings so that i can increase an accuracy of my measuring device.
Graph after fft is as shown below


texts: Simple $\sin(2\pi 1000t)$ Fourier transform in PSpice not behaving as expected

texts:
So I have this very basic circuit show below which I am simulating with PSpice.

Now, when doing the Fourier transform of $\cos(2\omega1000t)$, I expect to see two impulses(one at -1kHz and one at 1kHz), at half the amplitude of the cosine. The simulated results, however, shows the impulse at 1kHz with an amplitude of just below 1V. This is shown below:

My question is, why is this the case? Why is the amplitude not 500mV? I'm probably just missing something trivial.

Thanks in advance!

(Side note - why is there no pspice tag? Is this the correct form to post this question?)


texts:
I previously asked this question in the maths community not realising that this stack exchange community existed. I have searched online extensively and haven't been able to find an explanation to how this works and would really appreciate some input.

I'm studying this signals and systems text book and I can't figure out the logic behind how $u(t)$ and $r(t)$ can be added together to form some signals.

$$ u(t) \triangleq
\begin{cases}
0, & \text{if }t<0 \\
1, & \text{if }t\ge0
\end{cases} $$

$$ $$

$$ \begin{align}
r(t) &  \triangleq
\begin{cases}
0, & \text{if }t<0 \\
t, & \text{if }t\ge0
\end{cases} \\
& = t \ u(t) \\
\end{align}$$

$$ $$

Basically, an example in the book gives this signal:

So the book says that it can be described by this equation:
$$
x(t) = u(t)-r(t-1)+2r(t-2)-r(t-3)+u(t-4)-2u(t-5)
$$

It states that the sum of the ramps $-r(t-1)+2r(t-2)$ goes upward with the slope equal to one starting at $t=2$. I can't understand how this works geometrically and haven't been able to find anything that has helped. Does anyone know how this type of modelling is done?


texts: What is the zero in this transfer function?

texts:
What is the zero for the following transfer function, $-1/2$ or $-2$?

$$H(s) = \frac{2s +1}{(s + 3)(s + 2)}$$

This appears to give a zero of $-1/2$.

I can transform this into the standard form that includes the gain $K$:

$$H(s) = \frac 12 \left(\frac{s + 2}{(s + 3)(s + 2)}\right)$$

Where the leading half is the gain. The zero now appears to be $-2$. What is the conceptual error I am making? Should I take the gain out or leave it in the numerator?

UPDATE: I think this question is worthy of deletion given the nature of the error but I am unable to. Instead, see my answer below.


texts: Help understanding FFT Phase: code and results provided

texts:
I'm trying to figure out how FFT's phase works. Here's my code:

import numpy as np

t = np.linspace(0,120,1200)
acc = lambda t: 10*np.sin(2*np.pi*t)

# signal is a perfect 10 amplitude 1 frequency sin wave
signal = acc(t)

FFT = np.fft.rfft(signal)
freqs = np.fft.rfftfreq(len(signal),1/10.)
real = signal[110]
total = 0
for binnum in range(len(FFT)):
    bin = FFT[binnum]
    amp = (np.sqrt(bin.real**2 + bin.imag**2))/len(freqs)
    angle = np.angle(bin)
    phase = np.arctan2(bin.imag, bin.real)
    freq = freqs[binnum]
    contribution = amp * np.sin(2*np.pi*freq*t[110] + phase)
    total += contribution

    print "Amp: %f, angle: %f, phase: %f, freq: %f" % (amp, angle, phase, freq)

In the print, I see this line:

mp: 9.815303, angle: -1.256637, phase: -1.256637, freq: 1.000000

It thinks the phase of the perfect 1 frequency wave is -1.25, but it should be 0. How do I find the right phase?

Also, I understand if it's because of spectral leakage, but how does the inverse FFT work then? I was under the impression that to reconstruct the signal at time t, you'd just sum up all the contributions from the sinusoidal waves. But it doesn't work, since the output of the above code is:

total: -9.90868489422
real: 0.576119838246


texts:
I am trying to implement a spoken language identifier from audio files, using Neural Network. I need to generate one feature vector for each audio file.

From what I have read the best features (for my purpose) to extract from the a .wav audio file are the MFCC.

Does anyone know of a Python code that does such a thing?


texts:
I have to detect faces in videos using machine learning methods like SVM,
I have to build it from scratch not using any inbuilt face detectors.My time limit is like 15hours from now.Can I get any valuable suggestions on how can I begin and proceed?
Thank you


texts: Derivation of the Optimal Matched Filter - Convolution vs. Correlation

texts:
On the Wikipedia page for Matched Filters here, there is a matrix algebra derivation for an optimal matched filter. Now, considering the output of an LTI system is found using the convolution operator, why is the first step of the proof on the page is to consider:

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

instead of,

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

the convolution operation? And is $h^{*}$ the complex conjugate of the impulse response?


texts: How do you deconvolve irregularly sampled points?

texts:
$f:\mathbb{R}^n\rightarrow\mathbb{R}$ is a signal and $g:\mathbb{R}^n\rightarrow\mathbb{R}$ is a known point-spread function (say, a Gaussian).

A system samples $f\star g$ at a known sequence of irregular points, $(\mathbf{x}_n)_n$. Are there any methods, analytic or numerical, to deconvolve the samples from $g$ to reveal samples of $f$?

If $f$ were band-limited and the sequence of sample points $(\mathbf{x}_n)_n$ were periodic and finer than the sampling theorem's frequency, then I believe by the convolution theorem sampled-$g$'s  Fourier transform could be divided out pointwise from that of sampled-$f\ast g$, yielding sampled-$f$'s Fourier transform.


texts: Downsampling and low pass filtering in one step?

texts:
Image pyramids are created by applying a lowpass filter (Gaussian) and then decimating the image (keeping only every n'th sample).
In The Pyramid as a Structure for Efficient Computation the start image is 257x257. Then the next level is 129x129, 65x65 etc.
Without decimation, one could get the same image size by applying a convolution of stride 2 and padding 2. For $i = 257$, $k = 5$, $s = 2$ and $p = 2$ the result is $\lfloor\frac{i + 2p - k}{s}\rfloor + 1 = 129$. The kernel is still Gaussian so a low pass filter.
In Convolutional Neural Networks it is actually quite common to use a higher stride to reduce the image size. This is an alternative to max pooling where one decimates the image by computing the maximal value in $k\times k$ image patches (obtained by a filter).
My question is now: Is it possible to combine decimation and low pass filtering in one step? Not necessarily only for images but also for general signals.


texts: What is the line encoding in this FSK signal

texts:
As a learning exercise, I'm trying to reverse engineer the radio protocol of a 27MHz wireless mouse. The device currently transmits on the 27.045MHz channel and uses 2FSK. I have an IQ recording of the data transmitted during a left button press here (32-bit float 1MHz sample rate).

Using the cursors in inspectrum, I can see that the chip rate is 5k, there is a preamble at the start (not sure what the extra few chips before are), followed by the data presumably.

Judging by the lack of long runs of 1s and 0s, the data is probably line encoded, however I'm not sure what encoding is being used here. In the data section after the preamble, the gaps between transitions vary between 1, 1.5, 2 and 2.5 chips. Looking at common line encodings such as Manchester, the gaps between transitions are either 1 or 2 chips. It's not obvious what line encoding is being used here.

Any thoughts?


texts:
My book with answers to proakis and manolakis book says that $F(x,n)=x(n)u(n)$ is time invariant while my calculation shows that it is time variant. I have repeated them many times and I am mostly convinced that book is wrong. Can somebody please check my calculations?

let $u(n)$ be a Heavside step function. First we shift output signal:

$$F(x, n-k)=x(n-k)u(n-k)$$

Let $x'(n)=x(n-k)$ be a shifted input signal. Lets calculate response to shifted input signal:

$$F(x', n)=x'(n)u(n)=x(n-k)u(n)$$

since $F(x, n - k) \neq F(x', n)$ this system is time variant. Is my method correct?


texts: Interpolationg phase and magnitudes, Transformation function

texts:
I am trying to filter signal x(n), n = 150. I made a filter with few frequency points on the x axis , [-11.,  -9.,  -3.,  -2.,  -1.,   1.,   2.,   3.,   9.,  11.])
I also defined linear magnitudes and phase in radian for corresponding frequencies. It would look as in the following:
Frequency F, manitude H and phase  in each column.
      ([[-11.    ,   3.1623,  -0.8203],
       [ -9.    ,   5.0119,  -1.3614],
       [ -3.    ,   2.5119,  -0.4014],
       [ -2.    ,   3.9811,  -0.9599],
       [ -1.    ,   1.5849,  -0.4363],
       [  1.    ,   1.5849,   0.4363],
       [  2.    ,   3.9811,   0.9599],
       [  3.    ,   2.5119,   0.4014],
       [  9.    ,   5.0119,   1.3614],
       [ 11.    ,   3.1623,   0.8203]])

The sample rate of the signal is srate = 1000. One can obtain the frequency of the real signal by doing, f_sig = np.fft.fftshift(np.fft.fftfreq(n,1/srate)).
How do i obtain the Transformation function of the signal ?
H(sig) = |H|x exp (ixphi)
I suppose i need to interpolate magnitude and the phase, but don't know how?
Do you have any idea, how i may implement this?
Many Thanks.