texts: Convolution of an Image with a Kernel That Is a Product of Two Functions

texts:
Suppose that $G(i,j)$ is a Gaussian decay function on the distance between points $i$ and $j$ of an image. In addition, $D(i,j)$ is the difference between the VALUES of the image at those points.
Now, at every point $i$ of an image I need to compute the summation of the neighboring $G(i,j) D(i,j) $ , this is, the product of both functions. This is a convolution-like operation: for every point I add the contributions of a function at every neighboring point.
However, I do not know if that can be expressed as a convolution because G and D are functions on different variables: the distance (a raw gaussian filter) and the image intensity difference.
I need help at expressing the summation as a combination of convolution operations in order to easily code it in a program without the need for loops. In addition, it would allow me to possibly do it in the frequency domain.
Any help will be appreciated!


texts: Why in MuSiC (DoA) don't we search for minima of the inverse (pseudo)spectrum?

texts:
I have started working on a Direction-of-Arrival estimation problem and I am testing various algorithms. I came across Multiple Signal Classification (MuSiC) method. In all textbooks I have looked at, the final step of the method is to search for maximums in the pseudo-spectrum given by
$$ P \left(\theta \right) = \frac{1}{a^{H}\left(\theta\right) V_{n} V_{n}^{H} a\left(\theta\right)}$$
where $P\left(\theta\right)$ is the spatial pseudo-spectrum, $a\left(\theta\right)$ is the array manifold of the array under consideration, $[ \cdot]^{H}$ denotes Hermitian transposition and $V_{n}$ is the matrix whose columns form the noise subspace (the noise eigenvectors).
Now, my question is, why should we look for maxima in $P\left(\theta\right)$ an not for minima in $\frac{1}{P\left(\theta\right)}$? Is there something I am missing here? I believe that the implementation of the algorithm could potentially benefit from avoiding this division.
Any insights and/or hints are most welcome. Thanks in advance.


texts:
I need to zero-pad the image for a better reconstruction but according to my project details, I will be given a Fourier-transformed image so can someone tell me how to pad the image in such a situation.
I tried padding the Fourier transformed image and then took a Fourier transform of that padded array and then replaced the image part with the original Fourier transform. Pardon me if that doesn't make sense. But my solution definitely did not work.
What to do?


texts: Fourier transform of Autocorrelation function, what am I missing here? (Power spectrum)

texts:
Given this problem

I know that the autcorrelation and power spectrum are fourier pairs, so when taking taking fourier transform of Rxx, one should end up with Sxx

However, when I take the transform of $R_{xx}(m)$, I end up with $S_{xx}(\omega)=\frac{2\alpha }{\alpha ^{2} + \omega ^{2}}$, which also matches up with fourier transform pairs in the book. Here's by hand:

$S_{xx}(\omega )= \int_{-\infty}^{\infty} R_{xx}(m)e^{-i\omega m} dm=\widehat{R}_{xx}(\omega)$

$=\int_{-\infty}^{\infty} R_{xx}(m)e^{-i\omega m} dm=\int_{-\infty}^{\infty} e^{-\alpha |m|}e^{-i\omega m} dm=$
$=\int_{-\infty}^{0} e^{\alpha m}e^{-i\omega m} dm + \int_{0}^{\infty} e^{-\alpha m}e^{-i\omega m} dm=$

$ =\int_{-\infty}^{0} e^{m(\alpha -i\omega)} dm + \int_{0}^{\infty} e^{-m(\alpha +i\omega )} dm=$

$=\frac{1}{(\alpha -i\omega)} - \frac{0}{(\alpha -i\omega)}+\frac{0}{(\alpha +i\omega)}-\frac{1}{(\alpha +i\omega)}$

$=\frac{1}{(\alpha -i\omega)}+\frac{1}{(\alpha +i\omega)}=\frac{\alpha +i\omega+\alpha -i\omega}{(\alpha -i\omega)(\alpha +i\omega)}=\frac{2\alpha}{\alpha^{2} +\omega^{2}} $

Which doesn't look like equation given in the problem, unless I'm missing some identities or something here.

Also, as for problem h), that should be pretty straight forward. Avg. power of $X=R_{xx}(0)$ right?


texts: Output of a system given it's transfer function and input (beginner)

texts:
I have an exercise that gives me the transfer function of a system

$$H(s) = \frac{3s^2+27}{s^4+8s^3 + 16s^2} $$

and an input

$$x(t) = \frac13 cos(3t) $$

An ask's what is the output

I don't whant the answer but the steps to calculate it.

Where to start? I need to find the inverse or there's a shorcut?


texts: A Music Recommender System by Using Basis Functions and Inter Correlations

texts:
So my university project is about music recommender system.
My teacher not saying too much. But he only said it will use basis functions and convolution technique.

I want some ideas about this project about how to create this.
I have programmed in MATLAB and know basics of DSP like DFT (FFT), Correlation, Convolution etc.

Any idea from experts?

I would like to inform that this music recommendation system will be content based and it will use correlation technique to find music similarity with basis signal.


texts: How to demodulate an AFSK signal in software

texts:
I am trying to transmit binary data from one device to another over an audio channel (speaker/mic). I use AFSK (Audio Frequency Shift Keying) as in Packet Radio, with $1200 \text{ Baud}$ and two frequencies $f_{mark} = 1200 \text{ Hz}$ and $f_{space} = 2200 \text{ Hz}$. I played around a bit in Ruby and my first implementation simply imitates a classic incoherent demodulator, which works fine, so far.

The problem is, i am trying to port this to a mobile platform where performance is a concern and my current solution is too slow. I have found numerous ways to demodulate AFSK in software:

Sliding DFT (FFT)
Sliding Görtzel Filter
Phase Locked Loop
Zero Crossing

What would be the way to go? There are just too many options to choose from. I am sure there are even more options available. Perhaps there exist even better solutions than the ones i named above? Does someone even have a code examples for me? I am concerned with

Performance (should run on mobile Platform, say an iOS or Android device)
Stability (should be able to handle some noise)

Any suggestions and hints are greatly appreciated!


texts: How to group similar patterns together that are shifted along the x axis?

texts:
I have a set of time series plots that are shifted along the x-axis. I am looking for an algorithm using which I can group them together. My end goal is to average them.

While reviewing the literature on this topic, I found out that Fourier Transforms might help. Since all the patterns have a similar shape, I might be able to detect initial changes in frequency for each pattern and then group them all together. I was hoping that someone could elaborate on whether my approach is correct. I am also open to other approaches that could tackle this problem.


texts:
How do I should sample two continuous sinusoids of $f_1$=1/4 Hz and $f_2$=1/2 Hz at a 1 Hz rate?

Can i recover both if i bandlimit after sampling at a 1/2 Hz limit?


texts: Wavelet transform of a spatial convolution

texts:
Does anyone know if there exist a kind of convolution theorem for the discrete wavelet transform (decimated or undecimated)?

In other words can I find a simple form of
$W\left[ \int f(t) g(x-t) \, dt\right] $ where $W$ is the discrete wavelet transform operator?


texts: Why is beginning of this FIR filtered signal attenuated?

texts:
I apply an FIR filter passing the band around 50/1000 and attenuating the other three frequency components 30/1000, 70/1000 and 110/1000.

Both filters are generated using the Remez algorithm. The first filter is of length 300 and the second is of length 100.

Why is the beginning of the filtered signal attenuated and why is this attenuation effect stronger for a longer filter?

library(signal)
par(mfrow=c(3,2))

ch <-
  sin(2*pi*1:1000/floor(1000/30)) +
  sin(2*pi*1:1000/floor(1000/50)) +
  sin(2*pi*1:1000/floor(1000/70)) +
  sin(2*pi*1:1000/floor(1000/110))

# FFT of signal
barplot(abs(fft(ch)[1:120]))

# unfiltered signal
plot(ch,type="l")

filter <- function(c0,d1,d2,n) {
  fir <- remez(n=n,f=c(0,c0-d2,c0-d1,c0+d1,c0+d2,1),a=c(0,0,1,1,0,0))

  freq <- freqz(fir,n=n)
  y <- signal::filter(as.vector(fir), 1, x=ch)

  # frequency response of filter
  barplot(abs(fft(y))[1:120])
  return(list(freq = freq, fir = fir, y = y))
}

f <- filter(2*50/1000,1/80,1/40,n=300)

# first filtered signal
plot(f$y, type="l")

f <- filter(2*50/1000,1/80,1/40,n=100)

# second filtered signal
plot(f$y, type="l")


texts:
I've been working on a project for some time, to detect and track vehicles in video captured from UAV's, currently I am using an SVM trained on bag-of-feature representations of local features extracted from vehicle and background images. I am then using a sliding window detection approach to try and localise vehicles in the images, which I would then like to track. The problem is that this approach is far to slow and my detector isn't as reliable as I would like so Im getting quite a few false positives.

So I have been considering attempting to segment the cars from the background to find the approximate position so to reduce the search space before applying my classifier, but I am not sure how to go about this, and was hoping someone could help?

Additionally, I have been reading about motion segmentation with layers, using optical flow to segment the frame by flow model, does anyone have any experience with this method, if so could you offer some input to as whether you think this method would be applicable for my problem.

UPDATE: I posted this question on stack overflow as well, and had an excellent answer, I've implemented this idea already and it is working surprising well and im now investigating using optical flow in addition to this technique.

Below is two frames from a sample video

frame 0:

frame 5:


texts:
After performing the fft transform there are 2 options to plot the spectrum

the complex (Real and imaginair) spectrum and the magnitude with the phase.
(I neglect the magnitude only for this question)
My question is why is the spectrum of magnitude with phase always single sided.
and why is the complex spectrum always double sided.

second questsion is
make it sense to create a double sided magnitude phase plot or an single sided complex plot?


texts: No. of Cyclic prefix for 5G NR signal with 100Mhz bandwidth different subcarrier spacing?

texts: I want to generate a 100Mhz bandwidth 5G NR signal with different subcarrier spacing(15,30,60,120Khz) in matlab. What is the no. of CP to be added for 1st OFDM symbol and the other symbols and also which subcarrier spacing should I use to get bandwidth of 100Mhz. Is the sampling freq 153.6Mhz fixed for 5G NR signal?


texts: Dealing with echoes / dead-spots in digital transmissions

texts:
I'm looking at communicating digital data through the air as soundwaves.

To illustrate the problem, I generate a 10-cycle 2kHz wave, play it out through my MacBook's speakers and pick it up on my iPod Touch:

The echoes are about half the amplitude of the probing signal.

HotPaw pointed out to me in a comment on a recent question that there is a potential problem with dead-spots: regions of destructive interference.

If I use a particular carrier frequency, transmitting from one point in the room to another, there will be certain locations where acoustic cancellation / destructive interference occurs, resulting in a dead spot.

Surely other technologies such as Wi-Fi must encounter the same difficulties. How do engineers deal with this phenomenon?

The only solution I can think of is to simultaneously use say three different carriers, and have the listener select the strongest.

PS severely hampered on the tags: data transmission, communication, radio, information transfer, echo, Radio, rf, signal, bleh


texts:
$$x(t) = \cos(2 \pi t) \cdot u(t)$$
$$y(t) = x(t) + x(-t)$$Is $y(t)$ periodic. If so, what is the $T$?
$$x(t) = \sin(2 \pi t) \cdot u(t)$$
$$y(t)= x(t) + x(-t)$$
Is $y(t)$ periodic?


texts: How to do prediction using frequency domain data?

texts:
Both linear regression and Kalman filtering can be used to estimate and then predict from a time domain sequence of data (given some assumptions about the model behind the data).

