texts: How to Use the DFT (FFT) to Solve a Least Squares Regularization Problem (Inverse Problem)?

texts:
Let $X$ and $K$ be an image and a Point Spread Function (PSF), respectively.

The blur image $B$ is obtained as follows

$$B = X * K$$

I want to solve the following general regularization problem

$$\min_X \left\|X * K - B\right\|_2^2 + \lambda \| f(X) \|_2^2$$

where $f$ is a regularization function. In some literature I have seen, the authors use the FFT to solve such a problem. However, I cannot find any resources that show the procedure. My questions are:

How one can use FFT to solve the above problem?
Is there any condition that must be satisfied to use FFT?


texts:
I have been researching about Speech Recognition and I have decided to take the MFCC approach to solving this problem of detecting whether someone is saying either "Yes" or "No". So as mentioned before (My steps so far):

Read in Audio File
Split the Audio Signal into blocks (600 samples, 30msec long)
Strip the blocks that do not warrant consideration (Total Energy / Zero-crossing)

So I am going to construct the MFCC based on this paper and it has the following steps:

Pre–emphasis
Framing
Hamming Windowing
FFT
Mel Filter Bank Processing
Discrete Cosine Transform
Delta Energy and Delta Spectrum

This makes sense to me (Kind of) and I am going to research into each of these steps. BUT should I perform the MFCC on the resulting blocks that I have already done with (steps 1, 2, 3) at the top of this question, or, should I not carry out these steps and just start from the beginning and compute the MFCC and will I still be able to implement a Hidden Markov Model?

The other question is, if I split the signal into "Frames" (2D vector) will the resulting MFCC be a 2D vector, or a 1D vector?

Hope someone can help :)!


texts: 2 by 2 bit orthogonal encoding mult-kronecker expansion matrices?

texts: What is the name of the following bit encoding generator matrices?


texts: DSP implementation recommended bibliography (good books-material related to fixed/floating point-optimization)

texts: I am doing my first steps in embedded systems and there is a big deal of fixed point code and of course DSP optimized code.I would like please if possible to recommend any book/material related to that topics.


texts: Computing real signal with minimum absolute values from even magnitude spectrum

texts:
I want to derive a real audio signal from an arbitrary even magnitude spectrum.

The phase spectrum affects the values of the signal in the time domain; for example, a phase of 0 for all frequencies amounts to summing cosines in the time domain, which will result in a large peak at t = 0. I want to minimize the absolute values of the signal in the time domain without scaling the magnitude spectrum

I want this so that the audio signal can be multiplied by the largest scalar value possible without clipping. Is there a way to compute the phase spectrum that will do that? If there is a stupidly simply solution, I apologize in advance.


texts: Comparing FFT for increasing time intervals in a signal

texts:
Assume a dataset where the rows represent signals: each signal $s$ is sampled at a sampling rate $f_s$ and available as an array of common length $T$. For an increasing sequence of integer times $t_i < T$, I would like to find out the information gain reached by considering the rest time $T-t_i$. Intuitively, I would like to find out a $t_{\dagger}$ for which the amplitude of the different frequencies in the signal has already converged. The motivation behind this is that I would like to potentially shorten the measurement time in the future, assuming the data distribution remains the same.

My approach has been to analyze the convergence in the FFT spectra of the increasing time slices, with the FFT computed from time $t=0$ to the corresponding $t_i$.

Are there any more adequate ways of doing this?


texts: Receiving multiple signals at the same frequency at the same time

texts:
I'm doing a project for my school it's a communication platform for different mobile devices I'm gonna build and I need to send data from the devices to station am making, I figured how to use signal spreading to encode multiple signals and send it to multiple devices like a cell tower.

But what I wanna know is how the tower I'm building is gonna receive multiple signals and not cancel each other out?


texts: LMS Algorithm: How to Define the Desired Signal

texts: I am working on LMS algorithm,i am not getting exactly how we get desired response of the filter that is compared with the estimated output


texts: Understanding of wireless communication system from MATLAB point of view

texts:
I am dealing with a communication model described as

$$\overrightarrow{y(n)}=\pmb{H(n)}\overrightarrow{x(n)}+\overrightarrow{w(n)}$$

where $\pmb{H(n)}$ is the $M\times M$ fading coefficient matrix at time $n$. What is difference between time instant  $n$ and length $M$?


texts:
Suppose i've a mp3 file.

I performed FFT of that mp3 file. Then is it good to state the following:
1. Silence occurs by that particular DFT point whose magnitude is lesser
than some threshold. 2. Inverse FFT gives me the original sound file.


texts: How we can find ROC(Region of convergence) given a signal in z domain?

texts:
I read that ROC is a region,which is a set of values where z transform is defined ,that is it converges

Lets say i have a discrete time time signal $x[n]=n^2 u(n)$ and i want to find its ROC(Region of convergence),how can i do that?


texts: Can the Fast Fourier transform be used to compute the magnitude of moiré

texts:
I am experimenting with image down-sampling and would like to calculate a numerical magnitude for alias-induced moiré patterns.  Is it possible to do this by analyzing the frequency-domain (FFT) of the input image and knowing the relative sampling rate?

Assume that I have already applied any pre-sample filtering prior to taking the FFT, so the sampling will be point-based.


texts: Why can we have non-integer frequency bins in FFT?

texts:
I am studying DFT/FFT and I'm very confused about one thing. I read online that the frequencies we can sample with DFT must be integer (Why does the frequency in the DFT have to be an integer?). Later I found out that the frequency bins in frequency domain in FFT can be non-integer numbers, since they are calculated like this:

delta f = sampling frequency / number of samples

Why can the frequency bins be the non-integer number here? Can we also sample non-integer frequencies using DFT/FFT?

Thank you for your help.


texts: when trying to nomalize a power plot , do we normalize it after converting it to db scale or before it?

texts: I have two power plots. I am trying to normalize it for comparing them . So , do we normalize it after converting to db scale? or do we normalize the power as such?


texts: How to remove salt & pepper noise from speech signal?

texts:
I'm having a lot of problems with my project:

I added salt and pepper noise by inbuilt function
I DWT function with Haar family
Now I want to remove noise from original speech signal.
I don't know how to do this


texts:
I'm having some difficulty in going through the z-transform of a sequence that is "on" every other sample. The sequence is
$$x(n) = na^{|n|/2},$$ when $n$ is an even integer, and 0 otherwise. I have understanding how to go about performing the z-transform itself and using the properties, but with this sequence alternating is throwing me for a loop. Any help would be appreciated.


texts: strange artifact in depthmap of a mirroring glass

texts:
I hope this the right place for this question, not sure.
I have a Asus Xtion Pro live camera, so an IR structured light sensor, on a shop window. When the shop window glass mirrors (there is more light inside than outside the shop), I see this mirrored image also in the depth map. It's clearly an artifact, but how is it possible?

Ignore the holes in the depthmap (black areas) for the moment, it's the not the focus of this question, but look at the red circle, this is a table, that is located inside the store (as you can see in the rgb frame), it should not be present in the depthmap.
As far as I know a structured light sensor project a light pattern on the scene and through a camera read how the pattern is deformed on the different surfaces (near, far) to calculate the depth (distance of every point in the detphmap). Of course the table doesn't exist in the scene, so should not exist in the depthmap too! Any idea?


texts:
In an other post i've found that the variance of filtered noise can be found by

$$\min_{\theta\in [\theta_1,\theta_2]}\left|H(e^{j\theta})\right|^2\sigma_x^2\le
\sigma_y^2\le\max_{\theta\in [\theta_1,\theta_2]}\left|H(e^{j\theta})\right|^2
\sigma_x^2\tag{1}$$

The derivation is based on spectral density functions and the relationship $$S_y(e^{j\theta})=S_x(e^{j\theta})\left|H(e^{j\theta})\right|^2\tag{2}$$ with $$\sigma_x^2=\frac{1}{2\pi}\int_{-\pi}^{\pi}S_x(e^{j\theta})d\theta=
\frac{1}{\pi}\int_{\theta_1}^{\theta_2}S_x(e^{j\theta})d\theta\tag{3}$$

The important point for me is that the variances $\sigma_x^2$ and $\sigma_y^2$ are related by a quadratic relationship.

I'm interested in the relation of the standard deviations $\sigma_y$ and $\sigma_x$, not the variances. So the question is: How is the standard devation $\sigma_y$ related to $\sigma_x$?