What methods, if any, might be applicable to do prediction using frequency domain data?  (e.g. predict a future step, using the output from suitable FFT(s) of previous data, without just going back to the time domain for the estimation.)

What assumptions about the data, or the model behind the data, might be required for what, if any, quality or optimality of prediction in the frequency domain?  (But assume it is not apriori known whether the data source is strictly periodic in the FFT aperture width.)


texts: what is the periodicity of $e^{j\omega n}$ when $\omega=0$? I think it is $N=1$. But signals and systems book by Oppenheim and Willsky page no.28, mentions it as undefined.  I can understand this for continuous time signals but for discrete time case, I think unconditionally it is $N=1$ because $x(n) = 1$ and so $x(n) = x(n+1)$ for all $n$. What do you think?


texts: I would like to convert FFT data which is set of 396 values for 396 frequencies (from 4Hz to 399Hz by 1Hz) in unit of g's (gravitational akcceleration) to PSD in unit of (g^2)/Hz, is it possible? Thank you for your help.


texts:
Dear signal processing enthusiasts:

I am forced to cut off a part of a multi-frequency signal, creating a "gap" as shown in the figure. (only one frequency to simplify illustration).
If I inject part A of the signal into a FIR which has linear phase vs frequency, and set the FIR to have a group_delay proportional to the gap length, the output's phase doesn't change, and hence the stitched signal has a phase jump.
I am looking for a filter that would let part A propagate through, to the point where its phase matches part B's phase. Does such a filter exist?

The question in different words:
how can i phase-shift a multi-frequency discrete signal in time-domain? The phase shift should be linear with frequency.
Here is my chain of thoughts:

I imagine that, if I inject a sin wave into a transmission-line, its phase when it exits will depend on the length of that transmission-line. If i want a different phase value, I would adjust the transmission-line length.
If the signal has multiple frequencies, each frequency component will then have a different phase shift in a linear manner.
If I were to do this in frequency domain, I would multiply the spectrum with a phase shift as in: exp(j.w.t_delay), where w is the frequency axis and t_delay would be the time delay value as to simulate the transmission-line's length.
I am however unable to do it in frequency-domain because I am only able to observe the signal  for a limited amount of time = limited number of samples = worst resolution for the frequency axis w. (frequency resolution = 1/observation_time).
Any phase correction will only work for the signal frequencies which are on the w "grid", and not any off-grid ones.
I therefore started thinking of how can one do such a thing in time-domain? wouldn't such a system or filter have both characteristics of liner phase vs frequency and linear phase vs time? Does such a filter/system exist?


texts:
I am quite new in this field and trying to learn Kalman-Filter but i am quite lost how to start my task.

This is the file description
Problem. I guess the state vector x must be the poistion of light towers? so a 6D- Kalman-Filter? And after finding it, how do I proceed it?


texts:
I am newbie to $\mathcal Z$-transform, I searched to find the magnitude of a function in $z$-domain, but I couldn't find anything, for example when we have
$$
H(z) = \frac{z-3}{z-0.5}
$$
How do you compute $\lvert H(z)\rvert^2$? I know that $\lvert H(z)\rvert^2 = H(z)\cdot H\left(z^{-1}\right)$, is it right? when I calculate it for my example:
$$
H(z)\cdot H\left(z^{-1}\right) = \frac{z-3}{z-0.5}\cdot\frac{z^{-1}-3}{z^{-1}-0.5} = \frac{10-3z-3z^{-1}}{1.25-0.5z-0.5z^{-1}}
$$
but it is not a numerical value like Fourier domain.


texts: Help Understanding Time of Flight Phase Sanitization Algorithm

texts:
I'm implementing the technique found in this paper: http://front.sjtu.edu.cn/~jinyh/gradCourse/Paper/Wireless/SpotFi%20Decimeter%20Level%20Localization%20Using%20WiFi.pdf

to perform localization.

I've implemented 95% of the technique, but this one short algorithm is giving me problems.

The explanation in pseudocode is very simple but the results I'm obtaining are wildly different than reported in the paper, and I don't think this is just a case of misreporting results.

Notice that to minimize the function in step 1, rho will always go to 0! Which is clearly not right.

An example of this algorithm being applied in the paper is given here, with the first figure being the unwrapped phase prior to running Algorithm 1 and the second one being the resulting phase.

I can share my code so far for Algorithm 1 but I really think that I'm just missing something pretty essential in the description....


texts:
What are my options for Open Sourced Image Processing functionality on a Raspberry Pi?

So, I am referring to the old-school processing, using operators like open/close/erosion/dilation/threshold/convolution etc.

I am not looking for neural network based processing.

Bonus points if it has a Python interface, but C will work as well.

In the 1990s, in University I was using Scil Image for this stuff, and I wonder what the modern equivalent for it is?


texts: How is sampling rate affect the Doppler spectrum? Textbook attached

texts:
I am studying FWGN model, in the textbook "MIMO-OFDM wireless communication with MATLAB", it says "When oversampled by a factor of $N_OS$, the bandwidth of Doppler spectrum becomes \begin{equation}BD = 2N_{0S}f_m\end{equation} as shown in Figure 2.8(b)"
My question is why the Doppler spectrum becomes \begin{equation}BD = 2N_{0S}f_m\end{equation} , if we oversample it by the factor of Nos.


texts: Energy Spectrum of a signal after FFT in Matlab

texts:
I have a vector of signal x(t) with its time vector. I want to obtain a frequency representation of the signal, in particular the energy spectrum of x(t).

Can someone please show some light into obtaining the energy spectrum ?
Is energy spectrum and energy spectral density ,ESD produce the same result ?

Any help is much appreciated !

 t = 0:.001:.25;
x = 5*sin(2*pi*50*t) + 1.2*sin(2*pi*120*t);
y = x + 2*randn(size(t));
y=y';
Fs = 1000; % Sampling frequency

% Fast Fourier Transform
    L = length (y); % Window Length of FFT
    nfft = 2^nextpow2(L); % Transform length , Next power of 2 from length of signal
                          %  Exactly same as nfft = pow2(nextpow2(L))

% Take fft, padding with zeros so that length(input) is equal to nfft
    Ydft = fft(y,nfft)/L;

    y_HamWnd = y.*hamming(L);           %hamming window fft
    Ydft_HamWnd = fft(y_HamWnd,nfft)/L;

%FFT is symmetric, throw away second half

    % Take the magnitude of fft of x
%Amplitude Spectrum 01 (Single Sided)
mY = 2*abs(Ydft(1:nfft/2+1)) ;

%Amplitude Spectrum 02 (Single Sided HamWmd)
mY_HamWnd = 2*abs(Ydft_HamWnd(1:nfft/2+1));

%Amplitude Spectrum 03 (Single Sided; Exclude DC-- FoldingFreq)
mY2 = abs(Ydft);
mY2= mY2(1:nfft/2+1);
mY2 (2:end-1) = 2* mY2 (2:end-1);

    %To get the Power
% P ; single sided; then coefficient square**********Multiply by 2 ?
YdftCoeffi_Sqr = Ydft(1:nfft/2+1).^2;

% P = y*(conj y) == y^2  ;     %********DO WE NEED TO MUL 2 ?
Pyy_NormNfft = Ydft.*conj(Ydft);

% P ; single sided; First square, then Multiply by 2
m1YL = abs(Ydft(1:nfft/2+1));
mSqrYL = m1YL.^2;
m2YL = mSqrYL*2;

% Frequency vector
f1 = Fs /2 * linspace(0,1, nfft/2 + 1);
f2 = (0:nfft-1)*(Fs/nfft);

% Generate the plot, title and labels.

figure;
plot(t,y); title('Time Domain'); xlabel('Time(s)');

figure;
subplot(3,1,1)
plot(f1,mY)
title('Amp Spec 01 --mY = 2*abs(Ydft(1:nfft/2+1)) /L; '); xlabel('Frequency (Hz)'); ylabel('|mY|')
        %axis ([0 500 0 5]); %Zoom in
subplot(3,1,2)
plot(f1,mY_HamWnd)
title('Amp Spec 02 -- mYHamWnd =2*abs(YdftHamWnd(1:nfft/2+1))/L;'); xlabel('Frequency (Hz)'); ylabel('|mY_HamWnd|')
        %axis ([0 500 0 5]); %Zoom in
subplot(3,1,3)
plot(f1,mY2)
title('Amp Spec 03 DC-- FoldingFreq -- mY2 ;First, single sided; then square, lastly Multiply by 2'); xlabel('Frequency (Hz)'); ylabel('|mY2|')
        %axis ([0 500 0 5]); %Zoom in

figure;
subplot(3,1,1)
plot(f1,YdftCoeffi_Sqr);
title('Ydft Complex Coefficient Square; Single Sided-- YdftCoeffi_Sqr = Ydft(1:nfft/2+1).^2');  xlabel('Frequency (Hz)'); ylabel('YdftCoeffi_Sqr');
subplot(3,1,2)
plot(f1,m2YL);
title('Ydft Complex Coefficient Magnitude Square; Single sided; then Multiply by 2');
xlabel('Frequency (Hz)');
ylabel('Power m2YL');
        %axis ([0 500 0 5]); %Zoom in


texts: Fourier transform of Image to identify sinusoidal sources of interference

texts:
I'm a statistics grad student, and I just started getting into Digital-Image-Processing (an analogy for processing super-large contingency tables).  In the book "Digital Image Processing" by Gonzalez and Woods, I was reading chapter 2, page 94 of the third edition, and found the following image that is MAGIC to me...

They begin with a noisy image, identify some 'hot points' surrounding the center of the Fourier transform, then simply remove them, reverse the transform, and I can't help vocally demonstrate an emotional reaction while assessing that the image is now crystal clear.

Does anyone have any insight into this?  I'd like to know what are the underlying notions and methods used to filter this image.

Additionally, if any of the StackExchange users a familiar with this topic and can suggest some articles/books that I might read, I would be very grateful.


texts: Product of power signal and energy signal

texts:
I tend to believe that if we multiply an energy signal with a power signal the product is an energy signal.

My reasoning is that the energy signal will have finite bandwidth and consequenty the product will have finite bandwith and will be an energy signal.

Can anybody confirm that I am right? Or am I missing something?

Thanks in advance.


texts: How to choose the most appropriate color space for a computer vision application?

texts:
A lot of image processing techniques used in computer vision consist (among other things) in switching from RGB to another color space (HSV, YUV, LMS...) : color transfer, visual tracking... It seems that different people use different color spaces for the same application.

In the case of statistical color transfer for example, you can use LMS (which is a device-independent color space) or use YUV (a device-dependant color space) and achieve pretty much the same result. Moreover the transformation from RGB to either of these 2 color spaces is achievable by multiplying the RGB pixel by a 3x3 matrix.

Besides the device-dependence/independence factor, there's the decorrelation between the channels. The RGB channels are inter-correlated but so are LMS.

My questions are:

What are the characteristics to look for in a color space in order to be able to say whether it is appropriate or not to use it?
(If you think that the scope of my question is too broad, take the example of statistical color transfer from an image to another)
And why is the decorrelation between the channels of any color space that important?


texts: Preprocessing to improve Harris corner tracking between video frames?

texts:
In our unmanned aerial vehicle grayscale video image stabilization application, we're having difficulty finding the "good" Harris corners in frame N+1 selected from frame N. The source of the difficulty appears to be radical nonuniform pixel contrast changes between frames. Perhaps being airborne and using a slow frame rate (~3 fps) is the root cause of the pixel contrast shift.

We've tried various histogram equalization techniques to try to smooth out the pixel contrasts between frames in order to improve tracking "good" Harris corners in frame N+1. Results continue to be poor.

Does anyone have any suggestions on how to improve Harris corner tracking between video frames in a slow frame rate daytime aerial environment? Thank you kindly in advance.

Edit: 30 Jan 2012, added test case (not actual frame size) images

Summary Update: 8 Feb 2012. People suggest Harris corners are not so useful in grayscale video feature tracking. Answers below suggest and provide links to various alternatives. We are evaluating these alternatives and I will report results when we get to that point. Thank you, all, for your comments and answers.

Here's the previous frame N with 35 "good" 5x5 harris corners selected. The original frame is 8 bpp raw pixels.

Here's an excellent 5x5 Harris corner located at row 59 col 266:

The current frame N+1 with a few tracked 5x5 Harris corners, only one of which is valid:

The previous frame 5x5 Harris corner appearing in frame N+1 at r47 c145:

Note how the pixel intensities in the selected 5x5 have all changed in a nonuniform manner from the previous frame to the current frame. Contrast equalization techniques between frames do not help in detecting previous frame selected 5x5 pixels in the current frame. All suggestions welcome.


texts:
I was studying the description of continuous wavelet transform in Matlab and I came across this term
                           '**cwt uses 10 voices per octave**'

can anybody explain this 10 voices per octave to me.


texts: Block diagram for a complex impulse response

texts:
I have this question regarding digital systems which might not handle sinusoidal signals in general. So let us say that I have a system with impulse response $h(n) = \{1+j, -1, 2j \}$ with first element at index zero. Clearly this is a complex quantity. When I take the z transform,I get $$H(z) = (1+j) - z^{-1} +2jz^{-2}$$
That is $$\frac{Y(z)}{X(z)} = (1+j) - z^{-1} +2jz^{-2} \implies Y(z) = (1-z^{-1})X(z) +jX(z)[1+2z^{-2}]$$ In time domain we get $$y(n) = [x(n) - x(n-1)]+j[x(n) + 2x(n-2)]$$ So now I had to implement this as a block diagram. I will not be showing that because that is not required here. My doubt, however, is concerned with the imaginary term. What should we do with the imaginary term, this is my doubt. What I did is that I first created the signal $x(n)+2x(n-2)$ which is the imaginary part and then placed a $\frac{\pi}{2}$ phase shifter block in front of the total sum (just like a black box with a label on it). This is what we usually do in analytical signals, right. And a similar thing is done in placing in-phase and quadrature-phase components of a message signal on a carrier wave in tele-communications. I applied the same idea here. Now my professor says that this is wrong because in tele-communications we are usually dealing with sinusoidal signals, but here that might not be the case in general. What I think however is that I am still right. Even if we are in digital domain, why would it matter. A $j$ always shifts any signal by $\frac{\pi}{2}$ in phase. Am I really wrong? I do not want to prove my professor wrong but I didn't asked the reason and I am still not convinced. That is the only reason of posting this question online.


texts:
Can anyone give me an example of two signals with different temporal waveforms having the same Fourier transform (FT)?

Would the inverse Fourier transform still be able to recover correctly each signal?

Actually, I tried to check the question above, in matlab, using two chirp signals (same duration), the first one having a frequency increasing from 10 to 50 Hz as time increases and the other one having a frequency decreasing from 50 to 10 Hz as time increases.
The result was that the moduli of the FT were identical but not the phases (that were symmetric wrt frequency = 0) even with the addition of noise.

What surprised me is that the inverse FT was able to recover correctly both signals when I was expecting it to not be able to do it since we usually say that the FT makes it so that we lose the time localization.

I am aware that the time localization information is still contained in the phase part of the FT but if this is the case then what do we really need the time-frequency representations for? Is it just to easily extract this information since it's so hard doing it using the phase of the FT?

Any thoughts on that would be appreciated.


texts: Why do we need to normalize a WAV file before calculating the FFT?

texts:
I am trying to calculate the FFT of a signal stored in a WAV file using SciPy. I found a solution here, but it seems like we need to perform this step before the FFT:

b=[(ele/2**8.)*2-1 for ele in a] # this is 8-bit track, b is now normalized on [-1,1)

where the signal samples are stored in array a. Can someone explain the significance of this step?

Thanks.


texts: Deriving of magnitude, phase response and impulse response of transfer function

texts:
I have a transfer function as
$$H(z) = \frac{-0.0625z^4 + 0.25z^3 + 0.625z^2 + 0.25z - 0.0625}{z^4}$$
I want to derive magnitude and phase response of this equation.

can someone help me from here I am stuck.
Thanks


texts:
I need  a low cost DSP kit for learning purpose, along with development tools. One main requirement is to process a voice signal (8KHz sampling frequency), with a USB interface.

Any suggestions?

Update

A friend of mine suggested that I can use my PC sound card as a DSP- at least for learning basic DSP for sound and speech processing. I would like to know if some body has already experimented with it, and thus can give me some pointers.

To start with, basic experiments  I will be doing are:

1- Performing sampling of speech or music at different sampling frequency (so the quenstion is can I program the ADC/DAC of the sound card or not?), and play to see how it affects the sound quality

2- Some kind of frequency analysis, using FFT and DFT.

3- Then do some kind of filtering, and then observe the sound quality

4- Deliberately add noise

5- trying to put some phase distortion

6- Using the above to develop a voice recognition system

7- See performance of different type of filters (FIR, IIR)

My question is if I chose sound  card DSP, will I be able to perform the above tasks, are the software tools available for this purpose ?


texts: Parameter tracking using Augmented state vector approach and unscented Kalman filter

texts:
I'm trying to reproduce and extend figure 9 results in
Nonlinear dynamical system identification from uncertain and indirect measurements"HU Voss, J Timmer, J Kurths - International Journal of Bifurcation and Chaos, Vol. 14, No. 6 (2004) 1905-1933.
In this work, Voss et.al explains how to use unscented Kalaman filter for parameter estimation and parameter tracking. They have considered FitzHugh - Nagumo system for this calculation. FitzHugh - Nagumo system is given by following set of differential equations;
\begin{aligned}
\dot{x}_{1} &=c\left(x_{2}+x_{1}-\frac{x_{1}^{3}}{3}+z(t)\right) \\
\dot{x}_{2} &=-\frac{x_{1}-a+b x_{2}}{c}
\end{aligned}
The parameters are $a = 0:7, b = 0:8$, and $c = 3$.The variable $x_1$ is a membrane voltage which can be measured, and $x_2$ is a usually unobserved lumped variable that describes the combined effect of different kinds of ionic currents. The external voltage $z(t)$ influences the dynamics. Here we assume that $z(t)$ is varying slowly in comparison with the other two variables; it is treated here as the parameter to be tracked.
The measurements are constructed by corrupting the component $x_1$; $t$ with Gaussian noise $\eta =  N(0; R)$ at 800 equidistant $(t = 0:2)$ sample times. The standard deviation of $\eta$, $\sqrt{R}$, is 20% of the standard deviation of the $x_1$-component of the
system. The external variable $z(t)$ is constructed as a cosine-halfwave, up to an additive constant. The initial guesses of $z$ and $x_2$ are set to zero, the initial guess of $x_1$ is set to the measured value. For parameter tracking, the augmented state vector approach  is used with a constant covariance matrix $Q = 0:015$.
I need to track the parameter $a$ together with $z(t)$, but I don't understand how to change the  algorithm and unscented Kalaman filter equations according to this. Can someone please explain this? Thank you very much!


texts: Noise analysis with periodogram. problem with different resolutions

texts:
I don't understand what happened in my simulation.
I would like to perform a trade off between 2 ways to estimate power in frequency bands. I want to detect spurious frequencies.

First method:

  I constructed a vector of noise and computed the periodogram without
  windowing. As example, for a vector length of 1048576 and a FFT length
  of 1024, I have reduced the noise variance by a factor of
  $\sqrt{1024}$.

Second method:

  I constructed a vector of noise and computed the periodogram without
  windowing. As example, for a vector length of 1048576 and a FFT length
  of 262144, I have reduce the noise variance by a factor of
  $\sqrt{16}$.

Between these 2 methods I can perform a lower peak detection with the first one (equal to the noise power in a bin). But if my peak have a large power; $26 \mathtt{dB}$ greater than my noise, many FFT bins shall be affected as in the second. But the frequency separation of the second method is better.

I've tried a test mix of both methods. Add the 16 successive bins to reconstruct an equivalent periodogram of the first method.

For me, I've increased the noise variance because I've summed 16 "normal" ($\chi^2 $ in fact) law, but I've increased my spurious compare to the result of the first method.

In fact I've reduced my noise variance. It is the same as in the first method: $\sqrt{1024}$.

My first reaction is to think I have made a mistake to consider law as independent, but how can I verify that?

Someone can help me with any document reference or demonstration please?

Below an example in Scilab:

nfft  = 1024;
nbPts = 1024*nfft;
nfft2 = 16*nfft;

noise  =  (grand(1, nbPts, "nor", 0, 1) +%i * grand(1, nbPts, "nor", 0, 1))/sqrt(2);

myfft = zeros(1,nfft);
myfft2 = zeros(1,nfft2);

// perform 1st periodogram
for cnt=1:nbPts/nfft
    myfft = myfft + abs(fft(noise((cnt-1)*nfft+1:cnt*nfft))/nfft).^2;
end

myfft = 10*log10(myfft/(nbPts/nfft));

// perform 2nd periodogram
for cnt=1:nbPts/nfft2
    myfft2 = myfft2 + abs(fft(noise((cnt-1)*nfft2+1:cnt*nfft2))/nfft2).^2;
end

// sum it
fftsum = zeros(1,nfft);
for cnt=1:nfft,
    fftsum(cnt) = 10*log10(sum(myfft2((cnt-1)*nfft2/nfft+1:cnt*nfft2/nfft))/(nbPts/nfft2));

end

// visualization
figure(0)
set(gca(),"auto_clear","on")
plot(1:nfft,myfft)
set(gca(),"auto_clear","off")
plot(1:nfft,fftsum,'r')


texts: DFT (FFT) of Non Uniformly Sampled Signal

texts:
I am trying to perform an FFT of a non-uniformly sample signal. My input comes from Simulink and PLECS which uses variable-time solver.

So far, I have used resample function from Matlab to resample the values to a uniform sample rate and perform the FFT but with this set of values I cannot get it to work no matter what. I guess it's due to the nature of the signal which has a lot of jumps but I am not sure.

In this particular case I'd like to identify the component at 300Hz but for general purpose it can be any component. The code I tried is below if anyone wants to give it a try and help me. For comparison I also have the results from PLECS scope which indicates the 300Hz components

Link to raw data

Link to PLECS FFT data

clear all;
close all;
tab = csvread('data1.csv',1,0);
tout = tab(:,1);
in = tab(:,2);
fSamp = 1e6;
% Resampling
a(1) = (in(end)-in(1)) / (tout(end)-tout(1));
a(2) = in(1);
% detrend the signal
indetrend = in - polyval(a,tout);
[ydetrend,ty] = resample(indetrend,tout,fSamp,'linear');

out = ydetrend + polyval(a,ty);
% FFT
fr_des = 300;
amp = abs(fft(out))/length(out);
phs = unwrap(angle(fft(out)));
Fv = linspace(0, 1, fix(length(out)/2)+1)*fSamp/2;           % Frequency Vector
Iv = 1:length(Fv);                                      % Index Vector                                          % Desired Frequency
ampv = amp(Iv);                                         % Trim To Length Of ‘Fv’
phsv = phs(Iv);                                         % Trim To Length Of ‘Fv’
ap = [ampv(:) phsv(:)];                                 % Amplitude & Phase Matrix
ap_des = interp1(Fv(:), ap, fr_des, 'linear');
FFT = ap_des(1)*exp(1i*ap_des(2));