My naive idea (I'm yet not too experience with random variables in the frequency domain) is to take the square root and find  $\sigma_y= |H(\omega)|\sigma_x$. So the variances should have a linear relationship.

Is this correct or am I missing some point?


texts: Could someone please explain how to get frequency response of a given Bode Plot?

texts: Having trouble with bode plots. I understand that the  is to be converted to $dB$ but after that I'm stuck. Could someone please show me how this graph gives a frequency response of $10/1+jw10$


texts:
I have a friend working in wireless communications research. He told me that we can transmit more than one symbol in a given slot using one frequency (of course we can decode them at the receiver).

The technique as he said uses a new modulation scheme. Therefore if one transmitting node transmits to one receiving node over a wireless channel and using one antenna at each node, the technique can transmit two symbols at one slot over one frequency.

I am not asking about this technique and I do not know whether it is correct or not but I want to know if one can do this or not? Is this even possible? Can the Shannon limit be broken? Can we prove the impossibility of such technique mathematically?
Other thing I want to know, if this technique is correct what are the consequences? For example what would such technique imply for the famous open problem of the interference channel?

Any suggestions please? Any reference is appreciated.


texts: What are good ways to detect signal clipping in a recording?

texts:
Given a recording I need to detect whether any clipping has occurred.

Can I safely conclude there was clipping if any (one) sample reaches the maximum sample value, or should I look for a series of subsequent samples at the maximum level?

The recording may be taken from 16 or 24-bit A/D converters, and are converted to floating point values ranging from $-1...1$. If this conversion takes the form of a division by $2^{15}-1$ or $2^{23}-1$, then presumably the negative peaks can be somewhat lower than -1, and samples with the value -1 are not clipped?

Obviously one can always create a signal specifically to defeat the clipping detection algorithm, but I'm looking at recordings of speech, music, sine waves or pink/white noise.


texts: How to find epochs where two time series are less aligned than they should be?

texts:
I have two time series that normally should be quite aligned, in the sense that they should show similiar behaviour - i.e. when one goes up, the other should also go up, etc.
Unfortunately, they are not exactly aligned like this, i.e. there may be a small lag in between, or they may just roughly similar. This I still treat as 'normal' behaviour.
What should not happen is that both show very different behaviour - this I expect to be a failure in measurement, and I want to detect epochs where this happens.
Now, I thought I could just roll a sliding window over both series, and calculate the correlation between both timeseries in this window. However, this seems to be too sensitive to the little lags and differences in the data. Here is an example of how this looks like, in a situation where I would like the result to not spot a meaningful difference:

Hence, I am looking for a different method / approach of measuring similarity between two timeseries over a given time-window, that is not too sensitive too these little differences & lags. Note that I have not applied filters or anything to the data, so maybe a tip for preprocessing would also help!


texts: Does the Wiener–Khinchin-Einstein theorem hold for non-Gaussian processes? If so are there any assumptions?

texts:
The Wiener–Khinchin-Einstein theorem states that the auto-correlation $(r_{xx}(\tau))$ and spectral density $(S(f))$ are Fourier duals, i.e.

$$r_{xx}(\tau) = \int^{+\infty}_{-\infty} S(f) \exp\left( 2\pi i \tau f \right)\:df$$

This relationship has several assumptions:

-The process must be stationary, i.e the spatial correlation depend only upon the the distance between two points ($\tau$) and not the orientation ($\vec{\tau}$). For Gaussian processes this requires the first and second order moments to be stationary.

My question is:

Does this relationship hold for non-Gaussian processes?
And if so are there any assumptions or restrictions in place regarding its use? For if it holds for non-Gaussian processes, is it suffient for the process Weak or wide-sense stationarity, i.e. only the first and second order moment need to be stationary and higher order moments can be non-stationary, or are there more strict conditions? My gut feeling is the former since the equation requires no-higher order information, however I'm not sure if that is the case.


texts: Clarification regarding signal after pulse shaping

texts:
As can be seen from the figure below, I have plotted a signal before it is pulse shaped and after performing half sine pulse shaping using the formula

$p(t) = \sin(\pi t/2T_c),\ 0<t<2T_c$

$p(t) = 0, {\rm otherwise}$

Now I am confused about how to interpret the signal after pulse shaping. For example, between 0 and 0.002, the digital signal (the one before pulse shaping) has  5 peaks (including the peaks at 0 and 0.002). Shouldn't I expect the analog signal to also follow such pattern with 5 peaks or is this something special to the half sine pulse shaping?

If it matters, I am using OQPSK modulation with DSSS to produce the digital signal and then performing half sine pulse shaping.


texts: IIR filter design in digital domain using the magnitude squared

texts:
Does anyone have any good references for deriving parameters of an IIR Low pass/High Pass filter directly in the digital domain using the magnitude squared at the corner frequency?

I have been able to derive the parameters of a first order Low/High pass filter with $3\textrm{ dB}$ attenuation at the corner frequency i.e. calculating $k$ and $\alpha$ in:

$$H(z) = k\frac{\left(1+z^{-1}\right)}{\left(1-\alpha z^{-1}\right)}$$

My issue is that I distinctly remember deriving the parameters using a $6\textrm{ dB}$ attenuation at the corner frequency in a DSP course I have done previously but I have forgotten the trigonometric identiftes used to finish the derivation.

The general procedure is as follows:

Let $\omega = 0/\pi$ to calculate the gain term $k$ such that there is a $0\textrm{ dB}$ gain at $0/\pi$
Calculate the magnitude squared at the corner frequency to obtain a value for $\alpha$ in terms of the corner frequency.

The problem may be that it should be a second order filter or I am recalling the method for a band pass/stop filter but I'm not sure and it appears this method is not used very often except in the case of band pass/stop filters for parametric EQ.

I hope the question is clear and I will try to improve the structure with the responses so it will be useful for others. Any help will be appreciated.


texts: Flat vs frequency selective fading in MC-CDMA?

texts:
I am trying to simulate an MC-CDMA system. I have NXK  matrix $S$ which consists of subcarriers ($s_n,_k$ represents subcarrier $n$ of user $k$) and KX1 vector $X$ consists of user symbols. So my received signal is $Y=SX+N$. To include the channel response I am confused in flat fading and frequency selective fading.

$\:$ For  flat fading  i.e., coherence bandwidth $>$ signal bandwidth,  and I have a 3 tap channel impulse response in time domain. So in frequency domain I have NX1 vector $h_k$ for user $k$.

Now to include the channel fading for user $k$,

Should I do  S(:,k) .* H(:,k) %% H is channel matrix i.e., each subcarrier is multiplied by a different channel coefficient while coeffecients have nearly same magnitude, or
S(:,k)*h(k) i.e., multiplying whole sequence by a single coefficient. and what that h(k) value should be ?

For frequency selective fading does only the values of channel coefficient will change or I will have multiple taps for each subcarrier and will need to convolve in frequency domain?


texts: Why do we need the power spectral density?

texts: Since the power spectral density is just the squared of the fourier transform, why is it useful ? Can't I just replace every solution that requires the psd with the fourier transform ?


texts:
Background

I have a dataset of signals that change over time and I'd like to find the "wobbliest" of them. By "wobbliest", I mean a signal that returns consistently to zero, but does not stay at zero. This is illustrated in the figure below by the Green signal:

I do not consider the Blue signal "wobbly", since it stay at zero the whole time. Neither is the Red signal, since it seems to converge to a value.

Current Attempts

I tried getting the frequency information of each signal by doing a Fast-Fourier-Transform on each signal and setting the DC term of each signal to zero to not select for shifted signals. However, this still seemed to favour signals with large unidirectional changes in magnitude (like the Red signal) over the desired wobbly signals (like the Green signal).

Summary

How should I process my signals to find the wobbliest ones? I'm assuming I have to do some sort of operation in the frequency domain, but I don't know exactly what.


texts: Is angle modulation spectrum always discrete or this property only holds for periodic modulating signal?


texts: Combining two wave generation formulas does not work as expected (MATLAB/OCTAVE)

texts:
I'm trying to convert sawtooth wave calculation formula to Octave/Matlab language. Here are the original formulas. My Desmos take is here. I've got formulas for triangle wave and square wave working but, sawtooth won't work in either way like showed in Desmos sheet (two last formulas there).
Here's my Octave code (active saw calculation is simplified version of the above equation in comments):
function saw = saw_wave_trig(fs, f0, s, m, w)
% fs = sample rate
% f0 = fundamental frequency
% s  = 'sharpness'
% w  = 'width'
% m  = 'tooth direction'
% example: saw = saw_wave_trig(44100, 440, 0.03, -2, 1);

t = 0:1/fs:1;
##saw = m .* ((1.+ triangle_wave_trig(fs, (2*(f0/w)+1)/4, s, w) .* ...
##              square_wave_trig(fs, f0/2, s, w))./2) ...
##     .- sign(m);

##saw =  m .* ...
##            (1 .+ ...
##                  ((1.-(2.*acos((1-s) .* sin((2*pi*((2*(f0/w)+1)/4)).*t')))./pi) .* ...
##                       (2 .* atan(sin((2*pi*(f0/w/2)) .* t')./s))./pi)) ./ ...
##                         2 .- sign(m);

saw = (4.*asin((s-1).*sin((pi*t'.*(2*f0+w))./ ...
        (2*w))).*acot(s*csc((pi*f0.*t')./w)))./pi^2-sign(m)-1;

audiowrite('test_saw_trig_wave.wav',saw, fs);
plot(t, saw);

which (the commented calculations as well) produces kind of morph from negative side triangle wave to correct looking sawtooth wave, as seen in attached plot (Audacity used):

So, as my knowledge in math and Octave/Matlab is quite limited, there sure is some basics done wrong in my Octave/Matlab code. Maybe the multiplication of triangle and square needs to be done differently?
Any help in solving this is appreciated.
NOTE! This method is part of the experiment I'm doing with various methods out there to synthesize sawtooth (and other type) waves for audio use.
EDIT:
Here are those triangle_wave_trig() and square_wave_trig() functions (f1() and f2() in Desmos sheet) which of both works correctly:
function tri = triangle_wave_trig(fs, f0, s, w)
% fs = sample rate
% f0 = fundamental frequency
% s  = 'sharpness'
% w  = 'width'
% example: tri = triangle_wave_trig(44100, 440, 0.03, 1);

  t = 0:1/fs:1;
  tri = 1 .- (2 .* acos((1 - s) .* sin((2 * pi * (f0 / w)) .* t')) ./ pi);

  audiowrite('test_triangle_wave.wav',tri, fs);
  plot(t, tri);

function sqw = square_wave_trig(fs, f0, s, w)
% fs = sample rate
% f0 = fundamental frequency
% s  = 'sharpness'
% w  = 'width'
% example: sqw = square_wave_trig(44100, 440, 0.03, 1);

  t = 0:1/fs:1;
  sqw = 2.0 .* (atan(sin((2 * pi * (f0 / w)) .* t') ./ s) ./ pi);

  audiowrite('test_square_wave_trig.wav',sqw, fs);
  plot(t, sqw);
  hold on;
  plot(t, square(2*pi*f0*t'));

sqw = square_wave_trig(44100, 440, 0.03, 1); looks like this:

and generated wave file looks OK (same with the triangle wave function).


texts: Good Starting Material for a SEMI Beginner

texts:
I come from a hardware background and I am wanting to get myself more involved with the digital signal processing side of things.

I understand a lot of concepts, but only through application meaning I don't understand a lot of the theory.

If anyone could point me in the direction of some nice material that I could read over that can help me get a grasp on the basic material I would appreciate it!

Thanks!


texts: Why is it assumed that $x[n]$ is limited from $0$ to $N-1$ while evaluating DFT?

texts:
I am a total beginner in this topic of DFT. I get that the series must be finite for DFT calculation. But everywhere we are assuming that this series must be limited from $0$ to $N-1$. How to evaluate DFT for a sequence extending from $n=2$ to say $n=N+1$?

I am following this video

https://www.youtube.com/watch?v=GDFTb-BwA0o

Here in the minute 21:20 to 21:50, Professor seems to be really strict about this particular range. Why is this so?


texts: Why Is Bi Quadratic Interpolation for Image Resampling / Interpolation Rarely Done?

texts:
Related question: What are the practically relevant differences between various image resampling methods?

Bilinear and bicubic interpolation for image resampling seem to be fairly common, but biquadratic is in my experience rarely heard of. To be sure, it's available in some programs and libraries, but generally it doesn't seem to be popular. This is further evidenced by there being Wikipedia articles for bilinear and bicubic interpolation, but none for biquadratic. Why is this the case?


texts: The Rician factor is the ratio between the mean power of the LOS path to the mean power of all other (non-LOS) paths. Increasing/decreasing this factor means increasing/decreasing the mean power of the LOS path. Does increasing the Rician factor improve or degrade transmission quality?


texts: Segmenting and labeling chessboards through computer vision

texts:
With almost no experience/knowledge in computer vision, I am currently trying to segment and label the separate squares on a chessboard (i.e. a1 ... h8). My goal is to use the information to physically play chess with an AI using a webcam and a robotic arm.

I am writing the vision program in C# (using Emgu CV) for simpler programming and GUI implementation. As my first step, I attempted to detect squares by following this tutorial.

As we can see, not all of the squares were detected and I believe some of the squares were detected more than once (as 91 boxes were created).

Questions

What are the factors to consider in determining the suitable values for Canny threshold and threshold linking? i.e gray.Canny(cannyThreshold, cannyThresholdLinking)
The squares in the original image appear as straight lines to us but to the computer, it is slightly tilted. What is the cause of this? Is it because of aliasing at the edges?
Why are most of the squares not detected? Could it be the lighting?
What are the proper techniques/methods I should investigate to solve this problem? I am only familiar with the keywords: Canny, Hough (for circles I believe) and Sobel at the moment.

Code

Image<Bgr, Byte> image = new Image<Bgr, Byte>(Emgu_CV.Properties.Resources.Chessboard).Resize(0.15, INTER.CV_INTER_LINEAR);
Image<Gray, Byte> gray = image.Convert<Gray, Byte>(); //.PyrDown().PyrUp() worsens detection

imageBox.Image = image;

double cannyThreshold = 180.0;
double cannyThresholdLinking = 150.0;

Image<Gray, Byte> cannyEdges = gray.Canny(cannyThreshold, cannyThresholdLinking);

List<MCvBox2D> boxList = new List<MCvBox2D>();

using (MemStorage storage = new MemStorage())
    for (Contour<Point> contours = cannyEdges.FindContours(); contours != null; contours = contours.HNext)
    {
        Contour<Point> currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, storage); // don't quite understand the purpose of *0.05
        if (contours.Area > 250 && contours.Area < 10000)
        {
            if (currentContour.Total == 4)
            {
                bool isSquare = true;
                Point[] pts = currentContour.ToArray();
                LineSegment2D[] edges = PointCollection.PolyLine(pts, true);

                for (int i = 0; i < edges.Length; i++)
                {
                    double angle = Math.Abs(edges[(i + 1) % edges.Length].GetExteriorAngleDegree(edges[i]));

                    if (angle < 80 || angle > 95)
                    {
                         isSquare = false;
                         break;
                    }

                    if (isSquare) boxList.Add(currentContour.GetMinAreaRect());
                }
            }
        }
    }

Image<Bgr, Byte> squareImage = image.CopyBlank();
foreach (MCvBox2D box in boxList)
    squareImage.Draw(box, new Bgr(Color.Yellow), 1);
outputBox.Image = squareImage;


texts:
This signal represents the distance in an experimental device. As the speed is constant, the signal should be linear (untill it drops). However, for some reason the device showed interferences as shown in the figure below:

The question is how can I remove this high amplitude interferences, making the signal as linear as possible?

I've already tried the butterworth filter and read something about the Chebyshev, but I don't think it applies.

Any suggestions?


texts:
I am using BPSK modulation to modulate a signal in continuous time (making rectangular waveform, multiplying by a carrier). The channel is band-limited and frequency-selective, and has the following magnitude response:

After that I passed the signal through AWGN channel to add noise and then multiplied by carrier again, and then performed detection. Here is the sequence of steps:

convert binary signal to -1 and 1 and make continuous rectangular pulse
multiply by cosine or sine carrier
take the FFT of the modulated signal
multiply by frequency response of channel
take IFFT of the result
add AWGN noise
multiply signal by carrier
pass signal through bank of correlators
detection

Frequency response of my bandpass signal is

Then I plotted the BER vs SNR. However what I noticed is that for a given BER my SNR value is very high. Here is what I got :

Can you please tell me why I am getting such high SNR? does the BER vs SNR make sense?

Thanks.


texts: How to detect the edges of periodic signal?

texts:
I have a periodic signal generated by accelerometer sensor and I need to count the number of peaks. However, I can't predict when the periodic sequence starts and ends. What would be the best way to do this if expected frequency of the useful signal is between 0.2Hz - 5Hz?

Here is the example of the signal - five squats.


texts: Generating spectrum of a spectrum / identifying frequencies of ripples present in a spectrum

texts: I have a spectrum as shown. The x-axis is frequency in GHz. The spectrum shows ripples that we can visually quantify as ~50 MHz ripples. I am looking for a method to calculate the frequency of these ripples other than by visual inspection of thousands of spectra. Since the function is in frequency domain, taking FFT would get it back into time domain (with time reversal if I am correct). How can we get frequency of these ripples?


texts: What happens when N increases in N-point DFT

texts: I am curious about DFT, and I wrote a simple MATLAB code to test what happens when $N$ increases. I took a rectangular signal with length $L=15$, an then found th DFT of 16, 32 and 64 points. I looked at the plots of the DFTs, however I could not understand why there is difference between them and how zero padding affects the DFT. Could someone explain it?


texts:
I have a continuous-time system that I want to fit via least squares. I just send $N$ digital samples $x[n]$ through the system and receive (via analog signal chain, ADC etc) $N$ digital samples $y[n]$. My system can be described as

$$
\mathbf{y} = \mathbf{X} \mathbf{c}
$$

where $\mathbf{X}$ is a matrix composed of $x[n]$. Hence I solve for the coefficients via:

$$
\hat{\bf c} = (\mathbf{X}^{H} \mathbf{X})^{-1} \mathbf{X}^{H} \mathbf{y}
$$

which works wonderful and it's straight forward and easy. Note - $(\cdot)^H$ denotes the Hermitian transpose

Now $\mathbf{y}$ are heavily contaminated by noise so I need many samples. But on each receive call I can only receive a certain maximum number of samples. Even if I would receive an infinite amount - calculating the pseudo inverse becomes very expensive.

What is the easiest way and direct generalization of the above least squares set up so that I can iteratively receive blocks and refine the estimate after each block? The method should match a hypothetical, full least squares solution as closely as possible.

There are a couple of concepts which may be related but I am not sure how they relate to each other:

I could first receive, say 1000 batches of repetitive $\mathbf{y}$ and average them and solve one least squares. Is this equivalent to solving a larger least squares system with all samples? Disadvantage: I need to send repetitive data.
I am not looking for LMS or similar sampled-based methods. Ideally I would just use Least Squares ... if the number of measurements would not be as excessive
What about RLS oder IRLS? To my understanding, they are also sample based (not block based) methods.
I have heard about gradient descent + Newton type:

$$
\mathbf{c}_{n+1} = \mathbf{c}_{n} = \mu \left(\frac{\partial^2 J}{\partial \mathbf{c}^{*} \partial \mathbf{c}}\right)^{-1} \frac{\partial J}{\partial \mathbf{c}^{*}}
$$

which, in my linear model would expand to:

$$
\mathbf{c}_{n+1} = \mathbf{c}_{n} = \mu (\mathbf{X}^{H}\mathbf{X})^{-1} \mathbf{X} \mathbf{e}
$$

where $\mathbf{e}$ is the error vector between actual measurements and model with the current estimate $\mathbf{c}_n$. It requires that the unknowns are smaller than the number of samples in each iteration. This looks very close to what I am looking at ... but I am not sure if it is the right thing and how it relates to the other methods.


texts: How to find out the farrow coefficients if FIR coefficients are given?

texts: FIR filter coefficients are known. Then what is the matlab code or function that is used to determine the corresponding farrow structure coefficients?


texts: Why do we discard imaginary part of the phase spectrum?

texts:
Suppose I compute phase spectrum from the fftn function in MATLAB as

image1=imread('cameraman.tif');
figure,imshow(image1);

fourier_transform=fft2(image1);%take fourier transform of gray scale image

phase_spectrum=exp(1j*angle(fourier_transform));
imshow(phase_spectrum, [])

Here, by using imshow(phase_spectrum,[])  we first
discard the imaginary part and then normalize.

But why do we discard the imaginary part of the phase spectrum ? Whether it's spectrum  is same as real part with 90 degree phase shift ?

Is it not useful ? Also,what should be done to get whole phase spectrum not just real part of it?


texts:
Is there something like an anti-filter in image processing?

Say for instance, I am filtering an image using the following 13 tap symmetric filter:

{0, 0, 5, -6, -10, 37, 76, 37, -10, -6, 5, 0, 0} / 128

Each pixel is changed by this filtering process. My question is can we get back the original image by doing some mathematical operation on the filtered image.

Obviously such mathematical operations exists for trivial filters, like:

{1, 1} / 2

Can we generalize this to complex filters like the one I mentioned at the beginning?

Thanks, Anil.


texts: Complex Conjugate Sinusoids in Forward DFT

texts:
I hope this isn't such a dumb question, but I'm finally getting to grips with the inner workings of the DFT.

What I'm having trouble understanding is why the basis complex sinusoids in the "forward" DFT are conjugated, and why the inverse DFT uses non-conjugated complex sinusoids.

I've written a script in MATLAB that attempts to implement what I understand about the DFT (not FFT, I know a fast function for that already exists). I notice that based on this conjugation issue I'm having, when I run a real sinusoid of some frequency through my DFT script, then perform the inverse part I get back the original sinusoid but at what looks like a quarter cycle out of phase.

Can anyone clarify what's going on for me?

(here's my MATLAB code snippet):

%% setup a test sinusoid
Fs = 44100;
freq = 440.0;
amp = 1.0;

% setup col signal vector
x = generate_sine(freq, 0, amp, Fs, Fs);

% set length of DFT (# of bins/frequency resolution)
N = 2^13;

% get bin resolution from sampling frequency: acts as
% a Kth test frequency multiplier for DFTs shorter than
% the sampling frequency
bin_width = Fs/N;

% truncate length of input signal to size of DFT (bins)
x(N+1:end) = [];

% plot original, truncated signal
figure(1)
subplot(3,1,1)
title('original signal')
stem(x, '.');

%% perform DFT using N test sinusoids (bins)
% This for loop represents the summation process of the DFT.
%   -i is an iterator where:
%       } i = 0 frequency = DC,
%       } and i > 0 = Kth sinusoid frequency
%   -in each loop iteration a new test complex sinusoid is
%    generated based on i iterator which is used a the
%    frequency number.
%   -in each loop iteration the dot product of the current test
%    sinusoid is taken, then stored in a vector of frequency bins
for i = 0: N-1

    % set current test frequency (Kth frequency)
    k = bin_width * i;

    % generate a complex sinusoid vector
    cp_sin = complex(generate_sine(k, 0, 1, Fs, N) / (N/2), generate_sine(k, pi/2, 1, Fs, N) / (N/2));

    % store dot product result in bin number i
    bins(i+1) = dot(cp_sin,x);
    bins = bins.';
end

% plot DFT result
subplot(3,1,2)
title('DFT')
plot(abs(bins));
xlim([0 N/2]);

%% perform inverse DFT
for i = 0:N-1

    % set current test frequency (Kth frequency)
    k = bin_width * i;

    % generate a sinusoid
    cp_sin = complex(generate_sine(k, 0, 1, Fs, N) * (N/2), generate_sine(k, pi/2, 1, Fs, N) * (N/2));

    % perform inverse transform to get original signal back
    xi(i+1) = (dot(bins,cp_sin))/N;
    xi = xi.';
end

%% plot inverse DFT result
subplot(3,1,3)
title('IDFT')
stem(real(xi), '.');
ylim([-1 1]);


texts: Restricted Isometry Property (RIP) in Compressive Sensing

texts:
What is the meaning of Restricted Isometry Property (RIP) condition in Compressive Sensing for Sparse Signal Analysis?
How can we define Restricted Isometry Constant (RIC) for the RIP condition?

Thanks in Advance!


texts: Generating piano notes using the Karplus-Strong Algorithm

texts:
I am trying to get a piano A4(440 Hz) sound from the MATLAB. I have looked at this link https://www.mathworks.com/help/signal/examples/generating-guitar-chords-using-the-karplus-strong-algorithm.html which uses the Karplus-Strong Algorithm to get a vibrating string effect. Then, an IIR filter to get a guitar sound. But in piano, we have a different pitch for a particular frequency. How can I modify this filter to get a piano sound? Or should I get the piano sound from the Karplus-Strong Implementation directly without using any filter? The problem is, in piano, we have different contributions from the harmonics, so I should be able to control the contribution of each harmonic (880Hz 1320Hz 1760Hz, etc.)? If so, how can I do that?
clc;close all  %KARPLUS-STRONG IMPLEMENTATION
freqHz=440;
iterations=40000;
fs=44100;

N = fs/freqHz;
N = floor(N);
x = 2*rand(1,N);
x = x - mean(x);
% generate noise and init. delay line
% make sure burst and delay line agree: burst >= delay line
% ---------------------------------------------------------------------------
y  = [zeros(1,N+1)];
if iterations > length(x)
    diff = iterations - length(x);
    x  = [x zeros(1,diff)];
end
% Filtering
% y[n] = x[n] + 0.5 y[n-N] + 0.5 y[n-(N+1)]
% init.
out    = 0;
signal = 0;
lengthYOffset = length(y)-1;
for i=1:iterations
    out = x(i) + 0.5*(y(N) + y(N+1));
    % filter signal
    y = [out, y(1:lengthYOffset)];
    % update delay line
    signal = [signal out];
end

figure;
plot(signal), grid on,title('Simple Karplus Strong algorithm'),sound(signal, fs)

The IRR filter in the MATLAB help page:
clc;clear;close all
Fs=44100;
A=440;
delay = round(Fs/A);

F = linspace(1/Fs, 6000, 2^12);
b  = firls(200, [0 1/delay 2/delay 3/delay 4 /delay 1], [0 0 1 1 1 1]);
a  = [1 zeros(1, delay) -0.6 -0.9 -0.3];
[H,W] = freqz(b, a, F, Fs);
plot(W, 20*log10(abs(H)));
title('Harmonics of an open A string');
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');


texts: FFT: low magnitude peaks centered exactly 1 Hz apart across whole spectrum

texts:
I am running an fft on 60 seconds of data sampled at 1289Hz. The fft is run every second on a single channels fifo buffer which is also updated every second. The algorithm used is numpy rfft with a numpy blackman window. The fft output is normalized to the max fft value. This is all on a raspberry pi 4 with custom adc board that uses an AD4114. Am sampling 8 channels (16 in differential mode) as fast as the AD4114 can go which works out to 10.312kHz.
The following screen shots are with a 20Hz sign wave applied to one of the channels.  Similar low magnitude peaks appear with real data a transducer attached to the input. There are low magnitude peaks centered exactly 1Hz apart right on top of each whole number. Is this normal? Like a normal artifact of the fft? Possibly something wrong with my data? I am a casual fft user and am hoping someone may have some advice for me. Thank you very much : )


texts: Coherence bandwidth and coherence time in an OFDM system

texts:
While studying an OFDM system, I have encountered statements like coherence bandwidth is the reciprocal of delay spread and coherence time is the reciprocal of the Doppler spectrum.

Can somebody help me to understand this mathematically?

How is coherence bandwidth related to delay spread, and how is coherence time related to Doppler spread?


texts: How to removed ripples cause by zero-padding in fft?

texts:
Desired outcome: Interpolation in frequency domain
Attempts: Zero padding when doing fft
Problem: Ripples in frequency domain appeared after fft with zero padding
Code to reproduce the problem:
L0 = 1024;
t = linspace(-10*pi,10*pi,L0);
yt = sin(t)+cos(2*t)+0.1*randi(10,[1 L0]);

for i = 0:4
    mul = 2^i;                                 %zero padding multiplier
    L = L0*mul;
    T0 = (max(t)-min(t))/(L-1);                %period
    f = (0:L/2)/T0/L;                          %frequency axis

    yc = fft(yt,L)/L;
    yc = yc(1:L/2+1);

    figure
    plot(f,abs(yc));
end

Thanks in advance !


texts: How can i compute perimeter and area of a skeletonized circle?

texts:
In opencv if i use findcontours function, i get contours and i can compute area, perimeter, convex hull.
if i use a Skeletonized image of a circle how can i compute perimeter,area, convex hull of the skeletonized circle?

UPDATE

image:

My skeletonize function:

import numpy as np
import cv2
import scipy.ndimage.morphology as m

def skeletonize(img):
    h1 = np.array([[0, 0, 0],[0, 1, 0],[1, 1, 1]])
    m1 = np.array([[1, 1, 1],[0, 0, 0],[0, 0, 0]])
    h2 = np.array([[0, 0, 0],[1, 1, 0],[0, 1, 0]])
    m2 = np.array([[0, 1, 1],[0, 0, 1],[0, 0, 0]])
    hit_list = []
    miss_list = []
    for k in range(4):
        hit_list.append(np.rot90(h1, k))
        hit_list.append(np.rot90(h2, k))
        miss_list.append(np.rot90(m1, k))
        miss_list.append(np.rot90(m2, k))
    img = img.copy()
    while True:
        last = img
        for hit, miss in zip(hit_list, miss_list):
            hm = m.binary_hit_or_miss(img, hit, miss)
            img = np.logical_and(img, np.logical_not(hm))
        if np.all(img == last):
            break
    return img

nomeimg = "JPEG/e(5).jpg"
img = cv2.imread(nomeimg,0)
ret,img = cv2.threshold(img,127,255,0)
element = cv2.getStructuringElement(cv2.MORPH_CROSS,(3,3))
img = 255 - img
img = cv2.dilate(img, element, iterations=7)
img = cv2.erode(img, element)

#element = cv2.getStructuringElement(cv2.MORPH_CROSS,(6,6))

skel = skeletonize(img)
skel = skel.astype(np.uint8)*255


texts:
Are there any Open source implementations of GPS+IMU sensor fusion (loosely coupled; i.e. using GPS module output and 9 degree of freedom IMU sensors)? -- kalman filtering based or otherwise

I see a few open source implementations of IMU sensor fusion that merge accel/gyro/magneto to provide the raw-pitch-yaw, but haven't found anything that includes GPS data to provide filtered location and speed info.


texts:
I have been trying to follow the Least Mean Square(LMS) algorithm derivation given by Wikipedia here and have the following questions.

Here I expected $y(n)$ is to be computed by convolving $x(n)$ with $h(n)$, but in the equation given by Wikipedia it is shown as a matrix multiplication
$y(n) = h^H(n).x(n)$. Are these two operations(convolution and matrix multiplication) same here?.
Why do we need a Hermitian transpose rather than normal transpose in the above equation?
Cost function is defined as $E\{|e(n)|^2\}$. Why do we need expectation operator here? Why not normal Mean Square Error(MSE)?
Does LMS filter converge to all type of input signal?
I understand LMS make use of Stochastic Gradient Descent and the update equation for the same is $\hat{h}(n+1)=\hat{h}(n)+\mu x(n)e^*(n)$, what would be the update equation if we would have used a normal Gadient Descent?


texts: Sound feature extraction too brief in comparison with manual annotation of sound. How to combine them?

texts: Sound characteristics (features) are taken per e.g. 20 ms, but manual annotation takes place in durations of seconds. If we want to use these characteristics along with labels, how can this be performed? is there some form of grouping?


texts:
If I have a discrete time process model of the form:

$$x_{k+1} = x_{k} + v_{k}\cos(\theta_{k})dt$$
$$y_{k+1} = y_{k} + v_{k}\sin(\theta_{k})dt$$
$$v_{k+1} = v_{k} $$
$$\theta_{k+1} = \theta_{k}$$

Which gives me a state transition matrix of the form:
$$F = \begin{bmatrix}
      1 & 0 & \cos(\theta)dt & -v\sin(\theta)dt \\
      0 & 1 & \sin(\theta)dt & v\cos(\theta)dt \\
      0 & 0 & 1 & 0 \\
      0 & 0 & 0 & 1 \\
\end{bmatrix}$$

And if I use an EKF and start with a diagonal state covariance matrix:

$$P = \begin{bmatrix}
      p_{xx} & 0 & 0 & 0 \\
      0 & p_{yy} & 0 & 0 \\
      0 & 0 & p_{vv} & 0 \\
      0 & 0 & 0 & p_{\theta \theta} \\
\end{bmatrix}$$

Should I expect to have the $P$ matrix only have non-zero values in the index locations where we have non-zero entries in the state transition matrix $F$ (and the corresponding "reflections" to keep $P$ symmetric), that is:

$$P = \begin{bmatrix}
      p_{xx} & 0 & p_{xv} & p_{x\theta} \\
      0 & p_{yy} & p_{yv} & p_{y\theta} \\
      p_{vx} & p_{vy} & p_{vv} & 0 \\
      p_{\theta x} & 0 & 0 & p_{\theta \theta} \\
\end{bmatrix}$$

or could we expect the entire $P$ matrix to become filled with non-zero elements?

Intuition tells me that the former should be true, but experimentation shows me that the latter is true, which makes me wonder if my EKF implementation in incorrect somewhere. Any insight into the deeper workings of how covariance matrices should evolve with time would be much appreciated.

EDIT: I should have also mentioned that I'm using diagonal process and measurement noise covariances $Q$ and $R$, and a diagonal measurement matrix $H$.


texts: Random 2D noise generated in spectrum domain always have maximum at (1,1)

texts:
I want to add a noise made of harmonic functions to my 2D matrix. I thought it could be made by adding random amplitudes to modes in Fourier domain. I keep Hermitian symmetry of the matrix so that the IFFT gave me a real matrix (I iterate N/2 times over each positive and its conjugate negative frequency).

Why is the first element of the final matrix always the maximum?

If I, however, not only add but add or subtract a random number then the maximum is placed in a random place.

I've written an example in MATLAB:

N = 16; %dimensions

x2d = ones(N); %basic 2D N*N matrix
y2d = fft2(x2d); %its FFT

%adding a random number to the spectrum paying attention to its conjugate
%part so the basic matrix remains real
upfreq = N/2;
for chn1=2:upfreq
    for chn2 = 2:upfreq % N/2+1 is skipped
          rnd = rand; %if changed to rand-0.5 it gives random maximum point
            y2d(chn1,chn2)=y2d(chn1,chn2) +rnd ;
            y2d(N-chn1+2,N-chn2+2)=y2d(N-chn1+1+1,N-chn2+1+1)+rnd;
    end
end

imagesc(ifft2(y2d))
colorbar

Could you explain me why is it so?


texts:
I'm confused by the SMA. I'm reading a paper which states that "SMA is the square root of the summation of the filtered acceleration signal". So I understand that it's $sma = \sqrt{\sum{samples}}$

I check the referenced paper, which says that "SMA is calculated after dividing area under the acceleration curve with the time interval". So $sma = {1 \over T} \sum samples$, which is some kind of average, which looks like what is on this StackOverflow question.

And the Wikipedia article is so new I'm not sure it's reliable.

In the end, what is exactly SMA as I couldn't find a proper definition online?


texts: Understanding "voltage" and "power" in SNR of a sampled signal

texts:
I'm facing a gap in my understanding of when a signal is a "voltage" signal and when it is a "power" signal that I've always managed to avoid resolving until now...  First what I think I understand, then my question after the horizontal rule:

I understand SNR to be the ratio of average signal power to RMS noise power:
$$
SNR=\frac{S_P}{N_P}
$$

or in dB:
$$
SNR_{dB}=10\cdot\log(S_P)-10\cdot\log(N_P)
$$

When calculating SNR based on voltages, power is proportional to voltage squared ($P=V^2/R$) and the Rs drop out in the ratio so we get:
$$
SNR=\frac{{S_V}^2/R}{{N_V}^2/R}=\left(\frac{{S_V}}{{N_V}}\right)^2
$$$$
SNR_{dB}=20\cdot\log(S_V)-20\cdot\log(N_V)
$$

With the familiar 10log for power, 20log for voltage relation doing the squaring for voltage.

I have a radio signal that I receive at an antenna.  For simplicity, I assume I have a perfect receiver and noiseless amplifier so that my received signal power is $P_{Rx}$ and noise is only Johnson thermal AWGN: $N_T=k_B\cdot T\cdot B$, where $k_B$ is Boltzman's constant, T is temperature and B is bandwidth-- none of which really figure in after this.

I believe my SNR at this point to be:
$$
SNR_{RF}=\frac{P_{Rx}}{N_T}
$$

Now I sample, and this is where I start to have questions.

Ignoring quantization noise and such, I believe the analog-digital conversion process results in voltage signals-- that is, the sample values are measurements of the voltage across a resistor ladder or some such meaning the SNR of the sampled signal follows the voltage law:
$$
SNR_{ADC}=\left(\frac{S_{ADC}}{N_{ADC}}\right)^2
$$

Setting aside practical implementation losses, I believe $SNR_{ADC}=SNR_{RF}$.

Where I start to be less sure is when I start operating on the sampled signals.  Let's say I multiply the sampled signal by a delayed version of itself.  Ok, the noise terms get more complicated because I'm taking the product of two independent random variables with non-zero mean but, more fundamentally, is the result a "voltage" or a "power"?  Is there a physical explanation that will help me understand this?

That is: in order to maintain consistency among my SNR estimates, is this a 10log or 20log calculation?

By a pure units analysis, I should have voltage-squared which implies power-- but these are still ADC levels.  It would also seem odd to say that my signal is voltage-cubed if I multiply by two delayed copies...


texts:
I'm playing with Python & numpy to filter audio. It is relatively straightforward to design and us low-high-bandpass/stop FIR and IIR filters, stuff can be done in a couple of lines.

I'm implementing a small software defined radio software, and I need an all-pass filter that has 90 degrees phase shift everywhere, and is flat (as much as possible).

Unfortunately I was unable to find any quick solution for this.

Please share your thoughts on this.

Thank you,

Tamás.


texts: How to take multiple IIR filters efficiently

texts:
I have a collection of IIR filters (exponential decay at various decay rates). I'd like to compute all of them on a discrete time series efficiently.
Is there a way to do this that is faster than $$O(\mbox{num_filters} \times \mbox{num_points})$$?


texts: How does filter bank work in image processing?

texts:
I read a paper about directional filter bank in image processing and I don't understand clearly about the process. It says they use '2-band structure' like this image:

could someone here please explain it to me how this process works? I would like to implement it on python or MATLAB.


texts:
I am trying to distinguish between speech signals and music signals using feature extraction and SVM. I am looking for features to include for this purpose.

While going through literature, I came across something called '4 Hz modulation energy' that is distinctively present in speech and not in music, but was unable to find any further literature about it. I would like to know the reason for this energy present in speech. References to the same would be very helpful.

Also, I tried plotting the spectrogram of a music signal and a speech signal, such that the frequency bin size was 1Hz (which would involve me taking a 44100 point FFT where 44100 was my sampling frequency). On visually inspecting the spectrogram at 4Hz, such a 4Hz peak of energy was not apparent to me for a speech signal as compared to a music signal. When I include the 4 Hz modulation energy as a feature per frame in my SVM, it indeed reduces the accuracy of prediction.

As such I would like to know how this energy arises, and would like to know more about it.

Edit : This paper answers some of my questions.


texts: Detecting peak value on realtime IMU data stream

texts:
I'm using Qt C++, QCustomPlot to read and display realtime value from an IMU. This is how I set the realtimeDataSlot:

void Settings::realtimeDataSlot(double x_acceleration_g, double y_acceleration_g, double z_acceleration_g, double z_acceleration_gnew)
{
    static QTime time(QTime::currentTime());
    // calculate two new data points:
    double key = time.elapsed()/1000.0; // time elapsed since start of demo, in seconds
    static double lastPointKey = 0;
    if (key-lastPointKey > 0.02) // at most add point every 20 ms
    {
      // add data to lines:
        ui->customPlot->graph(0)->addData(key, x_acceleration_g); // X axis
        ui->customPlot->graph(1)->addData(key, y_acceleration_g); // Y axis
        ui->customPlot->graph(2)->addData(key, z_acceleration_g); // Z axis
        ui->customPlot->graph(3)->addData(key, z_acceleration_gnew);

      lastPointKey = key;
    }
    // make key axis range scroll with the data (at a constant range size of 8):
    ui->customPlot->xAxis->setRange(key, 8, Qt::AlignRight);
    ui->customPlot->replot();

    // calculate frames per second:
    static double lastFpsKey;
    static int frameCount;
    ++frameCount;
    if (key-lastFpsKey >2) // average fps over 2 seconds
    {
      ui->statusbar->showMessage(
            QString("%1 FPS, Total Data points: %2")
            .arg(frameCount/(key-lastFpsKey), 0, 'f', 0)
            .arg(ui->customPlot->graph(0)->data()->size()+ui->customPlot->graph(1)->data()->size())
            , 0);
      lastFpsKey = key;
      frameCount = 0;
    }
}

which shows me as follows:

As a next step, I need to detect the peaks in any axis, say for example in the above figure in the Y axis there are peak values which I need to detect and count.

I marked in the peaks by hand in the figure. I define peak as the figure that value (positive values) more than 0.25 g at high rate.

Can somebody show me a way to do this realtime?


texts:
I'm looking for a way to implement a Speech Separation from a .wav file. Let's say I have a .wav signal containing the following words:

"The cat flew away"

Now I don't really want to do the speech separation after I've split the signal inside blocks of size NxM because I feel as though I could miss parts of the word.

I have thought about the following algorithm:

1) When the wave signal is being processed, I process the signal and remove any signals that do not warrant consideration

2) When the signal starts to increase, we can therefore infer that this is a word and this get's counted. When the signal begins to decrease, stop counting as this could be white-noise.

The algorithm above would therefore infer that there is three words and then I can perform all of the actions needed on the signal..

Do you think this is an appropriate algorithm OR could anyone recommend any papers etc.. Which would enable me to do this?

EDIT:

Assume that I have a signal that contains "calls" from different bats. These signals have been recorded. What I basically need to do isolate the different bat calls from a signal. So, I would have the following:

-> Bat1 -> Bat2 -> Bat3, ....

So, it would work like speech segmentation. But, instead of segmenting for words, I would segment for Bat calls. Because, from what I believe, each "bat call" will be of a different or similar frequency. So therefore, would it be possible to some how "split the signal into blocks" and then calculate the frequency of the block, see if this matches with the frequency vector, and, if it does.. Keep it, otherwise remove it?


texts: Correlation between real and imaginary parts of a Fourier transform of zero mean Gaussian

texts:
From this previous post, the real and imaginary parts of the Fourier transform of a zero mean Gaussian are uncorrelated (and i.i.d. Gaussians)

This some how seems counter-intuitive. It seems if the real part has a large intensity, then the imaginary part should be small. I read through the proof linked from the previous post, but I don't have a good intuitive feel from this proof.

Can you provide an intuitive explanation of why this is true?


texts: White noise vs. delta pulse and Ultraviolet catastrofe

texts:
Everybody explains that white noise has all frequencies equally strong. But, this immediately means that

Ultraviolet catastrofe inevitably happens if power > 0 stays constant at any frequency and, what is similarly unacceptable,
White noise is identical to single Dirac impulse since delta pulse is a constant in the Fourier basis). Note that constant is the opposite to the notion of noise.

Is average over time is implied, like you obtain uniform distribution, or what?

Why answers are not satisfactory

Answers say that white noise does not mean that signal spectrum is limited. It means that that power spectrum is flat, which also means that there is no correlation between samples so that it is correlation matrix, which is delta function (and I do not know what is its fourier transform is, which has the infinite spectrum).

I see a several problems with that. At first, the power spectrum is simple a square of the spectrum. If you say that you prevent the Utraviolet catastrophe by cutting all frequencies above some threshold $f_{max},$ you cannot have a flat spectrum anymore.

Secondly, I understand that you can have a mean and variance of a uniform distribution which has value $v$ in $[a,b]$ and 0 outside. But what is a mean and variance of a perfectly flat power spectrum? Ok, mean might be zero if you admit negative frequencies. But you say that variance is $\sigma^2$. How is that?

Lastly, I have determined that rapid changes are less likely in the the limited spectrum signal, which means that samples tend to each other, which means that they are correlated. Ok, might be you say that they are correlated but pink nose does not say if they are positively or negatively correlated, so samples are not correlated in case of pink noise. Ok, this is great. But we have just concluded that pink noise is white (or can be white). Is it right?

I also see Wikipedia saying that white noise can be Gaussian, which means that the samples are normally distributed. This means that they will tend to each other, like in the pink noise.


texts: scaling issue when using scypy's firwin2 to get coefficients for a filter

texts: I am trying to use SciPy's firwin2 command to get the coefficients that correspond to a filter of my creating.  I took white noise in Audacity, applied an Equalization curve, exported said curve out of Audacity, and I am using firwin2 to get the coefficients for said filter.  I manage to get coefficients out that give me a correct curve shape but the magnitude of the signal is WAAAAAAY off.  It's almost $50$ dB higher than what it should be.  Does anyone know when I could be leaving out a scaling factor?


texts:
Hello i'm designing a low pass filter windowed sinc in matlab

Fs = 2048;
Fc = 250/Fs;  % 250hz
M=2048 % (to get a 4hz transition bandwidth) sig contains 200hz + 300hz sinusoids, i'm aiming at leaving only the 200hz

filt =sinc(2*Fc*((1:length(t))- M/2)).*(0.42-0.5*cos(2*pi*(1:length(t))/M)+0.08*cos(4*pi*(1:length(t))/M))';
filt(M/2)=2*pi*Fc;
fsig = sig .* filt;

i understand that the winsinc filter is applied by convolution in the freq domain, so it means a multiplication in the time domain, which i did, but i get an erroneous result, i get a 0 flat frequency everywhere in my frequency plot.
what's wrong?

doing a freqz(filt) i get this, it seems correct reponse


texts: How to use convolution operator in matlab?

texts:
I = imread('13.jpg');
  Ir = I(:,:,1);
  Ig = I(:,:,2);
  Ib = I(:,:,3);

   %# Create the gaussian filter with hsize = [5 5] and sigma = 2
   G = fspecial('gaussian',[10 10],1);
  %# Filter it
  Ig = imfilter(I,G,'same');
  %# Display
  imshow(Ig);

  PSF = fspecial('gaussian',7,10);

  Irc = conv2(Ir,PSF,'same');
  Igc = conv2(Ig,PSF,'same');
  Ibc = conv2(Ib,PSF,'same');

Why am I getting this error?

       Warning: CONV2 on values of class UINT8 is obsolete.
       Use CONV2(DOUBLE(A),DOUBLE(B)) or
       CONV2(SINGLE(A),SINGLE(B)) instead.
       In uint8.conv2 at 11
       In Gaussian_Filter_image at 19
      Warning: CONV2 on values of class UINT8 is obsolete.
       Use CONV2(DOUBLE(A),DOUBLE(B)) or
       CONV2(SINGLE(A),SINGLE(B)) instead.

    In uint8.conv2 at 11
       In Gaussian_Filter_image at 20
       Undefined function 'conv2' for input arguments of type 'double'
       and attributes 'full 3d real'.

      Error in uint8/conv2 (line 18)
       y = conv2(varargin{:});

       Error in Gaussian_Filter_image (line 20)
       Igc = conv2(Ig,PSF,'same');

Here I want to perform convolution of image and gaussian filter but I am unable to do that ?

I have even tried the modification after using

   Ir = double(:,:,1);
   Ig = double(:,:,2);
   Ib = double(:,:,3);

then also I am getting the same error?


texts: How to remove background noise from sound file for analysis

texts:
I'm working on a project at my university and it involves background noise recognition/classification.  I'm very new to this so I'm unsure what to really search/google or where to really begin any research.

I'd like to remove background noise from any audio file and analyze THAT and not the primary signal (for example, if you had a recording of someone talking on a phone, remove their voice and keep the remaining background noise).  I then wish to train a classifier to cluster or group possible sound samples.

How does one do this (extraction and preseervation of background noise)?  I'm guessing I need to do a FFT on the raw data?  Are there proper file formats one needs to have an audio file in to do this?  Additionally, what are proper learning or classification techniques for audio recognition?


texts: Parameter extraction from DFT results, possibly with leakage effects

texts:
Let's start with a simple temporal law, that I want to analyze in the frequency domain :

$x(t)=\frac{1}{2}(A+Bcos(2\pi \nu_0 t+\phi_0))$, with :

$A=4$
$B=10$
$\nu_0=10^8$
$\phi_0=10^8$

I made a simple DFT (in Ruby) with $N=256$ samples at $f_s=6.10^8$ and got the following results, that are self explanatory, hopefully :

{:freq=> 0, :ampl=>1.9661708933907966, :phase=>0.0}
...non significant amplitudes...
{:freq=>41, :ampl=>0.8468197908638829, :phase=>0.502386551741981},
{:freq=>42, :ampl=>2.0871309982776522, :phase=>0.5146361931223131},
{:freq=>43, :ampl=>4.115492878192129,  :phase=>0.5268855235929356},
{:freq=>44, :ampl=>1.0144367909506748, :phase=>0.5391345296503323},
...non significant amplitudes...

I clearly retreive A : $1.96 = \frac{A}{2}$ gives $A = 3.9 \approx 4$. Good.

As for $\nu_0$, this seems correct also :
$f_{analysis}(43)=\frac{43f_s}{256}=100781250.0\approx 10^8=\nu_0$.

For $B$ and $\phi_0$, things are more difficult, because (I guess) of DFT frequency leakage. Direct reading of my result gives $$2\times 4.11=8.22 \not\approx B=10$$

As experts, how would you get acceptable $B$ and $\phi_0$, from my results ?


texts:
What is the variance of $N$ samples of white Gaussian noise?

I have an Equation for a continuous time which includes an $\mathrm{SNR}$ term inside it.

Now when I am going to sample it, what is the value of the sampled $\mathrm{SNR}$?

$\mathrm{SNR}$ here is $\frac{A^2}{\sigma^2}$.

What is $\sigma^2$ of the sampled version??

Actually we have the following case
Variance(parameter) = 90/p^2 * SNR * T^5
where SNR = Amplitude^2/ Sigma^2.
T is the length of the signal.
Now if we want to compute the variance of the same parameter in the discrete case we can write
Variance(parameter) = 90/p^2 * SNR * (N*Ts)^5
What is the value of SNR here ??


texts: inverse z transform performed on 6th order IIR filter

texts: we are told to find coefficients and impulse response of IIR filter of order of 6. There are 6 zeros and 6 poles in the design. Pole and zero pairs are conjugate and poles are within the unit circle whereas zeros are on the unit circle and. I can write transfer function with no problem, but I cannot expand it as its order is too big to work with. I must work my way up to finding impulse response and filter input/output coefficients, but I am stuck terribly with the transfer function. What can I do? long divisions are used in second order polynomials, no example of it for larger orders. Is there a easy way? I am up for hours trying to figure it out.


texts:
I have started looking into DSP and made an implementation of short-time fourier transform, using kissFFT to perform the FFT. I then render a spectrogram.

An example image that I have generated can be seen below. On top is the spectrogram of a music file from my implementation and under it is the spectrogram of the same section generated from audacity.

My concern is the vertical lines that show up from my implementation, which are most visible in the higher frequencies. They may interfere with other stuff I will try to do later on. Has anyone ever had the same problem or know the cause? How can I get rid of them?

Additional information:
I use hamming window with 50% overlap (using different windows has not helped)


texts: What is the forward error correction in 802.11a?

texts: I am trying to put together a baseband-equivalent simulation of 802.11a signals, which according to Wikipedia has a variable encoding (PSK, QAM, etc.) that have differing coding rates (1/2, 2/3, 3/4) depending on the choice of RATE bits.   I can't find any details on the forward error corrector used in 802.11a.  Could someone point me the the algorithm used in 802.11a?


texts: Difference between Analog IQ sampling and creating IQ digitally

texts:
In the context of wideband receiver design, what are the advantages and disadvantages of Analog IQ sampling vs creating IQ digitally (with Hilbert transform)?

Why do we use different ADCs to create independent IQ channels when we can use Hilbert Transform to create the Q channel and use only one ADC?


texts: How to compute the energy of a time series?

texts:
I am analyzing the vertical component of 1Hz sampled geomagnetic data. These data were band-passed filtered around 0.01Hz (100s).

I would like to compute the daily energy contained in these time series. So far, I have tried computing the sum of the squared amplitudes of all samples:

Where zk are the samples of the vertical geomagnetic field time series.

Is this the correct way of computing the daily energy contained in these band-passed filtered time series? Should I take the square root of this sum, or normalize it by the number of samples in the time series?


texts: Viterbi decoder R=1/2 , K=3 transition table / matrix Implementation

texts:
Im trying to understand the transition table / matrix of Viterbi decoder K=3 r=1/2 from communication digital book called bernand sklar first or second edition .
Im confused about the transition matrix that's written on the books so there might be a trick I couldn't figure out it and hope you guys helping me with.
The convolutional encoder K=3 , r=1/2 state machine is :

in order to implement the transition matrix / table which it's actually :
An array (table) showing for each convolutional encoder current state and next state, what input value (0 or 1) would produce the next state, given the current state. We'll call this array the input table. Its dimensions are 2(K - 1) x 2(K - 1). This array needs to be initialized before starting the decoding process.
So the transition matrix for viterbi decoder K=3 r=1/2 is as the book attach is :

I understood this transition matrix table sketch but I didn't understand why in the book mention that the transition matrix is :
[0  1  1   100
0  0  1    1
100 0 100   1
100 0 100   1];
the rows represents correspondingly current states : 00 (first row) , 01 (second row) , 10 (third row ) , 11(fourth row).
the columns represents correspondingly the next states by given input: 00(first column ) , 01 (second column) ..etc
for instance if we look at attached matrix table we see at first row and first column (matrix (1,1)) the value is 0 and this mean that the current state is 00 (because we are at first row) and in order to go to next state 00 (first column) the input is 0, so matrix (1,1) = 0.
the same manner / procedure for other columns / rows .
where there's X in the attached matrix table it's number 100 in the written transition matrix in the book(dummy number).
what is confusing me that , in the second row with second column the value is 0 (current state is 01 and in order to go to 01 (second column represents 01) the input is 0 , why the input is 0? according to attached matrix table(in the sketch) it's written X so the value must be 100 and not 0 . but I don't know if Im right and there's a wrong written in the book or Im missing something .
Could anyone please help me why in the second row with second column the value is 0? it should be 100 because the attached transition table sktech the value is X so 100 represents X and not 0.
Also in the first row (00) with second column (01) in the sktech matrix table it's written X but in the transition matrix in the book written : 1 ..it sounds that Im missing something!
Thanks alot for helping me out.


texts: How to find difference equation, given poles and zeros?

texts:
I'm given poles at ${1+i}$ and ${1-i}$, and zero at $0$.

I have to find the difference equation and find out whether the system is stable.

Now I found in a similar question, which structure I tried to follow ( How to find system function, H(z) in the z-domain, given zero-pole plot of the system? ), that we can express $H(z)$ as $$H(z)=G_0z^{-1}\frac{(z-z_0)(z-z_1)\ldots}{(z-p_0)(z-p_1)\ldots} $$

It's clear to me that the numerator of H(z) is simply = z, but I can't wrap my head around the denominator.

I tried to go for: (z- (1-i))*(z- (1+i)) - my prof looked over my shoulder, nodded and told me to simply multiply it, adding "there will be no i in the polynomial". Now I really don't find any combination of tricks to achieve this, and I've been stuck for several hours right now.

I'd very much appreciate a hint!


texts:
float xx = acceleration.x;
float yy = acceleration.y;
float zz = acceleration.z;

float dot = (px * xx) + (py * yy) + (pz * zz);
float a = ABS(sqrt(px * px + py * py + pz * pz));
float b = ABS(sqrt(xx * xx + yy * yy + zz * zz));

dot /= (a * b);

I run into the equation above on github, but I don't know what kind of DSP filter is this?

$$ result= \frac{x_{prev} * x + y_{prev} * y + z_{prev} * z }{\sqrt{x^2 + y^2 + z^2} * \sqrt{(x_{prev}^2 + y_{prev}^2 + z_{prev}^2)}} $$

If my question is too obvious please forgive my ignorance, I hope that it is a real question and it not will be closed.


texts: A hypercomplex encoding to preserve spatial/temporal information?

texts:
I have recently come across the idea of encoding a 1D signal (i.e. a mono audio) as a complex vector instead of as a vector of reals, where the imaginary part is used to encode the cells' positions. It can be further generalized to a way of encoding a grayscale image into a vector of quaternions where imaginary parts now encode the pixels' positions.

My question is on the implications of this kind of encoding for signal processing theory in general. Will this kind of encoding be useful in any application? Does it have any further implications?


texts:
A sentence I copied from book.

That a 2$\times$1 Alamouti SFBC is referred to as a rate 1 code, two symbols are sent over two adjacent subcarriers.

This question is regarding this SFBC encoder (Alamouti scheme). I understand how the encoder works for the two transmit antenna case. Below I briefly given an example for convenience.

Assuming a BPSK modulator applied to data input $I$. Then we have

$I$ = 0 0 1 1 0 1 1 1

BPSK symbols=  1 1 -1 -1 1 -1 -1 -1

Then the output of the STBC encoder could be found according to the

\begin{array}{lcr}
\mbox{$$} & Antenna1 & Antenna 2 \\
\mbox{$f_1$} & s_1 & s_2 \\
\mbox{$f_2$} & -s_2^* & -s_1^* \\
 \end{array}

and so applying this to the BPSK symbols I get the following symbols

Antenna1 symbols: 1 -1 -1 1 1 1 -1 1

Antenna2 symbols: 1 1 -1 -1 -1 1 -1 -1

My question is next, what do we do with these symbols for LTE system ie OFDM modulation, do we send the symbols 1 and 2 over antenna 1 and antenna 2 respectively over the same subcarrier ? i.e I don't understand how transmission over subcarriers takes place? More precisely I don't undersatnd the assignement of the symbols to the different subcarriers?

Thank you.


texts:
I am about to understand a kurtogram, and don't understand what means the value of "K" (presented in table 1),or especially why takes values of 1.6 ; 2.6 ; 3.6 etc.
Other question is how do interpret the kurtogram (figure 2)


texts:
I didn't mess around with the code here, it was straight from their website, I just want to see if it would work. However, whenever I run it, it has feedback in it, sometimes I can't hear anything at all. It is not the speaker because I can record and play things separately. Here is the code if you want.

I tried changing the frames per buffer to 5000 and it lost the feedback and started an echo. I also tried to have it record and then play back later, but it said that the input had overloaded.

NEW DEVELOPMENT: the feedback is the echo, for some reason when the frames per buffer or the CHUNK is decently high, there is an echo, when it is like the code below, the echo compounds and speeds up to result in feedback, multiple echos playing at once to become a high shrill noise.

PLEASE HELP!!!

import pyaudio

CHUNK = 1024
WIDTH = 2
CHANNELS = 2
RATE = 44100
RECORD_SECONDS = 5

p = pyaudio.PyAudio()

stream = p.open(format=p.get_format_from_width(WIDTH),
                channels=CHANNELS,
                rate=RATE,
                input=True,
                output=True,
                frames_per_buffer=CHUNK)

print("* recording")

for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
    data = stream.read(CHUNK)
    stream.write(data, CHUNK)

print("* done")

stream.stop_stream()
stream.close()

p.terminate()


texts: Program to display amplitude of sine signal at each interval and display separately in MATLAB

texts: I am facing a problem on how to separate amplitude of sine signal and compare with other sine signal having same frequency but different amplitude. How can one write a code for this?


texts: Impulse response time period in circular convolution

texts: While considering an input to be periodic of Period N, can the impulse response not be periodic of period greater than N ? If it can be, how can one compute it’s convolution?


texts:
A sampled single dimensional signal is a vector.
A sampled image is a matrix.
Is video considered a rank-3 tensor since it is a set of images stacked on top of each other?


texts: How to derive 2nd order Butterworth condition for the damping coefficient mathematically?

texts:
The magnitude of 2nd order low pass filter is given as
$$|H(\omega)|^2= \frac{1}{(1-(\frac{\omega}{\omega_o})^2)^2+(\frac{2\zeta\omega}{\omega_o})^2}$$
Now in order to achieve maximally flat within pass band, we take the derivative of this equation and set it to zero to find the extremums.
\begin{equation*}
    \frac{\partial(\frac{1}{|H(\omega)|^2})}{\partial\omega} = \frac{\partial[(1-\omega^2)^2+(2\zeta\omega)^2]}{\partial\omega}
\end{equation*}
\begin{equation*}
\begin{split}
    2(1-\omega^2)(-2\omega)+8 \zeta^2\omega &= 0 \\
    \omega(\omega^2-1)+2\zeta^2\omega &= 0 \\
    \omega (\omega^2-1+2\zeta^2) &=0 \\
    \end{split}
\end{equation*}
Then we get $\omega =0$ or $\omega^2 = 1-2\zeta^2$
Now my question is, why do we set the second root to be zero to obtain no ripples in the passband so that we can derive:
$$\zeta=1/\sqrt{2}$$
I understand that the slope of the magnitude is zero at these roots, but I couldn't really interpret the idea here. Any help is appreciated.


texts: Determining the point in a temporal signal when a periodic behavior begins to occur

texts:
I'm a newcomer to digital signal processing, so I'm looking for some general advice and direction on this problem I have. I have a signal like that shown below. Starting around x=40000, you can see a signal which has a periodicity of about 1 day (you can't tell it's 1 day from the figure), although there is various noise and other behavior along with it. Before this point, this behavior does not really occur (the process giving rise to the prior behavior has not yet started). What I'd like to do is determine this starting point, not visually, but from a computational approach.

To look into this further, I computed the FFT of the above signal, and then computed its power spectrum as $FT(signal)*FT^{*}(signal)$. As you can see in the power spectrum below, the dominant contribution occurs at a frequency corresponding to 1 day. From this point I thought perhaps I could compute some measure of "purity" of this signal having this dominant mode, and by varying the starting point of the initial signal to process (by simply dropping the points at the beginning one by one and computing this "purity") that I might be able to detect when this periodic signal starts (the assumption being that once I trim off the part of the signal before this process begins that I will achieve maximal "purity").

However, there must be a better way of accomplishing this feat, and I also have not yet determined the best way to compute the power "purity" either. For those who know more on this topic, how would you approach it? Thanks in advance for any directions that you could point me.


texts:
In information theory, there are two concepts that are widely used: source encoding and channel encoding.

I'm afraid I may not be capable of expressing my doubts clearly, but the thing is that I don't understand they interact between each other.

To try to make it clearer, I'll try to give an example of my doubts:

Every codeword for the channel encoding must have the same length. Why is this? If the source from which the channel is reciving its input used a Huffman code, for example, lengths might be different for each symbol. Isn't that a contradiction?


texts: Why is bit error rate = symbol error rate / number of bits per symbol in QPSK

texts:
I saw a code computing the error probability of QPSK, and I found that in this code the bit error rate is computed as symbol error rate divided by $2$.

I think that $2$ is because the QPSK symbol consists of two bits. But why can the bit error rate be equal to the symbol error rate divided by the number of bits per symbol?


texts: How is cross-correlation related with orthogonality?

texts:
In linear prediction we can say that in case of optimum linear predictor the error with be orthogonal to data. And when we derive minimum mean square error for $\underline{y} = \mathbf{a}\underline{x} + \underline{b}$ case we find following relation

  $\xi = \sigma^2_y (1 - \rho_{xy} )^2$

Where $\rho_{xy} $ is correlation coefficient and if we talk about cross correlation $r_{xy}(k,l)$ of zero mean and uncorrelated random variables x and y, then how does this conclude that if $r_{xy}(k,l)$ will be then the signals will be orthogonal?


texts:
I am trying to understand the usage of Hermitian symmetry in OFDM systems and have a couple of questions regarding this.

What is the reason of using the Hermitian symmetry in OFDM?
How can we arrange the data in terms of Hermitian symmetry?
In OFDM system where do we arrange our data as Hermitian symmetry?
Is there any reference or documentation that explains Hermitian symmetry in OFDM system?


texts: Direct Correlation (DC) Time Delay Estimation: Variance Keeps Decreasing for Increasing SNR?

texts:
I'm trying to reproduce the results from this paper "Discrete time techniques for Time Delay Estimation" doi:10.1109/78.193195, for both the correlation and Least Squares.

I've generated a random (statistically gaussian distributed) signal and filtered it with a gaussian low-pass, to make it band-limited. Then I added increasing noise to the signals.

I've tried for 0, subsample and 1< sample delays. In all cases, the variance of my DC keeps decreasing as I increase SNR (actually, the behavior closely matches that of the LS or average square difference function, as they call it).

Is there any reason as to why I don't see that asymptotic behavior predicted by the paper?
Does it have to do with the signal properties or the way I'm processing in some way?

Also, if possible, can someone please make sense to me of why that limit exists for the correlation, conceptually? I can't seem to understand from the paper.

Here is a simplified version of the code that shows the problem.

Any help would be greatly appreciated.

This is a plot from the article, showing the effect I can't reproduce.

EDIT/UPDATE: Also tried for different reference correlation/least squares window sizes, as represented on the code. Essentially, I considered both the case where I also compare the signal with the surrounding data of the time window under analysis, and for the case where I ignore that data.

My reasoning is that a time delay in a continuous signal will bring uncorrelated samples into the signal. If I consider the surrounding window the number of uncorrelated samples will be constant, and not dependant on the delay (as long as my delayed window is still contained within the larger reference window.). This makes least squares more intuitive, also, since I always divide by the same number of points.
Either way, I get the same result.


texts: I'm interested in the state-of-the-art of vocal sound synthesis. Please advise me

texts:
Some of the things I'd like to accomplish:

Strip the vocals from a recorded song as best as possible
Recreate someone's song voice (like a famous artists') using someone else's voice as input
Adjust parameters of the algorithm to slightly modify the output voice

What math, algorithms, research is out there?  Or is the above impossible?


texts: FFT of two sets of samples vs FFT of sum of samples

texts: If I have two sets of samples $a$ and $b$ and I have already calculated $A = FFT(a)$ and $B = FFT(b)$ is it possible to calculate $FFT(a + b)$ without performing another FFT?


texts: Extracting narrow-band ZigBee signals(4 MHz) from a wide-band WiFi signal(20 MHz)?

texts:
I am planning the following.

First sample the 20 MHz WiFi channel (WiFi channel-1 in figure).

Put band pass filters (5 MHz wide) around each of the ZigBee center frequencies (11, 12, 13, 14).

Re-sample the chunks to 4 MHz.

Is there anything wrong with this approach ?


texts: Do we use closed loop or open loop information in Bode plot, Nyquist plot and Root Locus?

texts: When analyzing a control system via Bode, Nyquist and Root-Locus, are we using open or closed loop information? I'm not able to understand when the poles of the open loop are used and when the one of the closed loop are. I think that what interests us is the information about closed loop, as that determines whether the final system is stable or not, but I'm pretty confused with this issue.


texts: How Does a Convolution Can Be Expressed as a Matrix Multiplication (Matrix Form)?

texts:
I know this question may not be very relevant to programming, but if I don't understand the theory behind image processing I'll never be able to implement something in practice.

If I got it right Gaussian filters are convolved with an image for noise reduction since they compute a weighed average of a pixel's neighborhood and they are very useful in edge-detection, since you can apply a blur and derive the image at the same time by simply convolving with the derivative of a Gaussian function.

But can anyone explain me, or give me some references on how are they computed?

E.g. Canny's edge detector talks about a 5x5 Gaussian filter, but how did they get those particular numbers? And how did they go from a continuous convolution to a Matrix multiplication?


texts: Magnitude-squared Coherence calculation inconsistence

texts:
I have to calculate the magnitude-squared coherence (MSC) between two signal. However, using a routine that uses only one taper (or no tapers at all) my result is always 1, despite the signals are clearly different. This doesn't happen if I use more than one taper. Searching a explication for this abnormal result, I come with a confusing characteristic of the MSC itself. The definition that I'm using is this

$$\gamma^2(\omega)=\frac{ |X(\omega)\overline{Y(\omega)}| ^2}{(X(\omega)\overline{X(\omega)}).(Y(\omega)\overline{Y(\omega)}) }$$

X and Y are the Fourier tranformed signals that depends on the frequency $\omega$. However, if you take any two complex numbers as the value of these functions in some fixed frequency, the result is always 1. Knowing that $|z|^2=z\overline{z} $ then

$$\gamma^2=\frac{(X\overline{Y})\overline{(X\overline{Y})} }{X\overline{X}Y\overline{Y}}=\frac{(X\overline{Y})(\overline{X}Y) }{X\overline{X}Y\overline{Y}}=\frac{X\overline{X}Y\overline{Y} }{X\overline{X}Y\overline{Y}}=1$$

Certainly there must be something I must be misunderstanding but I can't see what it is. Can anyone explain to me what is the catch?

Edit: I'm gonna use some matlab links as trustable sources.
Definition of MS-coherence

http://www.mathworks.com/help/signal/ref/mscohere.html

definition of cross power spectral density

http://www.mathworks.com/help/signal/ref/cpsd.html

(the power spectral density is the " auto -cross" spectral density, i.e. the Fourier transform of the autocorrelation)
A important property of the Fourier transform of the cross correlation can be found on wikipedia under "properties".

Another source can be found googling under the name "Coherence function in biomedical signal processing". Sorry i didn't post the direct links here, I don't have enough "reputation"


texts: Removing known audio signal from unknown stream

texts:
I am looking for a way to remove a known signal, A, of fixed length, from an unknown audio stream, B, when signal A can be mixed into signal B at any point in time. I may be mistaking but converting signal A to the frequency domain and performing an STFT where the window is approximately the size of the data buffer of signal B then subtracting these wouldn't work because the amount of signal A that may be contained in signal B is unknown.

Simply, i want to do live noise removal, when the noise is known. What are some methods of approaching this?


texts:
This is less a specific question, and more... "what is this called" and "where can I read more about it"?

Several times in my career, I've had to work with datasets with "discrete events". Lets say customers passing an infrared sensor at a store front.

Normally, signal processing would be concerned with a continuous time signal, like the voltage on the IR receiver... but my question pertains to the event of someone walking through the door. The "signal" (in this case) is more a list of times when someone walked through the gate.

For example:

# Unix Timestamps
entry_times = [1490648032, 1490648102, 1490648591, ..., ...]

The "crude" way to treat this signal is to bin the entry times to hours of the day and interpolate that dataset for a rough idea of customers vs time. However, I think that there's more to this problem.

Entry and exit are the same type of signal, but could DSP help differentiate? (I think not, but I don't know!)
Perhaps we want to count a mother and her two children as a single "customer". Assuming we get three events in a five second window, can we somehow group that together?

If we count the number of entries and exit per hour, this gets us a rough graph of customer throughput, and we can interpolate that to get more resolution... but how could we create that on the fly?

What is the name of this type of signal? Are there any signal processing algorithms or techniques that would help answer my questions?


texts: Stopping Viola Jones Face Detection early

texts: I want to try to improve an image processing technique for finding faces in images. I want to stop the Viola Jones face detector before it finds all faces, and do histogram equalization and other techniques on "candidate" faces. For example, say we have an image with one face. I would like to cut off facial detection before it has determined there is only one face, i.e. where there might be 3 prospective faces and Viola Jones has not yet taken out those regions which are not actually faces. Is this possible, and if so how do I do it?


texts:
Let's say I have two images that are parts of the same bigger image, cut using two masks (for simplicity, let's assume that the masks are just rectangles of the same size). The images are presumed to overlap. The concrete examples are: image stabilization (two different views of the same background) and object tracking (matching the object on two images).

I've read this excellent article http://werner.yellowcouch.org/Papers/subimg/, but it deals with finding the displacement of a small image which is a part of a large one, while I want to find displacement between the images of the same size. My images intersect, but don't contain each other.

I want to find the coefficients of the translation transform which correctly overlaps the matching parts of the images.
I want to use something like FFT-based correlation matching. I have the following problems with simply using FFT-correlation:

The edges of the image frames are strong features. If the algorithm searches the displacement $[dx, dy]$ that maximizes something like $\sum_{x,y}{a[x, y]}b[x + dx, y + dy]$, it would just snap the images so that their frames match, disregarding the content. I heard about windowing, but I don't understand how to apply it here. If each image is tapered at the edges, the images would no longer match when positioned correctly.
If we use a correlation function that normalizes the result by dividing it by the area of intersection resulting from the displaced matching, the algorithm would just try to keep the intersection to a minimum (~1x1 pixel; the smaller the intersection area is, the easier it is to find a nearly perfect match.)

How to solve this matching problem using windowing or some other techniques?

Update: I know that the problem can be partially eliminated by discarding the low-frequency information (taking gradient or applying the Sobel operator). I'm trying to solve the problem without discarding the low frequency information.
Also, leaving only high-frequency features still doesn't solve the outlined problem: Imagine an image with a bright thin horizontal beam and a bleak square. These features are high-frequency and thus will remain after the filter is applied. Cross-correlation will than match the bright beam parts ignoring the square.

Here is the example which shows the matching problem:

Full image with frame borders:

Frames 1 and 2:

Correlation-based incorrect frame matching:


texts: Removing feature matched outliers within same image using RANSAC

texts:
I'm a student working on a copy move forgery detection algorithm.
I have a forged image. By far I have,

Found keypoints and descriptors from the image
Matched the descriptors using 3 Nearest Neighbours algorithm and Lowe's Ratio technique.
But there are still some outliers as shown in this image :

I have found out about the RANSAC algorithm. But in all the tutorials I see for opencv-python and skimage  , it is applied for 2 different images. I want to apply the RANSAC algorithm in the same image. I don't understand how to do so. Please guide me.
Thanks for all your inputs.


texts: How to estimate taps required for Parks-McClellan filters

texts: I have some code based on Jake Janovetz's Parks-McClellan (Remez) filter generating code. How can I estimate the number of taps required to build a lowpass filter given requirements for pass band ripple and stop band attenuation? I already know how to convert from these requirements back to the filter error deviation.


texts: When to use raw signal strength, vs. when to filter first

texts:
I am collecting I/Q samples from an RTL SDR dongle.

I notice the rtl_power utility provided for Linux filters and does other processing, before reporting signal strength.

I just want to keep track of how strong a frequency range is (eg. a 25k bin, as passed to rtl_power).

Can I just square the I and Q and add them, or do I need to do the filtering and other processing that rtl_power does, first?  What's appropriate in what situations?


texts: How to remove the bump from the signal using filters?

texts: I want to have only the slope of the signal. How can I do? I have tried to apply some filters but so far I have not been able to hit the nail on the head. I use Matlab.


texts:
I have implemented a 2D->3D point triangulation method, which uses 2 poses P1 and P2 and 2 points back-projected to z=1 point1 and point2 to recover depth:

Matx14d A1 = point1(0) * P1.row(2) - P1.row(0),
        A2 = point1(1) * P1.row(2) - P1.row(1),
        A3 = point2(0) * P2.row(2) - P2.row(0),
        A4 = point2(1) * P2.row(2) - P2.row(1);
double normA1 = norm(A1), normA2 = norm(A2), normA3 = norm(A3), normA4 = norm(A4);
Matx44d A(A1(0)/normA1, A1(1)/normA1, A1(2)/normA1, A1(3)/normA1,
          A2(0)/normA2, A2(1)/normA2, A2(2)/normA2, A2(3)/normA2,
          A3(0)/normA3, A3(1)/normA3, A3(2)/normA3, A3(3)/normA3,
          A4(0)/normA4, A4(1)/normA4, A4(2)/normA4, A4(3)/normA4);

SVD svd(A, SVD::MODIFY_A);
Mat_<double> svdVT = svd.vt;
Mat smallest = svdVT.row(3);
double scale = smallest.at<double>(0,3);

if (scale == 0.0)
    scale = 0.00001;

Point3d point3D(smallest.at<double>(0,0)/scale, smallest.at<double>(0,1)/scale, smallest.at<double>(0,2)/scale);

This is based on the book Multiple View Geometry in Computer Vision.
However, this doesn't seem to provide the right results visually and in fact, when I calculate the difference between the projected 3D point and the original image point  coordinates, there is an error of >100px.

What is the problem? Even with synthetic values and transformations I can't get a good enough triangulation.


texts: frequency folding due to aliasing in FFT

texts:
I am having problem understanding why negative frequencies are showing up to the right of positive frequencies in discrete complex FFT.

I am not sure how to apply aliasing concept to explain such phenomenon even after reading about modulo-2pi angular frequency concept at MIT OCW signal processing course.

Anyone ?


texts: Calculating impulse response from transfer function

texts:
Given the difference equation as []=5[]+5[−2] and []=cos().
I would like to obtain the transfer function h[n]. How is that possible manually and on Matlab?

Manually it should be very easy yet I am stuck with a trivial part.
I considered H(z) = Y(z)/X(z) then I preform z-inverse. The issue is that I am stuck with Y(z) expression in my H(z) is that okay?

On Matlab I have done the following code:

syms n x(n) y(n)
x(n) = cos(pi*n);
y(n)=5*x(n) + 5*y(n-2);

H = ztrans(y)/ztrans(x);
h = iztrans(H);

Which result in a very lengthy outcome which made me doubt whether it's correct or not.

EDIT: the range given is 0:n:20

What am I doing wrong and how can I get to the answer


texts: how to detect two parallel lines in a binary image with MATLAB

texts:
I am working on license plate detection using hough transform. I am trying to detect the horizontal and vertical edges and then to find the parallel lines.

My code:

img = rgb2gray(img);

img = medfilt2(img);

v = edge(img,'sobel','vertical');
v = bwlabel(v);
stats = regionprops(v, 'Area','BoundingBox','Image');
ids = find([stats.Area] > 30 & [stats.Area] < 2000);
v = ismember(v,ids);

Output:

Now I want to detect the parallel lines. I have consulted different examples on Mathworks but unfortunately I couldn't get much of it. Someone please guide me how to detect two almost straight and parallel lines in a binary image?


texts:
I want to compare throughput under different MCS( modulation and coding scheme).

We know Shannon capacity $C = B \log(1+SNR)$ can be used to calculate throughput by SNR. However, there is no MCS parameter in this formula.

I want to calculate throughput using following formula:

$${\rm throughput} = B \cdot ( {\rm code rate} ) \cdot \log(M)  \cdot  (1-P(r \cdot G(r))).$$

where $B$ is bandwidth,
$M$ is constellation size,
$P()$ is bit error rate function,
$G()$ is coding gain function,
$r$ is SNR,

For example, 64QAM code rate 0.5 throughput will be $B \cdot 0.5 \cdot 6 \cdot (1-P(r \cdot G(r)))$.
However, it seems that no mathematical formula to calculate coding gain for turbo code.

I want to find a rough coding gain formula to compare different MCS performance.

Is there any formula for coding gain of Turbo code?

Or if there exist general formula to map MCS to bit error rate without considering which code is use?

any idea/reference will be great help on this regard. Thanks.


texts:
I have an image that has pixelated circles in it (a cross section of wires). I want to identify the wires, their location and count them.

The circles never overlap and the wires are all within a 95% radius. However the spacing might not be exact as there can be gaps between the wires.

What is a good way to find the geometric mean of the group of pixels that represent a wire?

The above picture is what I would like to do, to fit a circle to a group of pixels (which I did using paint). I would think that the first step is to find the geometric mean of the group.

I did try using a tophat kernel and threshold to emphasize the centers, but I end up with a few pixels and no center pixel. I need to identify the center and end up with only one pixel which is difficult to do with thresholding since the pixel values differ in brightness.

Raw picture:


texts: Main differences to take into account between continuous and discrete time signals

texts:
I started studying DSP and the first things that came out were the differences between continuous and discrete time signals. So, I was wondering if I understood well these concepts before I keep going into more difficult topics.

The first thing I realized is that discrete-time signals replace the continuous parameter $t$ (time) for $n$ (sample) where $n$ is always an integer, leading this to two main differences:

Complex exponential sequences $Ae^{j\omega n}$ with frequencies $\omega + 2\pi k$ where $k$ is an integer are indistinguishable from one another since $e^{j2\pi n} = 1$  always. This is not true for continuous time signals since
 $e^{j2\pi t}$ can possibly be different from $1$.

Concerning periodicity, in the discrete time case, the fundamental period $N$ is always an integer equal to $\frac{k}{F}$ where $k$ is an integer, meaning that $N$ is not necessarily equal to $\frac{1}{F}$.

In the continuous case, this is not true since $T = \frac{1}{F}$.

So, my questions are:

Am I correct about this two differences? If this is not the case, please
explain it to me better.
Are these two the more important to take into account, or am I
missing something (else) big?