texts: Do DSP principles apply in the same way to both Audio and EM spectrums?

texts:
All  of my DSP experience is very much centred in the EM spectrum and I've only ever processed EM-type signals in the past.

I'm now doing quite a bit of work in ultrasound and the audio spectrum, but a lot of the techniques I'm using are used in the EM mainly. I'm reading a lot of EM papers about DSP at much higher frequencies. Can I expect that the principles behind these techniques will behave in the same way, even though the medium of transmission is different?


texts:
The PSNR definition provided by wikipedia is often quoted in discussions regarding PSNR and other similarity metrics.

Essentially the PSNR calculation has two components: the mean squared error and the "maximum possible pixel value of the image" (as per the wikipedia definition).

For arrays (or images) containing 8 bit integer values (e.g. .bmp images), the maximum possible pixel value of the image is 255, since this is the largest 8-bit integer possible.

For arrays (or images) with floating point values (e.g. some .tiff images) the wikipedia definition suggests "the maximum possible pixel value of the image" = 1. Why is this value of 1 chosen?

This would make sense for data that has been min/max normalised, such that the range of the data is 1. However generally, arrays containing floats would not be normalised.

Any insight into what is the generally accepted, correct value for "the maximum possible pixel value of the image" in calculating the PSNR would be appreciated.

Thanks,
David


texts: What is wrong with this GNURadio flow graph?

texts:
I am simply trying to modulate a wav file sampled at 22.05kHz, then demodulate it.  The audio output is choppy and I get errors in the console output ("volk warning, no arch found... though I've run the profiler.  And aUaUaU....).  I guess the issue is with matching sample rates but I've gone through the graph several times and haven't found it.
Also maybe this is related: after I add the bottom row of components (channel model and beyond) the constellation diagram for the transmit side changes to flat.  Meaning, instead of a circle, it's a line (second screenshot below).  What's going on?


texts: Find the length of the impulse response of a Linear Phase Type 4 FIR filter

texts:
The length should be found such that the group delay is minimum

It is given that the impulse response is real. One zero of the Transfer function is at $0.6e^{j\frac{\pi}{4}}$, and another one is at -2.

Since the impulse response is real (and the phase is linear), there must be three other zeros (from what I read): reciprocal, conjugate, and conjugate reciprocal of $0.6e^{j\frac{\pi}{4}}$

So I computed the transfer function using these five zeros, but the coefficients of powers of $z$ weren't symmetric at all (which is required for linear phase).

I must be missing something. Please help.


texts: What is anti-alias pre-filter for preventing aliasing after under-sampling?

texts:
We know that the under-sampling results in aliasing and frequencies higher than half of the Nyquist rate is not distinguishable. I've a base band signal that I want to use the higher frequencies which are higher than the half of the Nyquist rate (Nyquist frequency) as well as low frequencies(all parts). I've a special process with this path:

$$\textrm{Input}{\longrightarrow}\boxed{\textrm{anti-aliasing pre-filter}}{\longrightarrow}\boxed{\textrm{decimate}}{\longrightarrow}\boxed{\textrm{FFT}}{\longrightarrow}\boxed{\textrm{tune on special part}\\{\textrm{of the signal}}}$$

The low-pass post-filter that people usually use as anti-aliasing filter removes the high frequencies that are of interest for me.
What is the digital or analog anti-aliasing pre-filter that I don't lose high frequencies.


texts: Periodicity of the discrete-time Fourier Transform

texts:
The DTFT of a sequence $x[n]$ can be written as $$X(e^{j\omega}) = \sum_{n = -\infty}^{\infty} x[n] e^{-j\omega n}.$$
Is the smallest (fundamental) period in frequency of the DTFT always $2\pi$? Or can it be smaller than $2\pi$?

In addition, I was wondering why we cannot use that same notation for the argument with the CTFT. We typically denote the continuous-time Fourier Transform by $X(j\omega)$. But what's wrong with using $X(e^{j\omega})$ where $$X(e^{j\omega}) = \int_{-\infty}^{\infty} x(t) e^{-j\omega t} dt?$$

I know for a fact that this is wrong because the notation inherently implies the periodicity of $X(e^{j\omega})$, since $X(e^{j(\omega + 2\pi)}) = X(e^{j\omega})$, which is obbiously not true in this case. But I don't understand what mathematically does not permit us to use $e^{j\omega}$ as an argument in the continuous-time case.


texts: What mathematical tools exist for understanding modulated noise?

texts:
Suppose we have a signal $n$ that consists of Gaussian white noise.  If we modulate this signal by multiplying it by $\sin 2\omega t$, the resulting signal still has a white power spectrum, but clearly the noise is now "bunched" in time.  This is an example of a cyclostationary process.

$$x(t) = n(t) \sin2\omega t$$

Suppose that we now demodulate this signal at a frequency $\omega$ by mixing with sine and cosine local oscillators, forming I and Q signals:

$$I = x(t) \times \sin\omega t$$
$$Q = x(t) \times \cos\omega t$$

Naively observing that the power spectrum of $x(t)$ (taken over a time interval much greater than $1/f$) is white, we would expect $I$ and $Q$ to both contain white Gaussian noise of the same amplitude.   However, what really happens is that the $I$ quadrature selectively samples the portions of the timeseries $x(t)$ with high variance, while $Q$, ninety degrees out of phase, samples the lower variance portions:

The result is that the noise spectral density in I is $\sqrt{3}$ times that of $Q$.

Clearly there must be something beyond the power spectrum that is useful in describing modulated noise.  The literature of my field has a number of accessible papers describing the above process, but I would like to learn how it is treated more generally by the signal processing / EE communities.

What are some useful mathematical tools for understanding and manipulating cyclostationary noise?   Any references to literature would also be appreciated.

References:

Niebauer et al, "Nonstationary shot noise and its effect on the sensitivity of interferometers". Phys. Rev. A 43, 5022–5029.


texts: Z-Transform vs. Fourier Transform convergence

texts:
Are there signals for which the Fourier transform is known to exist (perhaps including
singularities) and for which the z-transform does not converge?


texts: LTI system phase response given $z$-transform

texts:
I have been given this question

  \begin{equation}
H\left(z\right)\:=\:\frac{1}{6}\left(1+z^{-2}\right)^6
\end{equation}

  (a) Compute and plot the phase response of the system.

  (b) Determine analytically $\angle H(e^{j\omega})$ and use the formula obtained to compute and plot the phase response.

  (c) Compute and plot the phase response using the function freqz.

First of all how to input the expression into MATLAB?
I tried

Hz1 = [1 0 1];
Hz11 = Hz1.^6

but this does not work. Any clues?


texts:
I am working in something were I should use a upsampling filter. I have decided to use a Nyquist filter(Lth filter). I know that there are two constraints. The first The frequency vector values must mirror each other in pairs around $\pi/2$. The second is the amplitude vector values must mirror each other in pairs around a magnitude of 0.50 What I am looking for are references to actually design these types of filters. I cant find any references that show how to implement them.

So dose anyone have a decent reference on hoe to design these filters? Does anyone have a reference on implementing these in Verilog?


texts: I dont understand one thing when I use the function fft(x,N) in matlab, where x is the signal which I want to calculate the fourier transform and N is the number of samples. What I dont understant when I represent the fft in a graph is the amplitude. Suppose that x is a cosine wave and N=1024, why the amplitude of the two deltas are different from PI? In concrete, why N affect the amplitude in fft? What have to do with that? I hope you can understand me. Thanks in advance


texts:
I have c# desktop application and I am using emgu framework as a wrapper for OpenCV.

I am trying to sharpen an image because the input images are not great.

I tired a technique I found via searches that suggest from the original image:

I take a copy and blur it.
I then take another copy of the original and invert it.
I then merge the 2 new images together.
I then finally invert that merged image.

I have done all that but the image pretty much looks the same.

Is this the right approach?

I can post my code if need be - I used Aforge to quickly test this approach though.

UPDATE:
To answer my own question I used this:

            Image<Bgr, byte> image = new Image<Bgr, byte>(@"D:\20140320022038047.jpg");
            Image<Bgr, byte> image2 = new Image<Bgr, byte>(@"D:\20140320022038047.jpg");
            Emgu.CV.CvInvoke.cvSmooth(image, image2, SMOOTH_TYPE.CV_GAUSSIAN, 5, 5, 9, 9);
            Emgu.CV.CvInvoke.cvAddWeighted(image, 1.5, image2, -0.5, 0, image);


texts: My 3x3 Weighted Median Filter doesn't seem to be improving my image quality

texts:
In order to reduce noise in my training dataset,I attempted a WMF whose weights are shown in a 2-D array as follows(values finally get normalized by division by 15:
[1 , 2 , 1
 2 , 3 , 2
 1 , 2 , 1]

My input image is an RGB image size (128,128,3). The pixel values are integers in the range of 0-255.
Isolation of each of my three channels is done as:
X_R=X_dummy[:,:,0]
X_G=X_dummy[:,:,1]
X_B=X_dummy[:,:,2]
R_padded=np.pad(X_R,[mask_start,mask_start],'symmetric')
G_padded=np.pad(X_B,[mask_start,mask_start],'symmetric')
B_padded=np.pad(X_G,[mask_start,mask_start],'symmetric')

Where mask_start=2
Convolution for a single channel is shown as:
for x in range(mask_cent,row_pad-mask_start):#The upper limit thing is not included. So Highest value is row_pad-mask_start-1
    for y in range(mask_cent,col_pad-mask_start):#These loops seem to be fine
      patch_selected_R = R_padded[x - mask_start-1: x + mask_start, y - mask_start-1: y + mask_start]
      a1_R= W*patch_selected_R
      med=np.median(a1_R)
      med=med*15
      b[x,y,0]=med

My images, which are shown below look like a colour correction rather than a denoising:

I am unsure of what is going wrong right now.
Edit: Something went wrong, this is my imgur link
https://imgur.com/gallery/1d4V5vr
Edit 2: new code, its resulting output is available through this link
https://imgur.com/Dr9K1bU
:
a1_R=patch_selected_R
      for i in range(1,2):
        a1_R=np.append(a1_R,patch_selected_R[0,1])
        a1_R=np.append(a1_R,patch_selected_R[1,0])
        a1_R=np.append(a1_R,patch_selected_R[1,2])
        a1_R=np.append(a1_R,patch_selected_R[2,2])
      for i in range(1,3):
        a1_R=np.append(a1_R,patch_selected_R[1,1])
      b[x,y,0]=np.median(a1_R)


texts: Is $A\cos(\omega t+\theta)$ a Gaussian random process?

texts:
$Z(t) = A\cos(\omega t+\theta)$ where $A$~$\mathcal N(0,\sigma ^2) $ and $\theta $~$\mathcal U(0,2\pi)$ are independent.

I'm trying to figure out if $Z(t)$ is a Gaussian random process and whether it is strict sense stationary.
It is easy to see that it is  WSS, but I can't figure out about the SSS and whether it is a Gaussian process.
It does look like to me that for every chosen time $t$ I get  some kind of a normal random variable multiplied by a constant per $\theta$ and therefore it is a Gaussian process, but I can't seem to prove nor disprove it.
Can someone clarify this for me?
Thanks.


texts: Simulink ; Code Generation ; Configuration Parameters : how can I activate the Test Bench Configurations?

texts:
FFT_HDL_Block im Simulink

in the Matlab Help it says that in order to activate the Configuration panel I need to make sure that the system is selected as DUT and not as Entire Model. but where I can do that  ?


texts: Transfer function of a PLL Loop Filter that can support a linearly increasing (chirping) frequency

texts:
What is a transfer function for a the loop filter of a PLL that can track a sinusoid of the form:

\begin{equation}
x(t)=\cos\left(2\pi\left(\frac{1}{2}c_0t^2 + f_0t + \phi_0\right)\right)
\end{equation}
where $c_0$ is the chirp (units of Hz/s), $f_0$ is the center frequency (units of Hz) and $\phi_0$ (units of cycles) is the initial phase?

I am currently using a loop filter followed by a direct digital synthesize (DDS). The loop filter I am currently using is a proportional plus integrator loop filter with transfer function
\begin{equation}
F_{\text{loop}}(z) = k_1 + \frac{k_2}{1-z^{-1}}.
\end{equation}
The DDS has a transfer function of
\begin{equation}
F_{\text{DDS}}(z) = k_0\frac{z^{-1}}{1-z^{-1}}.
\end{equation}

I would like to replace the loop filter with one that, combined with the DDS, can track the aforementioned sinusoid. The feedback loop is configured in the usual manner, namely, conjugate-multiplying the output of the DDS with the input sinusoid and then the output of that is fed into the loop filter, and, finally, the output of the loop filter is fed into the DDS. (Sorry I don't have a block diagram.)

This PLL works well with no noise present and $f_0 < 10$ and so, is clearly not very useful. I need something that can handle a phase offset, a phase ramp (nonzero frequency), and a frequency ramp (nonzero chirp) simultaneously, in addition to some noise.

NOTE: I have simplified this down to tracking a sinusoid. I'm actually tracking the phase of a modulated signal and so, rather than conjugate multiplying, I feed the match filter and the DDS outputs into a phase error detection function. However, for my purposes here, this simplified approach should suffice.

(I thought about posting this to the Electrical Engineering stack exchange, but since I'm working with a completely digital implementation, my question felt more natural here.)


texts:
I begin to study how codec works, and I found a "summary-diagram" for DCT-codec (DCT stands for Discrete Cosine Transform). On this diagram, there are of course two steps: the encoding step and the decoding one. I try to make a reproduction of this diagram herebelow:

ENCODING STEP Image (8*8 blocks) -->| FDCT |-->| Quantizer |-->| Entropy Encoder |--> Compressed data

DECODING STEP Compressed data -->| Entropy Decoder |-->| Dequantizer |-->| IDCT |--> Image (8*8 blocks)

The diagram seems clear to me, except the "Dequantizer". I don't understand how the quantification step can be reversed, since it is this step that causes information loss. What does this "block" do? Can someone give me more precisions?

Thanks'.


texts:
Does anyone know how to write arg min code in matlab with explanation?

I am referring to a paper for my research. I am not sure whether I can paste the paper link here. At first, I try to do feature extraction of finger using Gabor Filter. According to the paper, after feature extraction level, I need to do the following using formula to get my desired image:

OriCode(x, y) = arg j min {I(x, y) ∗ G(x, y, θj)}

∗ stands for convolution,
I(x,y) stands for input image,
G(x,y,θj) stands for gabor filtered image

There is actually a small j between arg and min. OriCode ranges from 0 to J-1
whereby j ranges from 0 to J. Here,J is set to 6.

I try to use conv2 to convolute my original input image and gabor filtered image. End up I am getting a blank white image. And what is the arg min used for? Please help me. Thanks.


texts: Polyphase Filter decomposition. It is not working

texts:
So, I want to do a polyphase implementation of a filter bank (I had problems with it since the beginning and I already asked for help to the community in the past, indeed: Norm MPEG-1 Layer III (Mp3) Filter banks distortion). Thanks to the support I was able to make it work (without polyphase implementation).

Nonetheless, I tried to do all the analysis filters and synthesis filters by means of polyphase filters banks as follows:

From:

To:

The idea is, basically, based on the first picture, with the low pass filter prototype modulated by a cosine to make frequency shifts of the filter response to cover all the bandwidth (with 32 filters), decomposing each particular filter response into 32 polyphase branches.

(So 32 branches, obtained by means of shifting the prototype by multiplying a cosine. Each of these 32 branches is implemented by means of decomposing each analysis and synthesis filters into 32 polyphase branches).

So, once the first part works (i.e. The filter bank not implemented by means of polyphase filter banks), I do the polyphase decomposition as follows:

1. Polyphase decomposition:

h are the modulated coefficients of each filter of the bank.
hh is the polyphase filter bank coefficients
the $i^{\rm th}$ row of the matrix represents the coefficients of the $i^{\rm th}$ filter of the polyphase bank
M are the polyphase filter branches, 32 in our examplehh=zeros(M,length(h)/M);
for l=0:1:M-1
n=l+1:M:length(h);
hh(l+1,:)=h(n);
end
end

2. The shift ($Z^{-1}$) is performed by a function that performs as follows ("delay" is the delay to apply. e.g. if 0 samples are to be delayed, then the output shall be equal to the input):

in_data: Input sequence
out_data: Output sequence.
delay_samp=delay+1;
out_data=zeros(1,length(in_data));
out_data(delay_samp:length(in_data))=in_data(1:length(in_data)-(delay_samp-1));

3. Ok, now, I apply the filters as follows:

Analysis:

yy=zeros(branches,length(hh(1,:))+fix(length(in_signal)/branches));

for k=1:branches

    %1. Shift
    shifted_input=shift_data(in_signal,k-1);

    %2. Downsample
    temp=zeros(1,fix(length(in_signal)/branches));
    downsampled_data=shifted_input(1:branches:end);

    temp(1:length(downsampled_data))=downsampled_data;
    shifted_downsampled_input=temp;

    %3. Filter
    temp=conv(hh(k,:),shifted_downsampled_input);
    yy(k,:)=temp;

end

And Synthesis:

yy=zeros(branches,branches*(length(hh(1,:))+length(in_signal)-1));

for k=1:branches

    %1. Filter
    temp_conv=conv(hh(k,:),in_signal);

    %2. Upsample
    temp=zeros(1,length(temp_conv)*branches);
    temp(1:branches:end)=temp_conv;%upsample(temp,branches);

    %3. Shift.
    yy(k,:)=shift_data(temp,branches-(k-1));

end

The result is very distorted:

The output with a 1KHz tone as an input:

I guess that I am making something wrong with the upsampling and downsampling processes as there are spectral replicas all over the second example, but I have no clue on what exactly is wrong.

I checked on the internet and I also checked the reference referred in the other post. I mean this book. But I think there is a problem with the way I am coding this not with the theoretical back.

This is the low pass filter prototype.


texts: Processing 47-53 MHz signal sampled at 96000 Hz

texts:
I am fairly new to the topic of DSP and FFT and I have hit a mental block. For a project, I am trying to pick out frequency's with amplitude peaks in a 47-53 MHz signal. This signal is being put through a 24 bit ADC with a sample rate of 96000 Hz. In order to successfully measure a sample, don't you have to have a sample rate >= to twice the desired frequency (Nyquist rate)? How can you get an accurate representation of a 47-53 MHz signal with such a low sample rate?

The second block I have hit involves the FFT of this signal. From my limited knowledge of FFT, the first "bin" (in the real part) represents 0 Hz and the last "bin" (in the real part) represents:
$$
F=i\times \frac{Fs}{N}
$$
Where $i$=Bin Index, $Fs$=Sample Rate, $N$=FFT Size

In my case with size 1024 and above sample rate, $511 \times 96000/1024 = 47906.25$ Hz, right? How can this range ($0$ Hz-$47906.25$ Hz) possibly represent my $47-53$ MHz signal? I get the feeling that I am missing something really crucial but I just can't figure it out.

Sorry if this is a really basic question and thanks for the help!


texts: Determine the stability of a system without using the $\mathcal Z$-transform (described by a difference equation)

texts:
For example, let's say a causal LTI System is described by the following equation:

$$y[n] - ay[n-1] = x[n] - bx[n-1],\quad n \in Z$$

Is there a way to determine (in this case) the stability of the system without using the $\mathcal Z$-transform?

(Solving the problem using the $\mathcal Z$-transform would be a classical easy problem - verify that ROC of $H(z)$ contains the unit circle, I know how to do that)


texts: what is the maximum instantaneous frequency of Dirac delta?

texts: I wish to find the maximum frequency of $\sin(\varphi(t))$, where $\varphi(t)=u(t)$. We have $\omega(t)=d\varphi(t)/dt=\delta(t)$. What is the the maximum instantaneous frequency $\omega_{\max}$?


texts:
I have two "sources" of audio:

record WAV audio files (44.1kHz, 16bit, stereo) with Linux arecord and convert them with LameMP3Encoder to MP3 files (44.1kHz, 320kbps, 32bit**, CBR)***
record MP3 audio files (44.1kHz, 320kbps, 16bit, CBR) directly* using Darkice and LameMP3Encoder

No I need to calculate MFCCs of the same section in both sources. As I was told here, it is important for MFCCs to keep the same format throughout my workflow. Will the coefficients come out different for the two cases?
And if so, how could I solve my issue?

*whatever Darkice is doing in the background
**I think this could be changed to 16bit if needed
***Does it change the WAV files when I open them with Adobe Audition don't modify anything but click 'Save As' and keep the format the same?


texts: Fast / Efficient Way to Decompose a Separable integer 2D Filter Coefficients without the SVD

texts:
I would like to be able to quickly determine whether a given 2D kernel of integer coefficients is separable into two 1D kernels with integer coefficients. E.g.

 2   3   2
 4   6   4
 2   3   2

is separable into

 2   3   2

and

 1
 2
 1

The actual test for separability seems to be fairly straightforward using integer arithmetic, but the decomposition into 1D filters with integer coefficients is proving to be a more difficult problem. The difficulty seems to lie in the fact that ratios between rows or columns may be non-integer (rational fractions), e.g. in the above example we have ratios of 2, 1/2, 3/2 and 2/3.

I don't really want to use a heavy duty approach like SVD because (a) it's relatively computationally expensive for my needs and (b) it still doesn't necessarily help to determine integer coefficients.

Any ideas ?

FURTHER INFORMATION

Coefficients may be positive, negative or zero, and there may be pathological cases where the sum of either or both 1D vectors is zero, e.g.

-1   2  -1
 0   0   0
 1  -2   1

is separable into

 1  -2   1

and

-1
 0
 1


texts:
I am trying to better understand discrete-time PLLs. I drew a picture of a simple feedback system here:

I want to be able to describe and understand the system at v(t) and y(t). I found a fairly good reference with the following diagram:

I am still having a hard time and I think if I could see a signal go through this system either visually or computationally, I would be able to understand it better. So for example in my diagram, what would $y(t)$ and $v(t)$ be if $x(t)=5u(t)$ and $h(t)=6{\delta(t)}$?


texts: How do audiobook players manage to quickly speedup/slowdown playback speed without using more memory?

texts:
Many audiobook player apps on Android have a reading speed slider which lets us choose the reading speed e.g. 0.5x 0.75x 1.00x 1.25x 1.50x. This is time-stretching without pitch shifting.

I have some idea about how this could be done using PSOLA algorithm(s), but they would need extra memory equivalent to the memory of original audio file.

ex.

Original audio file -> PSOLA -> Modified audio file

But these Andorid apps don't seem to use double the memory when we try to change reading speed. How do they do an in place time stretching/shortening so quickly?

edit. I found this YouTube engineering blog, which led me to sonic library, which in turn led me to a description of PICOLA algorithm.

I don't understand the algorithm from the images though. Could anyone please explain? What do those triangles mean? How do they decide these A and B points?

Time scale expansion procedure of the PICOLA


texts:
Ladies, Gentlemen,

Please let me the subject question, for I see in DFT equations testing frequencies sub-multiples of sampling frequency. Regards.


texts: Manually Windowing an IIR Filter in Matlab

texts:
I am currently trying to window an analog IIR filter in order to obtain an FIR filter. Though I realize the fir1 function exists within Matlab, I was wondering to see if it could be done step-by-step to produce a notch filter at 0 Hz to eliminate any DC gains in the system. However, I quickly realized that I may not know what I'm doing :)

Firstly, I created a butterworth filter containing the characteristics that I'm looking for just for a comparison. Once the Chebyshev II analog filter was created, the magnitude and phase response was viewed. It doesn't show a bandstop at 0 Hz, but my guess is because it hasn't yet been windowed to show this result? I also wasn't too sure how to combine the window and analog filter, and would love it if someone pointed me in the right direction :(

Fs = 250;
n = 5;
Rs = 40;
Wn = [0.1*2/Fs, 0.2*2/Fs];
[b0,a0] = butter(3,Wn,'stop');
[b1,a1] = cheby2(n,Rs,Wn,'stop','s');
freqz(b0, a0, 4096, Fs);
w = triang(250);
y = filter(b1,a1,w);


texts: What does it mean for a Wavelet transform to commute with translations?

texts:
Referencing this article here https://arxiv.org/pdf/1203.1513.pdf

It states "A wavelet transform commutes with translations, and is therefore not translation invariant". Now I understand why it is a problem that the result is not translation invariant, however, I'm confused as to why it is.

What does it mean for a transform to commute with translation and why does the Wavelet transform commute with translations (i.e. why is the Wavelet transformation shift invariant)?.


texts: Intuitive understanding of scale-space extrema detection

texts:
Can someone explain intuitively why local maxima and minima in the scale-space domain make for good keypoints?

I understand using LoG or DoG zero-crossing points to identify spacial variations, i.e. corners.  And I understand working at different scales to find scale-invariant features.  Both of these are pretty intuitive.

But I fail to see what it is about local extrema that makes them good features for various algorithms like SIFT.


texts: Is "early vision" chronological or process

texts:
This might sound silly, but I have a language barrier type of question, and I was hoping someone could clear up this misunderstanding:

I've seen the term "early vision" several times in papers I've read, but the term often doesn't accompany any later publications to compare with when using the term. At first I assumed this was referring the the chronological order of the publications, but the lack of "later vision" makes me, as a newcomer to the field, question whether this is a term to refer to the processing order used in vision - such as "early" in respect to the order of operations used in the image processing. What is the correct interpretation of this term?


texts: How to eliminate audio device transfer function from recording?

texts:
I'm working on a project which requires analysis of filter transfer function of vocal tract. The vocal tract is excited by a source signal that is a frequency sweep. The source signal is provided through an audio device. The device has it's own transfer function which would change the results as expected from the actual transfer function.

I know the transfer function of the device.

Can anyone help me with how should I eliminate the effect of transfer function of the device from the recording in MATLAB?


texts: The difference about WPCN and TDMA or FDMA

texts:
I am a little bit confused about the difference WPCN and TDMA or FDMA,i mean the level difference.

WPCN is a wireless powered communication network,as the name implies,it can transmit the information without wire,so is it a transmitted technology or a transmitted paradigm?TDMA and FDMA are the method that transmitt information by dividing frequency and time.

What i really want to ask is that do them just like that i know a method which can transmit signal without wire,and i called this method "WPCN",and in this method,WPCN, i use TDMA or FDMA to transmit information,am i right?


texts: Does $y[n] = x[n] \star (u[n]-u[n-2])$ have memory or is it memoryless?

texts: $y[n] = x[n] \star (u[n]-u[n-2])$, by its definition is has to be a system with memory since it is depended from a fraction of time in the past, but if we calculate the difference $u[n]-u[n-2]$, it results $u[n]$ for $0 \le n < 2$, which is memoryless. And that sign $\star$ is convolution.


texts: For complex values, why use complex conjugate in convolution?

texts:
Taken from Adaptive Filter Theory (2014) written by Haykin page 110 :

$$y(n) = \sum_{k=0}^{\infty} w_k^*u(n-k), \quad n=0,1,2,...$$

where $u$ and $w$ are complex values. My question is why use complex conjugate of $w_k$? The answer found in the book says "..., in complex terminology, the term $w_k^*u(n-k)$ represents the scalar version of an inner product of the filter coefficient $w_k$ and the filter input $u(n-k)$ ". I still don't understand, can you elaborate more on this answer?


texts:
Are there any computer vision libraries in PHP, or any server-side programming languages?

If not, maybe we can make a list of some -already implemented- methods (Viola Jones face detector, landmark detector etc.) to help someone who wants to implement such a library?


texts:
In this code I try to decompose music from singer sound with wfilters but when I hear it it is still mixed where Iam I wrong ?

 function s = scale3(q,n)
  p = length(q);
   if p==n
   s = q;
    else
    s = resample(q,n,p);
   end

the program

s = wavread('K:\Khaleel_3aaza (1).wav'); % whatever here

 [l,h] = wfilters('sym2','d');
 [z.x]=wavedec(s,2,l,h);

p = scale3(z.x(2245001:22350000),2245000);


texts: Are MATLAB function zp2tf() and tf2zp() are complementary or not?

texts:
I was under impression that given, pole, zero and gain the transfer function (filter coefficients b and a) is fixed. Therefore, if we designing a filter using cheby2() for some coefficients to get the pole zero and gain by using

[z, p,k ] = cheby2( N, Rs, Ws, 'stop');

I assumed that we can get back the [z,p] by

[hB,hA] = zp2tf(z,p,k);

[z1,p1,Hek] = tf2zp(hB,hA);

In other words z1=z and p1=p. But this is not true as shown by my MATLAB code.
Can anyone please tell me what am I missing?


texts: How to make pop-free, crisp two-beep ringtone?

texts:
I hope this ultra-noob question is not entirely out of place here.

I'm trying to make a super simple ringtone: 0.5s silence + 1s "pure tone" + 0.5s silence + 1s "pure tone" + 0.5s silence.  By "pure tone" I mean something like a sinusoidal or square wave with a fixed frequency (let's say 350Hz for concreteness).  This profile results in a very standard beep-beep ringtone.

With Audacity, it's relatively simple to generate this profile (with Generate > Silence... and Generate > Tone...), and one even has a choice of wave shapes (sinusoidal, square, etc.).

If I pick the sinusoidal option when constructing the profile above, and export it as a WAV file, when I play the ringtone in my phone, I can hear a slight "pop" at the beginning of each beep.

I've tried to get rid of those pops, with little success.  I figure that the pops are an artifact of the discontinuity of the wave at the beginning of each beep (though, curiously, I don't hear a pop at the end of each beep).  So I tried fading the sound in and out, which does get rid of the pop, but, as one would expect, makes the beeps sound less crisp.

I've heard many ringtones of this sort that are crisp, pleasant-sounding, and pop-free, so there must be a way to get rid of these pops.  Any suggestions would be appreciated!

P.S.  If I pick the square wave + no aliasing option (which, to my ear sounds a little "cleaner" than the option with aliasing, for some reason), the resulting ringtone does not have the "pop" at the beginning of each beep, but it sounds very harsh and loud.  I tried to adjust the loudness of the beep by lowering the amplitude of the wave generated by Audacity, and in fact, when Audacity plays this reduced-amplitude wave it indeed sounds quieter, but when it is saved as a ringtone in my phone, the phone plays both versions of the square-wave ringtone equally loudly.  I figure that the phone probably normalizes the ringtone's loudness somehow.  What's surprising to me is that the ringtone made with the sinusoidal wave (the one with the slight "pops" at the beginning of each beep) sounds considerably less loud than the ringtones made with the square wave.  In any case, even if I could find a way to reduce the volume of the square-wave ringtone that the phone did not "normalize away", I still would prefer a pop-free version of the sinusoidal-wave ringtone.


texts: Perfect system identification or am i doing something wrong?

texts:
I am using MATLAB to identify a system. The problem with my method is that my result is perfect. I get a nearly 100% fit, which make me wonder if what I  am doing is correct.

I feed a sine sweep with an amplitude being the max velocity the system is capable of moving.
I am sweeping from $0.1 \mathrm{Hz}$ to $2 \mathrm{Hz}$ (and another set from $0.1 \mathrm{Hz}$ to $5 \mathrm{Hz}$).

I log how much the position has changed for each time I change the velocity.
Which seems a bit incorrect to do, since a change in position is just a velocity. Aren't I just sending and measuring the same thing hence perfect fit or what?

The System is a Pan/tilt unit FLIR D48E
The input to the Plant is a velocity, and the output of the plant is a position.
the input for the controller should be summation of how much it has to angular displacement given from input source, and its present location.


texts: Why is the correlation of two random markov chains so large?

texts:
A very simple python code shows that the correlation coefficient and spearmann rank between two datasets of uniform random numbers drops proportionally to the square root of the number of points in the dataset. However, when one compares Markov chains produced by accumulating those numbers, there is no such behaviour, and even for large data sets, correlation can easily be like 0.7. What is the origin of such behaviour? Are two random markov chains more "related" to each other than two random datasets? Can this effect be corrected?

import numpy as np
import matplotlib.pyplot as plt
import scipy.stats

x = np.random.normal(0, 1, 10000)
y = np.random.normal(0, 1, 10000)

# Convert random data into Markov chains
for j in range(1, 10000):
    x[j] += x[j-1]
    y[j] += y[j-1]

print("Correlation: ", np.abs(np.corrcoef(x,y)[0, 1]))
print("SpearmannRank: ", np.abs(scipy.stats.spearmanr(x,y)[0]))

plt.figure()
plt.plot(x)
plt.plot(y)
plt.show()

EDIT: Unsurprisingly, the original problem is a bit more tricky. I have (at least) two experimentally obtained data sets I know relatively little about. Formally speaking, there is nothing stopping me from calculating their correlation in order to investigate their relationship. Since I was getting garbage, I tried to investigate correlations of several semi-random datasets, until I arrived at a surprising (for me) result above. Let me refine the question: is it possible to guess from the shape of the data, whether or not correlation is an informative metric?


texts:
Chessboards are very frequently used for camera calibration, this website also talks a bit about why: wiki. One of the reasons is, that chessboards define many natural interest points.
Now my (very simple?) question: Why don't we just use a white board with black dots on it instead of the checkerboard pattern where we first need to detect the corner points? I believe the black dots would be even easier to find...


texts: Implementing an offline guitar monophonic pitch detector

texts:
I am implementing an offline guitar monophonic pitch detector. I was wondering about the trade-off of the standard methods: Autocorrelation, HPS, Cepstrum, picking the peak from an STFT, the YIN algorithm.

I am working with audio that could will be segmented according to onset times, but let's assume this is done, so let's assume that I am given 5 segments which have been correctly segmented (start at the onset time, finish a frames afterwards).

My first question is: How long should a be? I guess that for algorithms like Autocorrelation, the bigger the segment the better?

Also, when working with guitar in particular, is there any issue I should take care of and is one of those methods preferable? I would assume HPS is good as the guitar produces a lot of harmonics.

I tried implementing Autocorrelation but I get a lot of octave errors. Would the YIN algorithm correct many of those? I also implemented a simple peak picking from an STFT but I often get strongest harmonics instead of the perceived pitch.


texts: Can Oversampling help to mitigate the effect of additive white gaussian noise?

texts:
Oversampling the signal at the receiver's ADC is a common technique to improve the ADC's resolution, dynamic range and to improve the signal to noise ratio (SNR) due to ADC quantizaiton noise, thermal noise,...
However, I am wondering if Oversampling in the ADC can help to reduce the effect of the additive white gaussian (AWGN) channel?
To my knowledge, oversampling in the ADC can help to improve the performance of ADC due to reduced ADC-induced noise, but I don't think it can reduce the effect of AWGN channel?
thanks


texts: Discrete time inverse fourier transform of cosine squared

texts:
$$ X(\omega) = \cos^2(\omega)$$

I tried this problem, and I ended up getting $0$, which doesn't make any sense. I integrated:

$$ x(n) = \frac{1}{2\pi}\int_{0}^{2\pi} \cos^2(\omega)e^{j{\pi}n} d\omega $$

Which can be changed to

$$ x(n) = \frac{1}{2\pi}\int_{0}^{2\pi} \bigg(\frac{e^{j\omega}+e^{-j\omega}}{2}\bigg)^2e^{j\omega} d\omega $$

To
$$ x(n) = \frac{1}{2\pi}\int_{0}^{2\pi} \frac{e^{j\omega(n+2)} + e^{j\omega(n-2)} + 2e^{jn\omega}}{4} d\omega $$

Now, taking out the four, each anti-derivative term contains the original term. And since each original term is of the form $$e^{jk\omega}, k\in \mathbb{Z}$$ and we're integrating from $0$ to $2\pi$, which are identical frequencies, the result ends up being zero. What went wrong?


texts:
i am working on simulation of an article "A Real-time ECG Data Compression Algorithm for a Digital Holter System". This algorithm has five steps "Difference=> ECG Signal=>Classification=> DCT=> Window Filter => Huffman" . it described window filter as "In order to implement a high compression ratio, the DCT window size, which is chosen to be proportional to the DCT result, is adjusted from 15% to 100%.". i do not understand this step and how can i do it? how can i change window size?
please help me
thanx


texts: How can I experimentally find the bandwidth of my PLL?

texts:
I recently designed a phase-locked loop. I would like to quantify its bandwidth so that I can better understand it.
However, I made this bandwidth in an informal manner due to my lack of formal education on the topic. Is there an experimental way for me to find the bandwidth of this system?
My PLL uses a dual-channel lock-in amplifier as a phase detector, a PI controller as a loop filter, and the system is digital (on an FPGA embedded system).


texts: Gesture recognition with Hidden Markov Models

texts:
I am currently working on a gesture recognition system (for an Android Application). I think that I have completed the Image processing stage, where I am able to extract the contour of the hand (I am wearing a glove to avoid background subtraction for now).

I am also getting the bounding ellipse/rectangle, the centroid as 'important' shape features of the hand.

My problem is that not a lot of literature indicate what the next stage is before the classification of the image through the hidden markov model. I am finding this 'Feature Extraction' stage very ambiguous.

Currently I am getting a list of angles of the contour (which is approximated so as to obtain a limited number of angles)

The problem is that I am clueless as what to do next. When I search for literature as 'Shape classification using HMMs' I still find it hard to what should I do next.

As a tool for HMM I plan to use JaHMM. But I don't know how to experiment with the tool at this stage since I do not know what will be the input to this classification stage!

I have encountered a list of functions I found in some literature, such as Fast Fourier Descriptors, Curvature Descriptors, B Spline; yet I am clueless as to how to apply these functions to my current data (i.e. list of angles, e.g.: -63, 154, 3, 23, 54, ....)

UPDATE 1:

Thank you for your information. @Peter K.

Regarding the poses: I was going to go for a set of words in American Sign Language which are fingerspelled, e.g 'dog' -> 'd' 'o' 'g' (3 states); but the moment I haven't decided what to go for.

I am currently reading some more papers to see what type of information I should extract, such as :

centroid of hand
angle of motion
distance from a particular point to different points of the hand contour (etc..)

Now I have encountered a paper which seems to show what I want to do, I'm not sure:

http://espace.library.uq.edu.au/eserv.php?pid=UQ:10700&dsID=n0273.pdf

I am currently reading section 5 - Vector Quantization (I heard of this term before but do not actually know what it involves, and in figure 5 there seems to be a complex algorithm which, if I understood correcty, converts the set of values I achieve from the hand (just mentioned) into 1 digit which I can use as the Observation sequence to train an HMM for 1 particular sign. Do you think I'm moving on the right track? (I'm working on Android, (NDK), I found JaHMM as an HMM tool, and using OpenCV for image processing.

@Peter K. Thank you for your answer. Regarding the data generation I was planning to follow the steps of this paper, after I produce my personal dataset:
(section 4 and 5)
http://www.i.ci.ritsumei.ac.jp/~shimada/papers/vi02-tanibata.pdf

UPDATE 2: keeping in mind that a gesture is formed of {posture a, posture b, posture c}

I am now thinking that I must make use of some form of classification algorithm. That is, I currently have a set of feature vectors:

Posture A:
[angle of ellipse surrounding it, height:width ratio]

0.802985 33.909615
0.722824    31.209663
0.734535    30.206722
0.68397 31.838253
0.713706    34.29641
0.688798    30.603661
0.721395    34.880161

Posture B:
[structured the same as posture A]

0.474164 16.077467

0.483104 14.526289
0.478904 14.800572
0.483134 14.523611
0.480608 14.41159
0.481552  15.563665
0.497951  15.563585

etc..

and I would like that when I feed a feature vector I obtain a simple symbol, e.g. 'A', 'B', etc.

Is this possible? I also migrated the question here: https://stackoverflow.com/questions/15602963/vector-quantization-algorithms-used-to-provide-observation-sequences-for-hidden


texts: Software implemented PLLs for signal synchronization, why use them?

texts:
In short I'm recreating a program that reads 3 sinusoidal signals through an ADC performs some manipulations and then reproduces these signals through a DAC. In order to reproduce these signals I need the instantaneous phase of one of these manipulations. So I recreated a charge pump zero crossing pll in software.

I don't understand why you would go to the trouble of working out the analogue loop filter transfer function, convert it to the z domain, when in software when I could just implement a program that reads the amount of samples between zeros, and the instantaneous phase is just.

(current sample#-last zero sample#)/(pi*(number of samples between zeroes))

Now I've obviously missed something, but I don't know what to google to find out what.


texts: Fast fourier transform and frequency domain spike in wrong area

texts:
I used MATLAB to produce a simple sine wave over time:

frequency=7
sampling_frequency=1000;
total_time=1-1/sampling_frequency;
step=1/1000;
theta=0;
time=0:step:total_time;

y=Amplitude*sin(2*pi*frequency*time+theta)

I then used the following code to fast fourier transform:

Y=fft(y);
ploty=Y/length(y);
stem(abs(ploty))

I was expecting to see one spike at 7 instead I am getting 2 and not even at 7.
One is at 8 and the other at 994. I am totally confused as to why.


texts: How to modify zeros and poles in a delta-sigma modulator loop?

texts:
In this specific case, I am modeling a delta-sigma analog-to-digital converter with a basic loop in which the output $V$ is fed back with unity gain to be subtracted from the previously sampled input $U$ (discrete time) and this difference is fed to an integrator modeled with the transfer function:
$$G(z) = \frac{z^{-1}}{1- z^{-1}}$$

Quantization noise is added in form of error $E$ to the output of the integrator, giving the output $V$. It follows:
$$V(z)=\frac{G(z)}{1+G(z)}U(z)+\frac{1}{1+G(z)}E(z)$$
The complete model, however, should be a third-order system in which the output $V$ is fed back with unity gain twice more so that it is once subtracted from the sampled input in the outer loop, this difference is then integrated and fed to the next loop, in which the fed-back output is subtracted again. This new delta enters the second integrator and the same process repeats once more in the inner loop, where the quantization error is added as described in the first lines above.
In total there will be 2 identical outer loops and a third inner loop where the quantization is added. In total there will be 3 integrators with transfer function $G$.

the minus sign is missing in the second picture for all three summation nodes. it was a mistake. the feedbacks should be indeed negative
Now I'm interested in the Noise Transfer Function: NTF = $V / E$. According to my computations:

NTF with gain unity in all three feedback paths (alpha, beta and gamma are 1) should be equal to:
$$\text{NTF}(z)=\frac{V(z)}{E(z)}=\frac{1}{G(z)^3+3G(z)^2+3G(z)+1}$$
It follows:
$$\text{NTF}(z)=\frac{(z-1)^3}{(z-1)^3+3(z-1)^2+3(z-1)+1}$$
From here, I would like to do two things:

Replace the poles $z1 = 1$, $z2 = 1$ and $z3 = 1$ of the NTF with different values. In order to do so, I simply introduced a gain factor in the feedback path of each of the three loops (alpha, beta and gamma as above). This will add three coefficients in the denominator that I can play with.

However:

I would also like to replace two of the zeros of the NTF, which are now all equal to 1, with a pair of complex conjugate zeros. This should provide "lower noise around the zeros, at the expense of a less effective shaping at $z = 1$, thus increasing the usable frequency range".

If I understand correctly, the numerator $N(z)$ of the NTF should be something like this in the end:
$$N(z)=(z-1)(z-e^{jω})(z-e^{-jω})$$
My question is: how do I achieve this? What should I add in the model to shift the zeros slightly away from DC?
Just for information: once I have also obtained a pair of complex conjugate zeros, I should solve an optimization problem to find the optimal position of poles and zeros in the NTF for a determinate quantization noise power. So my humble guess is that ideally I should add something as simple as a gain in the model for the zeros, too, so that can adjust the numerator of the NTF, too, and solve for the optimal zeros within certain boundaries.


texts: Confusion regarding application of time invariance to flip system?

texts:
I am reading book signal processing first
Chapter 5

I am reading article of time invariance

Where author mentions example of a flip system as shown in attached photo ,i have drawn a red curve above confusion equation

I am confused, how he is doing this when he say"if we delay input and then reverse the order"

I think he is not properly reversing the order,as he reversed the sign of only "n" but he didn't reversed the sign of "n0"

Why this discrepancy in reversal/flipping?


texts: Averaging Different Length Speech Signal

texts:
I have around 10 wav audio files all containing same word spoken i.e. 'Hello' but all having different length.
So lets say 1st file when loaded consist of 20000 samples, 2nd of 15000, 3rd of 18000 and so on they vary. Now I want to create a average template made of averaging all these 10 files, so that I can have better speech recognition result. But the problem is all the files have different length.

How can you average 10 different length signals?


texts:
How to determine $a$ and $b$ in this equation. I know how to determine $c$ and $d$ by looking at the  intensity histogram. But what about $a$ and $b$?

$$P_{out}=(P_m -c)\left( \dfrac{b-a}{d-c} \right)+a $$


texts: Performance of MATLAB's `conv2()` vs. `imfilter()`

texts:
A lot of people use imfilter to achieve a 2-D convolution between an image and a filter, but the majority of people use conv2 instead of imfilter because it is faster than imfilter by at least 20%.

Examples:

filtered_image_with_imfilter = imfilter(image,filter,'symmetric','same','corr');
filtered_image_with_conv2 = conv2(image,filter,'same');

Could someone explain to me in detail why conv2 is faster than imfilter.


texts: Getting different spectrum from velocity, and position data using Omega arithmetic

texts:
I am solving a very long problem and one part of it requires me solving an ODE and computing FFT of the resultant data. Essentially I have a differential equation$\frac{dz}{dt}$ for velocity, from which I can derive the acceleration equation. I can then solve the ODE and input the values in the acceleration equation and perform Fourier Transform, or I can take FT of velocity data and multiply it by $\omega$, or I can directly perform FFT on $z$ and multiply the output by $\omega^2$. All these three methods should produce similar spectra.

However, I am getting completely different spectra using these three approaches. I am posting what I think is the relevant part of the code(pertaining to FFT)and the relevant plots. I am not adding complete code to avoid cluttering and possible distraction from the main issue. If someone needs more explanation let me know.

PS: $\beta$ and $\tilde b$ are just two parameters in my ODE. The peak frequency depends inversely on $\tilde b$

Plots:

As requested in the comment section, I am adding the plot of position, velocity, and acceleration in the time domain.

Here is the relevant code snippet.

 '''
Fourier Transformation of the acceleration
'''
#https://www.mathworks.com/matlabcentral/answers/15770-scaling-the-fft-and-the-ifft

fft_scaling_factor = 1
spectrum_acc =[]
spectrum_vel =[]
spectrum_pos =[]
velocitylist =[.24]
impact_parameter = [0.01,0.1]

for index,b in enumerate(impact_parameter):
    filter_coeff =[]
    spectrum_a =[]
    spectrum_v =[]
    spectrum_z =[]

    for j in range(len(velocitylist)):
        fft_scaling_factor = 1
        filtered_acc =[]
        filtered_vel =[]
        filtered_pos =[]

        fft_input_acc = acc_normalized[index][j]
        fft_input_vel = velocity_normalized[index][j]
        fft_input_pos = z_list[index][j]

        fft_input_acc = detrend(fft_input_acc,type = 'constant')
        fft_input_vel = detrend(fft_input_vel,type = 'constant')
        fft_input_pos = detrend(fft_input_pos,type = 'constant')

        ft_acc_normalized = rfft(fft_input_acc)*fft_scaling_factor
        ft_vel_normalized = rfft(fft_input_vel)*fft_scaling_factor
        ft_pos_normalized = rfft(fft_input_pos)*fft_scaling_factor

        ft_acc_normalized = np.abs(ft_acc_normalized)**2
        ft_vel_normalized = np.abs([a*b for a,b in zip(ft_vel_normalized,freq_normalized)])**2
        ft_pos_normalized = np.abs([a*b**2 for a,b in zip(ft_pos_normalized,freq_normalized)])**2

        spectrum_a.append(ft_acc_normalized)
        spectrum_v.append(ft_vel_normalized)
        spectrum_z.append(ft_pos_normalized)

    spectrum_acc.append(spectrum_a)
    spectrum_vel.append(spectrum_v)
    spectrum_pos.append(spectrum_z)


texts: How to separate EEG frequency band in python?

texts:
Sorry for stupid question! I am very new in EEG signal processing and python environment.I have started my a project work related to EEG signal analysis using MNE. I would like to  separate EEG Bands  using bandpass filter. For this purpose I did the below coding to separate EEG Bands by following some of MNE tutorial:

iter_freqs = [
    ('Theta', 4, 7),
    ('Alpha', 8, 12),
    ('Beta', 13, 25),
    ('Gamma', 30, 50)                                                                                for band, fmin, fmax in iter_freqs:
    raw_filt = raw_temp.copy()
    data, times = raw_filt[0]
 # bandpass filter
    raw_filt.filter(fmin, fmax, n_jobs=1,
               l_trans_bandwidth=1,
               h_trans_bandwidth=1)

Now I would like to plot power of  each frequency  separately.I could not make sence how I will do this.I will appreciate if some one help me in this regard.


texts:
$$N=kTB$$
In this formula for calculating noise power, why do we use the total bandwidth of the system?

I mean our signal is at $f_0$ carrier frequency, why is it effected by a large bandwidth and not just only signal’s frequency bandwidth


texts:
Every time I've read "first Fourier transform", I've assumed it to be a misspelling of the fast Fourier transform. Recently though, I saw the term in both the title and keywords of an article from a seemingly serious, albeit not peer-reviewed, journal, Japanese Circulation Journal.

Development of a new analytical method for the electrocardiogram using short-time first Fourier transforms doesn't cite any resource or explain the algorithm. (fulltext PDF)

Is there a "first" Fourier transform?


texts: Unbiased estimation of square in presence of Gaussian noise

texts:
I have a single scalar observation, $y$, of a scalar parameter $x$ in presence of additive Gaussian noise. That is $y = x + n$ where $n$ is the Gaussian noise. The variance $n$ is known to be $\sigma^2$.

The problem: estimate $x^2$ from the observation $y$.

It appears that I can have an unbiased estimator which is $y^2 - \sigma^2$. However, this estimate can be negative whereas $x^2$ cannot be negative. Therefore, I can amend my estimate to be $\max(y^2-\sigma^2, 0)$. However, this estimate is no longer unbiased.

The question is: what is a good (preferably unbiased) estimate of $x^2$ from $y$ that is always non-negative.


texts:
I have an EEG labeled data, which is the data that used for training, And I want to segment those data based on the time of EEG signal (Time-based Epoching) as a preprocessing step,  based on the nature of EEG signals which is best:

To segment the data based on time domain, for example to take each 64 samples together.
Using the windowing functions like gaussian and hamming window. also if the best was this one,is it better to make the windows overlapped or not?


texts: Mathematical advantages of the ZT, DTFT and DT?

texts:
I apologize if this question is too general to answer concretely, but I was hoping more to perhaps be pointed towards some resources that could help more extensively. Essentially, I have a Discrete-Time Signal Processing Final exam coming up soon, and although I understand and am familiar with the mathematical descriptions of the ZT, DTFT and DFT, I was hoping to gain some intuition about which one to use in which scenario.

To me it seems that the DFT is a discretely sampled version of the DTFT, and the DTFT is the ZT specified on the unit circle. In this way, they are all essentially the same thing with increasing generality towards the ZT.

However, there are mathematical subtleties associated with each one (can Parseval's only be applied for DTFT and DFT?), even between the bilateral and unilateral ZT, for example with respect to the time shift property; when you shift a sample to the left in the time domain, then you must subtract the value of the ZT at n = 0 in the unilateral case, but no such subtraction (or addition) is required in the bilateral case. So why use the unilateral ZT, when it is simply the same as the bilateral ZT for causal sequences?

More generally, I was hoping for some insight into when each of these 4 transforms is most useful. For practical purposes I suppose the final transform, the DFT, is useful because computers process discrete information so it is useful to have samples that are discrete in both the time and the frequency domain, but this kind of answer is not what I am looking for (although I would appreciate more information about this as well). In my final I will be given a system in the form of perhaps a difference equation or a block diagram and asked to find the impulse response sequence, or perhaps given the impulse response sequence and asked to find a description of the system. Sometimes I will be asked to use a specific transform, but other times it is up to me to decide which is the quickest/easiest path to what I am looking for.

I understand that part of this kind of analysis is an art and the intuition comes with time, but maybe some of you know of some resources which can accelerate that process.

Thanks in advance for any responses.


texts: Scaling a wavelet in continuous wavelet transform

texts:
The mexican hat wavelet, obtained from the second derivative of a Gaussian, has a functional form of

$$ \frac{2}{\sqrt{3 \sqrt{\pi} \sigma \ }} \left(1-\frac{t^2}{\sigma^2} \right) e^{-t^2/(2\sigma^2)} $$

where "$\sigma$ is the standard deviation of a Gaussian and $t$ is the independent variable.

If we graphically wish to graphically see its dilations, say at scale $1 \le a \le 5$, the typical form of a wavelet function $\psi$ has a scale parameter $a$ and a translation parameter $b$. The functional form of the Mexican hat given in MATLAB does not explicitly have them both.

The standard deviation $\sigma$ is the only variable here that controls with width, but this is not strictly equal to the scale $a$. How should we generate scaled versions of the Mexican hat?

Thanks.


texts: Finding phase of fundamental from autocorrelation

texts:
I have some code, shown below that I have been using to find the fundamental of a guitar string.  After this function is called, I go thru the real buffer and find the peak, whose location gives me the period of the fundamental. Now I have a need to find the phase of the fundamental in relation to the start of the buffer.  Is there a way to find this phase from the info available in the code?

If this is not possible, is there a better algorithm to find both the fundamental and it's phase?

void AutoCorrelate(int real[],int imag[],int N,int sine[]){

fftTwiddle(real, imag, N);
fftForward(real,imag,N,sine);

for (int i=0;i<N;i++)
{
    int h;
    unsigned int l;

    MACS(h,l,real[i],real[i],0,0);
    MACS(real[i],l,imag[i],imag[i],h,l);

    imag[i] = 0;

}

fftTwiddle(real, imag, N);
fftInverse(real,imag,N,sine);}


texts:
Can I use any kind of transform to make spectrogram, not just stft? Is it possible to get the spectrograms of a signal without using stft?
What difference does it make if I calculate the frequency components of the entire signal using fft instead calculating fft of few samples at a time (stft) and cover the entire signal by moving the window?


texts: What is the value range of log magnitude spectrograms?

texts:
I'm quite new to this field and have a probably rather basic question:
Is there an upper bound for the values in a log-magnitude spectrogram generated like this:

log1p(abs(stft(signal) ** 2)

Obviously, the lower bound is 0 but is there also an upper bound (based on window size/hop length of the STFT)?


texts: Frequency warping while creating filter coefficients

texts:
If I have an audio signal at 16kHz with frequencies band-limited to 8kHz. I want to low-pass filter this signal such that fc=4000Hz. Meaning when I reconstruct the signal I do not want any content above 4kHz.

In order to use the matlab/python functions to generate the filter coeffs to do this job, ex fir1(), should I specify the cut-off frequency as 0.5 or do I need to do some frequency mapping such that my digital cut-off freq (fc) should correspond to analog cut-off of 4kHz?

Thanks


texts:
I know that the complex wavelet transform is given by
$$\int_{-\infty}^{\infty}f(x)\psi^*_{s,u}(x)\,dx$$
where $f$ is the signal, $\psi_{s,u}(x)=\frac{1}{\sqrt{s}}\psi(\frac{x-u}{s})$ is the wavelet.
and $^*$ denotes the complex conjugate operation.

If I have the wavelet $\psi_{s,u}$, which is represented by psi in MATLAB, and I want to compute the above integral. Which command should I use for computation in MATLAB?

conv(f,psi) or conv(f,conj(psi))?

since conj computes the complex conjugate of a vector? Thanks in advance!


texts:
I have a large data set that was collected by a 5 GHz oscilloscope, so I basically have an array of voltages with each index being a very small time step apart.  I am looking for a specific signal in this data set that would only be present for a very small time frame and so most of the data will not contain this signal.  The issue is that the signal I am looking for has an amplitude less than or equal to that of the background noise.  The signal should also be a fairly wideband.

My question starts then with how to find this signal?  My first thoughts are there must be something I can do to take advantage of the fact that my noise and signal probably follow different distributions, but I am not sure.

I know this is a fairly open-ended question so I am just looking for suggestions into general methodologies that help uncover a signal that is not consistent with background noise, but of the same or lesser amplitude.


texts: What are the advantages of higher order Kalman Filters like EKF, UKF?

texts:
Kalman Filter provides the optimal estimate of the states of a stochastic dynamical system if the system is linear, the measurements are also linear functions of states and the errors in system modeling and the measurements are Gaussian white noise. However, for a nonlinear system, the use of Extended kalman Filter (EKF) or Unscented Kalman Filter(UKF) provides a sub-optimal estimate. In general, for a nonlinear system, EKF gives a less accurate measure of covariance than UKF. In order to correct the covariance, higher order EKF have been proposed. Similarly, higher order UKF also leads to a more accurate covariance. My queries are:

Apart from improvement in the covariance, do higher order filters provide any other advantage?
Can we capture skewness or kurtosis using these high order filters?