texts: What is the difference between normalized peak of correlation, versus peak of correlation divided by its average?

texts:
Given a template, and a signal, the question arises as to how similar the signal is to the template.

Traditionally a simple correlation approach is used, whereby the template and a signal are cross-correlated, and then the entire result normalized by the product of both their norms. This gives a cross-correlation function that can range from -1 to 1, and the degree of similarity is given as the score of the peak therein.

How does this compare to taking the value of that peak, and dividing by the mean or average of the cross-correlation function?
What am I measuring here instead?

Attached is a diagram as my example.

In order to get the best measure of their similarity, I am wondering if I should look at:

Just the peak of the normalized cross-correlation as shown here?
Take peak but divide by the average of the cross-correlation plot?
My templates are going to be periodic square waves with some duty cycle as you can see - so should I not also somehow exploit the other two peaks we see here?

What would give the best measure of similarity in this case?

Thanks!

EDIT For Dilip:

I plotted the cross-correlation squared VS a cross-correlation that isnt squared, and it certainly does 'sharpen' the main peak over the others, but I am confused as to what calculation I should be using to determine similarity...

What I am trying to figure out is:

Can/Should I use the other secondary peaks in my calculations of similarity?
We have a squared cross-correlation plot now, and it certainly sharpens the main peak, but how does this help in determining final similarity?

Thanks again.

EDIT For Dilip:

  The smaller peaks don't really help in similarity calculations; it is the main peak that matters. But the smaller peaks do provide support for the conjecture that the signal is a noisy version of the template. "

Thanks Dilip, I am a little confused by that statement - if the smaller peaks do in fact provide support that the signal is a noisy version of the template, then doesnt that also aid in a measure of similarity?

What am I confused about is whether I should simply use the peak of the normalized cross-correlation function as my one and final measure of similarity and 'not care' about what the  rest of the cross-corr function does/looks like, OR, should I take the peak value and some_other_metric of the cross-cor into account as well.

If only the peak matters, then how/why would squaring the function help, since it just magnifies the main peak relative to the smaller ones? (More noise immunity?)
Long and short: Should I care about the peak of the cross-correlation function only as my final measure of similarity, or should I also take the entire cross-correlation plot into account as well? (Hence my thought about looking at its mean).

Thanks again,

P.S. Time delay in this case is not a problem, in that, it is 'not cared' about for this application.
P.P.S. I do not have control over the template.


texts: I have to make kiwifruit counting on tree application using Matlab. I searched internet but I couldn't find what I want. Can you guys help me how can I do this, is there are an example or resource？


texts: Spectral efficiency of with OFDM vs without OFDM?

texts: OFDM has advantage over frequency selective channel with addition of cyclic prefix after IFFT of MPSK or MQAM symbol. but I wonder that the spectral efficiency of with OFDM vs without OFDM.


texts:
Defined as:

  $$\hat{f}(x,y)=\frac{1}{mn}\sum_{(s,t)\in S_{xy}}g(s,t) $$

As far as I understand:

$g(x, y)$ is the original image
$g(s, t)$ is a sub-image of $g(x, y)$ with a dimension of mxn
$\hat f(x, y)$ is the filtered image
Sub-images are summed up and then multiplied by ${ \frac {1}{mn}}$.

Am I correct?

If yes, then, I have several questions:

Is $g(s,t)$ a pixel in the neighborhood? What does it mean by that?
What is $S_{xy}$ ?
What are the meanings of $s$ and $t$?
What is the meaning of $(s,t) \in S_{xy}$?


texts:
In my lecture slides for school and from this website here

"The sum $z[n] = x[n] + y[n]$ of periodic signals $x[n]$ with fundamental period $N1$, and $y[n]$ with fundamental period $N2$ is periodic if the ratio of periods of the summands is rational, i.e.,
$\frac{N2}{N1}=\frac{p}{q}$
and $p$ and $q$ are integers not divisible by each other. If so, the fundamental period of $z[n]$ is $qN2 = pN1$."

I'm confused with a number of things. First if $y[n]$ and $x[n]$ were periodic, then wouldn't the ratio of their periods $\mathbf{always}$ be rational since each period is always integer? Also if each signal is not periodic then this would imply their sum could be $cos[n]+cos[n]=2cos[n]$ is not rational but the ratio of their "periods" is $1$ which is rational. So, I'm assuming that this requirement is just redundant if the original signals are periodic?


texts: Identifying who is who - Image processing

texts:
I am working on a problem where I have to find how many people are passing through a point and how many times they pass through. A good example use case for this problem would be counting how many times an person enter and exit the building.

Detecting people is somewhat easy, I have relatively high SNR images so I use machine learning (pedestrian detection) to see how many people come and go. Achieving this has been relatively easy. However identifying people throughout the day has been a more complex challenge.

I do not want to use faces since they just walk in so it is not always feasible to get clean face shots. They don't change cloths during the day so visually, I can relatively easily identify who is who when I watch the video without seeing faces.

Since I am able to pick out the pedestrians in bounding boxes nicely, I now need a way to compare them and barring light changes, perspective changes etc. identify if they are the same person or not.

Where should I start for this type of algos?


texts: What is the practical meaning of the variance, covariance, mean value?

texts: What is the practical meaning of variance, covariance and mean for a signal?


texts:
I am trying to learn signal processing and when I research about ways to reduce noise in different situations it's so easy to get lost in one solution or go down the wrong path

for example, is your noise correlated? Is it not? Is it from multiple sources? Is it not?

I need to get some intuition on common solutions to these scenarios, but I too easily get lost in the massive amount of really specific research papers

Can someone point me to an overview of these techniques and when to use them etc...? Any help would be useful at this point


texts: What is relationship between entropy and frequency in image

texts:
When I was studying spatial frequency and entropy, it occured to me that "is there a relationship between entropy and frequency?".

As you can see, if we consider only horizontal line, the frequency of (a) is lower than (b).

Intuitively, I think that magnitude of frequency is proportional to entropy. But Google said nothing. Am I right?

Each entropy is the following.

$$H_a = -0.842\log_20.842 -0.157\log_20.157 = 0.209 + 0.419 = 0.628$$
$$H_b = -0.6\log_20.6 -0.4\log_20.4 = 0.442 + 0.529 = 0.971$$

(a)

(b)


texts:
What is additive noise? What actually additive means?
I have tried to search in the internet but the only answer that I get is the noises gets added therefore it is additive, which make me think that noises are not destructive in nature am I right?


texts: The peak in frequency spectrum from sampled data is higher than the true amplitude

texts:
I am given a task to do sampling on the function
$$f(t) = 1.3 \sin(2\pi \cdot 10 \cdot t)$$
with sampling frequency 4 Hz and start at time t_start = 0.0877s, so there should be aliasing and in the frequency spectrum, the amplitude should be at the perceived frequency.
The perceived frequency is 2 Hz as the folding frequency.
I chose to take $N=128$ data points.

Then after completing FFT with sampled $f(t)$, I wanted to plot frequency spectrum, however I have a peak of 1.815 at 2 Hz, however the height of peak should be around 1.3. Here I attached this spectrum.

Is there any explanation to this? Usually due to the leakage, the peak should be less than the actual amplitude, however I got higher peak. It seems quite strange for me.
Here is also a Matlab code, if you find it more convenient to check.
t = 0.0877:0.25:32.087;
signal = 1.3.*sin(2.*pi.*10.*t);

y = fft(signal);

%65th data point corresponds to fft at 2 Hz
abs(y(65))/(numel(t)/2)

Thank you in advance.


texts:
I am studying for my exam in signal processing. For one of the old exam sets, a discrete impulse response of a filter is given as $h[n]$
\begin{bmatrix}
-3&0&-3&0
\end{bmatrix}
With a frequency response $H[k]$. What is the easiest way of calculating the DC gain from this information? I have tried using a DFT but did not see any usable conclusion.


texts: Evaluation of Autocorrelation and Power Spectral Density of white noise through a filter

texts:
So say there's a filter with an impulse response of $h(t) = (0.8)^t u(t)$. I'd like to pass white noise through this and figure out the autocorrelation and power spectral density of the output.

I'm having a bit of trouble figuring out exactly how to do this. I know if you pass a signal through a filter, you simply take the Fourier transforms of the signal and the impulse response, multiply them together, and that's the output.

However, not being any mathematical expression for the noise, I'm unsure how to proceed. Any tips would be appreciated.


texts: Discrete Hilbert transformation of a spatial signal

texts:
first of all, sorry for this basic question in signal processing, I'm pretty new in this field and have been stuck in a situation a little beyond my expertise.

The idea is to derive the instantaneous wavenumber direction as an estimation of the direction normal of a 2D field by using a directional Hilbert transform in one of the directions.

As far as I can recall correctly, all I have to do is to do a 1D Fourier transform of each data vector, apply a $\pi/2$ phase-shift in the wavenumber domain and then apply an inverse Fourier transformation to get the Hilbert transform.

So the Hilbert transform is defined as:
$$
H(x(t)) = \frac{1}{\pi} PV \int_{-\infty}^{\infty}\frac{x(\tau)}{\tau-t}d\tau
$$
where $PV$ denotes the principal value of the integral and $H$ is the Hilbert transform of a vector $x(t)$. This is supposed to be equal to the convolution $\frac{1}{\pi t} * x(t)$ and

$$
F(H(x(t))) = F(\frac{1}{\pi t}) F(x(t)).
$$

So the Fourier transformation and multiplication of the two factors on the right side is equal to the Fourier transformation of the Hilbert transformation of my vector, right?

My question now is how to apply the phase shift on the Hilbert transform? is it simply multiplying the product on the right side by $\pi/2$ in the wavenumber domain?

Thanks a lot for any help!
Cheers!

UPDATE:

So I coded the Hilbert transformation in $C$ but unfortunately I do not get a phase shift of $90^\circ$ but somewhat different from that and with a wrong amplitude. My code looks like this:

    void hilbertfun(float *vin, float *vout, int n, int d)
    {
static complex *A;           //working array
int i;
float pi = 4. * atan(1.);
int signfun;
static float *rkx;

void rk(float *ak, int n, float d, int ind);

A  = (complex*) alloc1(n,sizeof(complex));
rkx = (float*) alloc1(n,sizeof(float));

//copy input array to complex array
for(i=0; i<n; i++){
    A[i].r = vin[i];
    A[i].i = 0.;
}

// perform inverse fft
fouriertransform(1,n,A);

// calculate wavenumbers
wavenumbers(rkx,n,d,1);

// check wether wavenumbers are positive or negative >> apply phase shift by using the impulse response of the Hilbert transformer
// + apply phase shift
for(i=0;i<n;i++){
  if (rkx[i] > 0) signfun = 1;
  else if (rkx[i] == 0) signfun = 0;
  else if (rkx[i] < 0) signfun = -1;
    A[i].r = - A[i].i * signfun;
    A[i].i = A[i].r * signfun;
}

// perform forward fft
fouriertransform(-1,n,A);

for(i=0;i<n;i++) vout[i]=A[i].r/n; //write into output and normalise

}

The Fourier transform and the normalisation work perfectly fine without the phase shift (Original (red), Output (green)):

Yet, with the phase shift I get this result (Original (red), Hilbert  transformed Output (green)):

What am I missing?


texts: Discrete time system signal flow graph problem

texts:
I'm trying to solve the following question, but I've been told I'm doing it incorrectly. Could anyone here give me a hint as to where I'm tripping up? Below follows my current solution:

I do the following to solve it:

a)
$ y[n] = 3 ( x[n] + \frac{1}{3}x[n-1] + 2x[n]) + 6x[n-1] = 3x[n] + x[n-1] +6x[n] + 6x[n-1] = 9x[n] + 7x[n-1]$

b) I find the system function: $H(z) = \frac{Y(z)}{X(z)} = \frac{9X(z)+7z^{-1}X(z)}{X(z)} = 9 + 7 z^{-1}$

Then I apply the inverse z-transform and find the impulse response:
$h[n] = 9\delta[n] + 7\delta[n-1]$

Thanks!


texts:
Is this code for doing a moving average correct?

y=conv(x, ones(1,100)/100);

I want to filter my speech signal with moving average filter in code.  I think that I can use convolution for this.


texts: Mscohere in Matlab-why would the coherence tends to 1 as nfft increases?

texts:
Does anyone have a clue as to why -using mscohere- the coherence becomes exactly one for all frequencies if nfft is set to about 190-200. I know it's standard practice to set it to a number that is a power of 2. I tried with 1024, and all I got was a bunch of NaN. So I started with low numbers, and the coherence seem to have plausible numbers until I hit the 190 mark. I'm completely baffled.
Looking forward to hearing from you.


texts: Questions about Bark scale filter bank implementation for bfcc's

texts:
I have a few questions regarding the implementation of Bark scale filter banks for the calculation of bark frequency cepstral coefficients.

1) Which filter shape is most commonly used and why?

Triangular band pass similar to the mfcc's as seen here:- A Comparative Study of Filter Bank Spacing for
Speech Recognition
Trapazoidal type shape as seen here:- Performance Evaluation of Front-end
Processing for Speech Recognition
Systems and here:- Auditory Models for Speech
Analysis
4th order elliptical bandpass filters used by the Mir toolbox

2) How should the filters be laid out?

No overlap with centre frequencies 1 bark apart?
Half a bark overlap and a length of 1 bark?
Linearly divided on the bark scale between a predefined frequency range and number of filters? If so how is a suitable number of filters chosen e.g. 40Hz to fs/2

Thanks for any help provided, I've become pretty confused from reading the literature


texts: Is the Auditory Spectrogram the same as the Magnitude Spectrogram?

texts: This is in the context of speech signals. The magnitude spectrogram is computed by framing the signal into short time windows, applying a hamming (or similar) window, computing the fft over each window, and taking the absolute value of the complex numbers obtained. I came across the Auditory Spectrogram in a paper and several toolkits (http://amtoolbox.sourceforge.net/amt-0.9.5/doc/general/audspecgram.php, http://www.isr.umd.edu/Labs/NSL/Software.htm). Do they refer to the same thing? Or else, how is the auditory spectrogram computed and what are the differences between the two representations?


texts: Difference between sampling rate and baud rate and their relation to channel capacity

texts: The sampling rate says that   one Hz can carry at least 2 samples, and the bit rate is obtained by multiplying the sampling rate by the number of bits per sample. Thus, many samples and many bits can be contained in one Hz.  Shannon, on the other hand, says that the maximum bit rate that can be transmitted over a channel is twice the bandwidth. I am confused. Could you please help me?


texts: A clarinet has no even harmonics. What would produce no odd harmonics?

texts:
According to this link, the waveforms of clarinets do not have even-numbered components in their harmonic series:

  A closed cylindrical air column will produce resonant standing waves at a fundamental frequency and at odd harmonics... As can be seen from a sample waveform, the even harmonics missing from the tone

Is there an example of a system that would produce no odd harmonics?


texts: What Is the Meaning of the Term "Frequency Response'' When We Design a Pitch Detector

texts: This is from Klapuri 2003. What is the "frequency response" and why do we model is as multiplied with the vibrating system we want to get the frequency from?


texts: Which algorithms one can use for matrix inversion (for beamforming application MVDR/LCMV) in Fixed Point?

texts:
I have implemented beamformer(MVDR/LCMV) for speech enhancement in matlab, now I am trying to convert it to fixed point implementation. during the weight calculation step correlation matrix inversion is required, but in fixed point implementation  correlation matrix inversion is not giving correct results.
I tried the the standard method math.stackexchange.com/questions/623780/… I am using Q16 format for this(I think this will not work at all as precision will be lost in devision). I have also tried DCD algorithm explained in etheses.whiterose.ac.uk/1629/1/PhD_thesis_Jie_Liu.pdf but not getting the correct result.


texts: Selecting gradient orientation for Generalized Hough Transform while scaling and rotation is present

texts:
I am using this link to study Generalized Hough Transform. I will explain it briefly. In order to detect a shape, an R-table is created for the shape with $\phi$ indicating gradient orientation for points on the edge of the shape. Then $(r, \beta)$ is used to indicate the vector from each of these points to the centroid in the shape. While detecting the shape, we will first find all the edge points and their gradient orientation $(\phi)$. Based on this $\phi$, $(r, \beta)$ values are used to calculate centroid points. Based on the votes on centroid points (and R table), the shape can be detected.

My question is related to rotation of the shape which is explained towards the end. If the shape is rotated by $\theta$, then the gradient orientation $(\phi)$
 for a given edge point changes. So, shouldn't we do either one of the following:

1) Rotate all the $\phi$ values in R table by $\theta$?

OR

2) Rotate gradient vector by $(-\theta)$ and then calculate $\phi$ for the edge point?


texts:
Filtering by taking FFT, zeroing bins, and inverse FFT is a bad idea, as discussed here.

But what about:

take a STFT, (i.e. multiply the input signal by moving window function, and take FFT)
zero some bins in the STFT matrix
inverse STFT (using overlap-add)

?

I've tried it, it's not bad, but I've got horizontal ripples in the spectrogram:

from perso import stft
from scipy.io import wavfile
import numpy as np
sr, x = wavfile.read('in.wav')
s = stft.stft(x, fftsize = 4096)
s[:,0:11] = 0
s[:,13:] = 0
z = stft.istft(s)
z = np.float32(z)
wavfile.write('out.wav', sr, z)

Important note: why do I absolutely want to do the filter in the frequency domain? Because I want to do a filter that evolves over time... With a STFT, it would be super simple to make the filter evolve for each time frame...

for k in s.shape[0]:
    s[k,f(k):0] = 0       # where  f(k) varies over time (k)

Is there a way to make a good-working STFT filtering in the frequency domain?


texts: Detecting defects/differences in printed images

texts:
I've been experimenting with various methods to detect defects in printed images. Features that are qualified as defects may include scratches, discoloration, etc.

I'm not very experienced in image processing and not sure if my approach would be acceptable.

There are several approaches that I've tried:

Given two images (one good, the other one is defect)

Threshold and blur
Run Canny edge detection
Remove noises using fastNlMeansDenoising
XOR the two images and use SIFT to find outstanding features that may be classified as a defect.

It works very well - in very limited cases.

Seems like this method is used/proposed in industry a bit (?) as seen in this paper. But the problem with it is that if you have two images that are misaligned to the slightest bit, then you would get a problem because all your XOR result in an XOR-ed image that is very wrong. So to me it doesn't seem like an acceptable solution, since it is impossible to perfectly align two images every time (or I could try to realign the images).

How should I approach this. Is there a method that is similar to XOR-ing that is more tolerant to subtle differences? Or perhaps, a totally different approach.

Possible alternative

Break up both images into chunks of n by n pixels. Compute and compare the histogram of each chunk of pixels broken up from image A to image B. Even if one of the images is blurred a little, the histogram should be still be similar (not sure if this is a sound assumption). If any chunk contains dark or white spots, this should flag that chunk for further inspection.

Detects darker font color

Detects eyebrows that aren't supposed to be there

Detects faded/lighten area


texts: I have problem with scaling on gnuradio. When i use more than one WX widget - which shows parameters of signal - i can't see last widget. How can I deal with this problem - just to scale scopes, and FFTs properly?


texts: Finding delay parameters for watermarked signal

texts:
I have a watermarked signal WATERMARKED SIGNAL

And the actual watermark WATERMARK

In Matlab, I need to find out the delay parameters $d_i$ which can be considered as the embedded
information.such that $0\leq d_i \leq 100$. There are 5 of them. I am afraid I don't understand the task, and my professor is on leave and will not be back before the task deadline. Would anyone be kind enough to at least tell me something about it? Show me a piece of code or a source? I can't seem to find any information about the code online.

Thanks.

All instructions:

EDIT:
Thank you Mathew for the answer. Now I believe I know what to do mathematically but still can't achieve the answer I am required (This must come from the fact I am an amateur with Matlab). I tried to play with your code but I have no idea what I need to change in order for it to work. So I will show you the code I created and if you are still interested in helping me, could you tell me what else needs to be changed?

clear
%Step 1. Upload sound files

[x,fs] = audioread('sample4_va18535.wav');
[m,fs] = audioread('assignment4_embedded_signal.wav');

%Step 2. Determine number of samples and create the window

N      = 132300;
w      = blackman(N);

%Step 3. Multiply both signals with the window to get x_w[n] and m_w[n]

xw     = x .* w;
mw     = m .* w;

%Step 4. Apply FFT to get X_w(k) and M_w(k)

XW     = fft(xw);
MW     = fft(mw);

%Step 5. Conjugate M_w(k) to get M_w*(k)

MWconj    = conj(MW);

%Step 6. Normalize XW * M_w*

Norm   = abs(XW .* MWconj);

%Step 7. Take IFFT

xwmw   = ifft((XW .* MWconj) ./ (Norm));

%Step 8. Plot everything (Using your method)

lags   = linspace(-N/2, N/2, N);

figure(1); hold off;
plot(lags,fftshift(abs(xwmw)))
% find the 5 peaks, then plot them
[pks,locs] = findpeaks(fftshift(abs(xwmw)),'NPeaks',5,'MinPeakHeight',0.0075);
hold on;
plot(lags(locs),pks,'rx');
xlabel('Correlation Lags'); ylabel('Scaled Correlation Magnitude (dB)')
grid on;
title('Watermark Cross-Correlation');

What I get is this : Surely it looks nothing like what you've got

Thank you for being patient with me. And I will understand if you can't find time to help me more.


texts: Spectrum of received signal from radar fm-cw

texts:
I obtained actual data from a researcher, consisting of a matrix composed of several received signals from an up-ramp fm-cw radar.

Wouldn't be reasonable to plot the spectrogram of a ramp up and obtain a chirp like this ? (This is from MATLAB spectrogram examples)

Instead what I get is this (I know the plots are rotated):

I have read that the received signal if you send a triangular wave, should be a the same but delayed and shifted in frequency.

What do you think?


texts: OFDM in multipath channel simulation in it++

texts:
I am trying to simulate OFDM for an multi-path channel. I am using it++ for simulation.

transmit_bits = randb(FrameLength);                   //The frame bits. 1024
coded_bits = conv_code.encode(transmit_bits);    //The convolutional encoder function.

modulator->modulate_bits(coded_bits, trans_symbols); //The  modulator.

ofdm.set_parameters(trans_symbols.size(), 100);
trans_symbols = ofdm.modulate(trans_symbols);

rec_symbols = channel(trans_symbols, coeff);        //The TDL channel.

rec_symbols = ofdm.demodulate(rec_symbols.split(trans_symbols.size()));

modulator->demodulate_soft_bits(rec_symbols, 0, recived_bits);  //Demodulate
decoded_bits = conv_code.decode(recived_bits);   //The decoder function.

berc.count(transmit_bits, decoded_bits);

I am always getting an BER of around 0.5. what am i doing wrong? Also after passing through channel, the length of the ofdm symbols will increase (due to multipath), currently i am blindly removing the extra bits, Is it the wright thing to do?


texts: In the Wikipedia article on Brownian noise, the Fourier transform of Brownian noise is determined. How is that Fourier transform defined? It seems it is a non-random quantity there, so it is not simply a pathwise Fourier transform. Since in the same article, it is said that white noise has constant Fourier transform and I know that the dirac delta has a constant Fourier transform, I actually guess that "Fourier transform of a (stationary) random process" means "Fourier transform of the covariance function of the random process". Is that true? Is there intuition behind this definition? Also, if this is the definition, how does the reasoning that $\mathcal{F}(dW(t)/dt)(\omega)=i\omega \mathcal{F}(W(t))(\omega)$ still go through? References?


texts: Why doesn't this complex multiplication in the frequency domain produce my expected phase shift?

texts:
I know how to change the phase of a complex number by multiplying by $\cos \theta + i \sin \theta$.  And I understand that the phase of a sine wave is reflected in its Fourier transform.  So, I am trying to phase-shift a signal by changing the phase of its Fourier transform..

This works for "synthetic" Fourier transforms, but when I try to FFT a signal, apply the phase change, and invert the FFT, I don't get the expected result.  I am using MATLAB in the examples below.

Fs = 1000;
Tmax = 2;
L = Tmax * Fs;

For example, I'll build a synthetic Fourier sequence.  The frequency intervals are 0.5 Hz, so a 10Hz component is at the 20th position after DC.  (I'm just spitballing here; I know there's better ways to pick frequency bins than hand-jamming 21.)

Ysynth = zeros(1, L);
Ysynth(21) = 1000;

And rotate it by 45°:

Ysynth = Ysynth * exp(j * pi/4);

It has a 45° phase on the 10-Hz component:

polarscatter(angle(Ysynth), abs(Ysynth))

Now take its inverse FFT:

Xsynth = ifft(Ysynth);

So far so good.  The generated signal has a phase shift of 45°.  MATLAB does complain about the presence of an imaginary part when I plot it; I think this is because I didn't bother with the negative frequency component.

t = (0:L-1)/Fs;
plot(t, Xsynth)

Now, I would expect the same principle to apply to a frequency spectrum taken from an actual signal.  But I do not get similar results.  Quickly:

X = cos(2*pi * 10 * t);
Y = fft(X);
Yshift = Y * exp(j * pi/4);
Xshift = ifft(Yshift);

There is an imaginary component in Xshift, which I do not expect, and again MATLAB complains about.

plot(t, [Xshift; X])

There is no phase shift here, and the amplitude (of the real part) is different.

I must be misunderstanding something about phase representation in FFTs.  Why doesn't my transformation produce a phase-shifted version of the original?


texts: Short Time Fourier Transform analysis of newborn baby cry signal

texts: I am working on analysis of baby cry signal. fundamental frequency(Fo) of signal is already estimated using auto correlation and cepstrum analysis. cry signal is inputted in .wav format. now i want to do short time fourier transform analysis of same signal inorder to find variations in fundamental frequency over the time and plot its "pitch contour". i.e. Fo v/s t. its like finding Fo value for each small interval and plotting over time to see the variability. pls, can anybody help me with the matlab code?


texts: Optimal time for sampling symbol in digital receivers

texts:
I'm studying various publications about symbol timing recovery algorithms, Early-late, Mueller and Muller & Gardner. All documents I've read tells that, to minimize ISI :

  The optimal time for sampling the signal is at the peak of the receiver matched filter

Looking at a real signal, it seems that a local peak is not always the right sampling time. For example, this figure shows the output of the receiver matched filter and the ideal sampling times :

In this example, the ideal sampling times are not always at local peaks of the signal. Are there special requirements so that the "optimal sampling time is at local peaks" or could you point me in the right direction to understand this particular point ?


texts: How to calculate the accurate BER expression of circular 8-QAM constellation modulation?

texts:
It is easy to understand the BER derivation of square QAM, but the circular 8-QAM? I'm quite confused. The decision region is not in a rectangular shape anymore, meaning regular way does not work here.
The constellation is like follows (from wikipedia)

Any suggestion or reference?


texts: Fourier series of $cos(\omega_0 t)$ in continuous time

texts:
Can any one please help me with understanding how we can calculate the Fourier series of Cos(w0t) using the formula:

I saw that they did the following calculus, but I Don't really understand how we calculate the integral of Xs[k] in this case:

It'll be so helpful if someone can solve it step by step.


texts: Difference Between Two Forms of Equations of Auto Regressive (AR) Model

texts:
I found equation 1 for Autoregressive model in various books and articles but I also found equation 2 for AR model, I understand the physical meaning of the equation but two different equations confused me a lot.

Can anyone tell me what is the difference between them and where one should use them?? I want to use AR equation for forecasting so which one should i use and why??. Both equations should yield different results because of the negative sign (which should just flip the actual signal i think so).


texts: A PID that can handle 2 inputs for my application

texts:
I am currently working on a Drone that navigates to different points that it detects on the ground. To go from one point to another in a smooth manner, I am employing a PID looks at the error between the current and the desired location of the drone. Currently this is a two dimensional problem. Soon enough, it is going to be a three dimensional problem as I will try and have the drone navigate three dimensional spaces. Now I am unsure as to how to program a PID that can take in more than one input and give an two outputs (which are x and y in this case for the Cartesian geometry the drone is trying to navigate).

Can someone take me through the exact theory behind a PID that approaches the 2D problem and different solutions that are possible. I also want to know about any solutions that are present in C++ that can help me speed up creating this program (other languages are also okay, but I am mostly building this project in C++).


texts: What happens to the phase spectrum when I resample?

texts:
[An update is added at the end of the post after receiving first response]
I have an algorithm which is very sensitive to phase shifts. It works with signal sampled at 40MHz (it's a neural network so actually the sampling rate is not very flexible)
I have a data sampled at 21.818e6 MHz and I resample it to ~40 MHz by:
sample_cnt = len(test_data)
Fs_org = 21.818e6
Fr = 40e6
resam_cnt = np.floor(Fr * sample_cnt / Fs_org)
test_data_re = scipy.signal.resample(test_data, resam_cnt.astype(int), axis=0)

test_data is sensor data with 1704 sample numbers so (1704,1).
When I look at frequency spectrum and phase response of the resampled data the frequency spectrum matches original signal (it's a bandpass signal with center frequency of 5MHz) but phase response for higher frequencies is flat (see image).

pyolt.figure()
pyplt.phase_spectrum(test_data_re, Fr, fc=5e6)
pyplt.phase_spectrum(test_data, Fs_org, fc=5e6)

Blue line is corresponded to the phase response of resampled data and orange line is corresponded to original data which is overlapped on the resampled data.
1- Is this resampling correct?
2- Is there a solution to create any kind of corresponding phase information for higher frequencies?
[Update]
I resampled same data with Matlab:
resample(test_data,2,1)

Then saved the data, loaded in python and compared two resampled signal (see image)

The blue one is the python resampled data and the orange one is the matlab resampled data
I do agree with @Hilmar that "When you re-sample you extend the frequency range, but the energy at these new frequencies (between 11 MHz and 20 MHz) is close to or exactly zero. That's the whole point of a "good" interpolation: make sure you don't add stuff that wasn't there before.
That means the phase at the new frequencies is either undefined or doesn't really matter since there is no relevant energy. If the magnitude is zero, it doesn't matter what the phase is"
Now it rises this question that how come Matlab is creating phase information in those frequencies?


texts: Is imadjust a Matlab-only library? If so, can it be replaced?

texts:
I want to apply a homomorphic process to an image, and one of the steps involves the imadjust function. The source of this code is http://www.csse.uwa.edu.au/~pk/research/matlabfns/

One of the steps in the homomorphic process is the histogram truncation. This is where toward the end, imadjust is applied like this

newim = imadjust(im,gv,[0 1]);

Unfortunately Octave doesn't seem to have this function, so I'm guessing it's a Matlab Image Processing Toolkit function. Is there a way to replace it? I haven't managed to find one that uses just two arguments, in addition to the image.

I found this imadjust.m but it has 4 arguments (image, in, out, and gamma)
Not sure how it's related to the one I'm using which is 3 arguments (image, gamma?/interpolated value, and two values array).


texts:
I have a signal with components at 1200 and 1800 Hz.  When I mix this signal with a 1500 Hz signal to create components at -300 and +300 Hz (then LPF) a DC offset presents itself when the input signal is going form 1200 to 1800 Hz at a period of 1200 Hz (msk modulated signal).  This strange affect only occurs with specific time vectors.  What could cause this?  I understand how mixing two signals at different frequencies create signals at f1+f2 and f1-f2 however where is this power at DC coming from?

Below is an image to show my problem:

The first signal is the MSK signal, the second is the 1500 Hz signal I'm mixing with it, the third is the result and the fourth is the filtered version of the result to recover only the low frequency parts.

The problem I believe lies in that at certain time offsets there exists an alias of 1500 at 300 (and -300) that is destructively mixing with my msk signal and producing a dc value.  The result in the center there when you see the dc value should be a series of half sine wave pulses at 300 Hz.

Is there a way I can avoid this problem and recover my +/- 300 Hz signal from the msk signal?


texts: What are the restrictions on DFT input sequences in order to produce valid spectral results

texts:
In a recent comment (as I understand it) our colleague OverLordGoldDragon’s stated that the only restrictions on DFT input sequences, to produce valid DFT spectral results, are that (1) the input sample values must be finite in amplitude and (2) finite in length. That sounds sensible to me.
Are there are other restrictions on DFT input sequences necessary to produce valid spectral results?


texts: How to Obtain Mathematically High Frequency and Low Frequency Component Separately Using Bilateral Filter?

texts:
I have asked this question before in the sense that what does a high frequency and low frequency component signify in a image and i got satisfactory answers now i want to know that how i can get high frequency and low frequency component separately from the image.

I mean what changes i have to make in the equations of bilateral filters and its implementation in matlab so that i can get both high frequency and low frequency component of that image.

Because in my experiment i need both the high frequency and low frequency component of a image.

Bilateral filters takes a weighted sum of the pixels in a local neighborhood; the weights
depend on both the spatial distance and the intensity distance.

The value of a pixel assigned is given as

$$
      BF[I_p] = \frac{1}{W_p} \sum_{\substack{ q\in S }} G_{\sigma_s}(\parallel p-q \parallel) G_{\sigma_r}(\mid I_p - I_q\mid) I_q
      $$

Do I have to make changes to this equation of bilateral filter to get high frequency and low frequency components separately .

What component does this equation signify is it the high frequency component or low frequency component ?


texts: Suggestions for FFT based tools to analyze music - Preferably MATLAB/free software packages

texts:
I am interested in analyzing full length songs for general features of the track which are not otherwise apparent. For e.g., I want to look at various parts of the song with time-frequency plots/wavelets/other signal processing tools for, lets say -  How does the frequency content of the song during the guitar solo compare to the part when only vocals are on? What is the frequency with which the guitar solo starts? What is its peak? ..and so forth.

Although I use FFT often for research, this is something I am fascinated by.... Any suggestions where to start?

At this point I have got WAV files for MATLAB analysis, since they have almost no loss. Where do I go from here? Any references to concepts/open source codes/literature etc. would be greatly appreciated.

Also, I am not into audio engineering or anything similar. Its just for my own interest.


texts: The Meaning of the Terms Isotropic and Anisotropic in the Total Variation Framework

texts:
The isotropic TV is defined as the estimation of 2-norm of gradients $\sqrt{(y_{i+1,j}-y_{i,j})^2+(y_{i,j+1}-y_{i,j})^2}$, while the anisotropic TV is defined as the estimation of 1-norm of gradients $|y_{i+1,j}-y_{i,j}|+|y_{i,j+1}-y_{i,j}|$.

Now I am wondering why the second one will be called anisotropic. Since from my perspective, the isotropic TV bounded the 2-norm of the gradient, and thus it can bound the norm of gradients for every directions. But for the second one, since the  absolute values are bounded, it means that the 2-norm of every directions can also be bounded. Isn't it also an isotropic way to bound the gradient?


texts: Gender classification using Periocular Region

texts:
I have a dataset of the periocular region, I have images of the male and female periocular region but they are only labeled as left and right periocular region, Folder is a mixture of male and female periocular region. One can not judge which one is of male and which one is of female periocular region.

According to biometric classification male and female have different periocular regions, so in short, I have only 2 different types of the periocular region (male and female) in my folder as the dataset.

How I can classify them that system automatically separates the feature of the male and female periocular region and train them as 2 different classes.


texts: How to model state space for complex valued system correctly in SIMULINK (MATLAB)?

texts:
When trying to use the default state-space model block, if there is a complex number valued in the matrices, there will be an error

To resolve that, firstly I need to look at pseudo reference model of state space on the internet

Then, create my own state-space block as a new subsystem

u is for input
y is for output
x is the state variable as an output (for sensing use, such as full state feedback)

And here is the inside

Now the problem is that,

The IC (Initial Condition) block cannot simulate what lsim
can done in matlab code, there must be an exponential decay expected
result for the unforced solution, but what I've got is that the
initial condition only happened at the exact t=0 and there is
no exponential decay.  How do I solve it?
The Integrator and IC block cannot operate with complex valued
number, the input and must be separated manually into real and imaginary
part or magnitude and phase part and then joined together again. Is there
any better way to operate them with complex valued number in simulink?
The gain block of A, B, C, and D matrix look ugly, I haven't been
able to change it in the shape of rectangle box as my reference
model above. Is there any way to change it?

Finally, if there is any better solution for my problem, such as pre-builtin complex valued state-space model, or better subsystem, I would be happy to know it


texts:
If my signal is

$$
f(t)=\exp[i\phi(t)],
$$
how do I show that

$$
\int_{-\infty}^{\infty} {\xi}\left|S_f(u,\xi)\right|^2 d\xi = 2\pi\int_{-\infty}^{\infty} {\phi'(t)}\left|g(t-u)\right|^2 dt,
$$

where
$$
S_f(u,\xi)=\int_{-\infty}^{\infty}f(t)g(t-u)\exp{(-i\xi t)} dt
$$
is the short-time Fourier transform of $f(t)$?


texts: How to recognize speech bubbles in comic strips (Ideally OpenCV)

texts:
I need to recognize speech bubbles to send to OCR and also to know where they are in the strip.
How could I do this with OpenCV?

I'm using OpenCV 2 and Python 3.6


texts: Demonstrate that $x(t)$ and $\hat{x}(t)$ are orthogonal

texts:
I have to demonstrate that a function $x(t)$ and his Hilbert's transform are orthogonal, it is said:

$$\int^{\infty}_{-\infty} x(t) \cdot \hat{x}(t) dt = 0$$

I have tried the exercise using Parseval's theorem:

$$\int^{\infty}_{-\infty} x^2(t) \cdot \hat{x}^2(t) dt = \int^{\infty}_{-\infty} |X(f) \ast \hat{X}(f)|^2 df = \int^{\infty}_{-\infty} |X(f) \ast (-jsgn(f)X(f))|^2 df =$$

$$= \int^{0}_{-\infty} |X(f) \ast jX(f)|^2 df + \int^{\infty}_{0} |X(f) \ast (-jX(f))|^2 df$$

Using properties of convoution ($ax(t) \ast y(t)) = a(x(t) \ast y(t))$:
$$\int^{\infty}_{-\infty} x^2(t) \cdot \hat{x}^2(t) dt = \int^{0}_{-\infty} | j(X(f) \ast X(f))|^2 df + \int^{\infty}_{0} |-j(X(f) \ast X(f))|^2 df =$$ $$=\int^{0}_{-\infty} |X(f) \ast X(f)|^2 df + \int^{\infty}_{0} |X(f) \ast X(f)|^2 df = $$
$$= -\int^{\infty}_{0} |X(f) \ast X(f)|^2 df + \int^{\infty}_{0} |X(f) \ast X(f)|^2 df = 0$$

But I don't know how to relationate both integrals. Maybe that isn't the way to demonstrate the exercise.

Thanks for your help.


texts: How to compute correct phase in FFT even after applying phase unwrap and zeroing round off error?

texts:
I am converting a time-domain synthetic 1D signal to frequency domain using MATLAB fft. In the frequency domain, the amplitude vs frequency plot is coming reasonable which means it is showing the correct amplitudes at the desired frequencies. But in the phase vs frequency plot, things are not coming any close to being reasonable.  It is showing incorrect phase values at the frequency values present in the fabricated signal. I have pasted my code here:
Ws=100;  % sample @ 100 Hz

T=10;    % collect data long enough for at least a couple cycles

N=T*Ws;  % compute number samples needed for above

t = linspace(0,T,N);  % and generate time vector

y = (2.2*cos((2*pi*4*t)+(pi/3)))+(1.4*cos((2*pi*10*t)+(pi/6)))+(0.8*cos((2*pi*16*t)));  % and a sample signal

subplot(1,3,1)

plot(t,y)

xlabel('Time(s)')

ylabel('Amplitude')

Y = fft(y)/N;                % FFT

PSD = 2*abs(Y(1:N/2+1));     % and the PSD one-sided

f = linspace(0,Ws/2,N/2+1);  % compute freq vector for Ws

subplot(1,3,2)

stem(f,PSD)                   % plot the result

xlabel('Frequency(Hz)')

ylabel('Amplitude')

Y2=Y;   %store the FFT results in another array

%detect noise (very small numbers (eps)) and ignore them

threshold = max(abs(Y))/10; %tolerance threshold

Y2(abs(Y)<threshold) = 0; %mask out values that are below the threshold

phase=rad2deg(atan2(imag(Y2),real(Y2))); %phase information

subplot(1,3,3)

stem(f,phase(1:length(f)))                   % plot the result

xlabel('Frequency(Hz))')

ylabel('Phase')

I am also attaching the plot which I got. Any help would be greatly appreciated.


texts: In voice recognition system, how to match digital input to a given word without seconds delay?

texts:
I've been looking around and found some great C/C++/Java libraries like CMU Sphinx or Windows SAPI. I did not like SAPI, and CMU Sphinx is way too complicated... would need months to understand how it works.

So I would like to start writing my own library, even it would be crap, but to understand all the parts how to recognize a word in real-time.

Now comes in my head a question,... how to match digital input to a given word? How to make it without seconds delay?

So what I understand is that I pass the input into buffer and I have to process it. First I try to create some spectrogram (time, frequency, amplitude) and then to use Fast Fourier Transform. In the database/list I will have stored words with their phonemes.

But how do I match these phonemes with FFT output? I simply do not understand all the steps.


texts: How does subpixel image shifting using DFT really work?

texts:
I am trying to assess the quality of several image interpolation methods for an application that involves generating subpixel-shifted images. I thought I could compare the results of a subpixel shift using all these interpolation variants with some perfectly shifted image, but it's probably not possible to obtain it (what would be the need for interpolation then?).

I was thinking about using DFT + shifting in the frequency domain, and I am unsure as to how it actually works in comparison to explicitly interpolating the image (using bilinear, bicubic, etc...). I'm sure it can't possibly generate a perfectly shifted image, but I can't put my finger on it. Is subpixel shifting with DFT equivalent to applying interpolation and if so, which one? What is the bias of the pixel values in images obtained using this method? Thanks!

EDIT:
After thinking the matter over, I figured since the FFT is an approximation (even more so the DFT) of the original function in terms of harmonics (sine functions), that it would amount to some sort of trigonometric interpolation. I recall a "Fourier series interpolation" formula for discrete data which was a trigonometric interpolation, but not sure if it's connected.


texts: How is a PCM byte converted to a voltage level?

texts:
16-bit signed PCM would have possible values of ~-32,000 to ~+32,000. How is this value converted to a voltage level for the speaker?

If a DAC outputs 5VAC, the values would be ~+-5v. How is the binary value, such as 1101101011011101, converted to a voltage level?


texts:
I am seeking for an advice on whitened matched filtering technique. I have looked into the literature and I do understand its the purpose and how to select the filter in order to achieve the desired response.

However, what I don't understand is that if the signal is matched to the channel filtered signal plus noise using the matched filter, and then if we apply the whitening filter, we get the inverse again which should actually be the channel filtered signal and noise. So in essence we end up where we started from.

I am sure I am missing something but any comments will be highly appreciated.

Thanks
Milos


texts: Noise modeling and reduction in Video when we have just noisy video

texts: We would like to send a video (sequence of images), we have limit bandwidth. If there is a lot of noise, the required bandwidth (bitrate) is needed to send the video+noise becomes high that is not suitable. We have just a noisy file (i.e. we do not have noise separately). The solution is to model the noise. we do not have any other information rather than a noisy video. How we can reduce the noise? How we can model the noise?


texts:
I am looking at trying to achieve a multi resolution STFT analysis on a log sine sweep audio measurement.

I have an impulse, and I would like to perform two different windowed length  FFTs on the impulse.

The shorter window length will determine the crossover frequency of the two results. So the this short windowed signal FFT will supply the complex result for x frequency and above.

The longer window will provide all of the results below x.  Although, I am trying to understand how to properly achieve this and synthesise the end result.  Do I need to low pass the longer window before the FFT,  if so, how do I achieve this?

And then how do I put the two results together?


texts: Smart way to read array from back in matlab?

texts:
Consider two arrays X&Y. How can you assign as shown below,

X(1) = Y(end);
 X(2) = Y(end-1);
...

Length of array changes with time.


texts: Need a fast algorithm of adaptive convolution

texts:
I have to apply some kind of adaptive filter to my function $f(x).$ I present each point of my signal as a Gaussian, whose bandwidth depends on its location (not the point of observation $\textbf{x}$) as $h(t),$ which is a known pre-calculated function. The final output function $s(x)$ is a superposition of the influence of all Gaussians (of all points).

$$s(x)=\int\limits_{-\infty}^{+\infty}f(t)g(h(t),x-t)dt$$

$g(h(t),x)$ is a $NormPDF(\sigma, x_0, x)$ with $\sigma=h(t)$, $x_0=0$

NB: the diameter of each Gaussian depends on the location of each Gaussian $t$, not on the location of observation point $x$.

It gives a good look of $s(x)$, but is calculates a bit too slow.

If I had a fixed-bandwidth filter, I could perform the well-known fast convolution algorithm via FFT. Or I could drop the faraway points and have the convolution as:
$$s(x)=\int\limits_{x-\Delta x}^{x+\Delta x}f(t)g(h(t),x-t)dt$$

But for the adaptive filter I should take my $\Delta x$ at least twice as large, as the maximum bandwidth is (in my case it is nearly 30% of all x area), so it cannot give a big profit.

Also, I don't know any algorithms of fast convolutions for such types of filters.


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

Question: Is it possible to filter a given image through a spectrum of pre-determined wavelengths? (i.e. Passing an image through a filter in which only 480nm, 560nm, 678nm, 714nm are able to pass through? The numbers here are completely arbitrary.)

Many thanks.


texts: Solving a Convolution Problem of a 1D Signal

texts:
I'm finding in trouble trying to resolve this exercise. I have to calculate the convolution of this signal:

$$y(t)=e^{-kt}u(t)\frac{\sin\left(\dfrac{{\pi}t}{10}\right)}{({\pi}t)} $$

where $u(t)$ is Heavyside function

well I applied the formula that says that the convolution of these two signal is equal to

$$Y(f)=X(f)\cdot W(f)$$

where $X(f)$ is the Fourier transform of the first signal and $W(f)$ is the Fourier transform of the second signal

well Fourier transform of $e^{-kt}u(t)$ is $$X(f)=\dfrac{1}{k+j2{\pi}f}$$

I have to make second signal as equals as possible to $\text{sinc}\left(\dfrac{t}{10}\right)$

so I do this operation:

$$\dfrac{\sin\left(\dfrac{{\pi}t}{10}\right)}{\left(\dfrac{{\pi}t}{10}\right)}{\left(\dfrac{1}{10}\right)}$$ this is equal $${\left(\dfrac{1}{10}\right)}\text{sinc}\left(\dfrac{t}{10}\right)$$

right or not?


texts: Super Resolution in Frequency Domain Using Compressed Sensing

texts:
To be noted that I'm very new to this topic, I would like to understand the fundamentals of how to get Super Resolution in Frequency Domain estimation using the Compressed Sensing Model.
I am also looking for some references and Python/Matlab code that can help me.
Thanks a lot in advantage and happy new year,
Luca


texts: How do optical anti-aliasing filters work from a frequency domain perspective?

texts: To prevent aliasing caused by the finite number of pixels on a sensor, a blurring filter is commonly used. How does that work from a frequency domain perspective? What is the transfer function of such a filter?


texts: How do I implement the delay of the Q-Phase Input in GMSK?

texts:
I am on a project to write a function in Java to perform GMSK modulation. I have a good understanding of the GMSK modulation block diagram to an extent, but I have a challenge on what it means to delay the Q-phase input by 90°.

Do I simply multiply my Q-phase bit stream by a negative sine carrier or what? Please, what is the correct thing to do?


texts: FFT, How to decide if there is a signal among noise?

texts:
I have sets of data of different deep sky objects. My job is to check for any periodicity.

I use IDL to run an FFT and wavelet methods to check for a signal. To test my code I ran the IDL built in FFT operation on a sine wave, my code works.

I then add noise to the sine wave and increase the noise until I cant distinguish the frequency peak in the FFT output.

My question is what mathematical method can I use to say 'yes there is a signal and this is its frequency' or 'no there is no signal' ? Can or should I get a percent of certainty ?

This post is very close to what I'm asking, but I only have one data set for an object so how could I make a ROC curve?: What statistic is used to determine presence of a signal in noise?

Also I think I dont want a ROC curve.
I will respond to any question you may have about my question. Thank you very much for your help. I am currently do research at UC Santa Cruz as an undergraduate.


texts: Standard deviation of the spectrum of white noise

texts:
I have a temporal signal which looks like $f(t) = t\eta(t)$, where $\eta(t)$ is a white noise with the mean $\eta_m$ and STD $\sigma$. I want to calculate the corresponding spectrum, $F(\omega)$, take its magnitude, $|F(\omega)|$, and finally compute the STD of $|F(\omega)|$ in terms of the given parameters. I have searched some literatures but I couldn't find anything which helps me directly tackle the problem. So, anyone know how to do this, or know which resources you would refer me to?

The following pictures display $f(t)$ and $|F(\omega)|$.

The one below is the histogram of $|F(\omega)|$ excluding some values around the central peak.

I want to derive a mathematical analysis which can compute the standard deviation of the above histogram.


texts: Principle of Mapper in frequency diversity in OFDM

texts: I am trying to understand frequency diversity in OFDM. An extra block 'MAPPER' is introduced in conventional OFDM transmitter to apply frequency diversity. Can anyone explain the principle of this MAPPER with its working and mathematical formulation. The transmitter and Reciever block diagrams are as shown below:


texts: A signal containing no pure sinusoidal components

texts:
I'm trying to decipher what exactly this statement means.  So if I have a signal which has no pure sinusoidal components, does that mean I can't decompose my signal completely into sine-waves which may be amplitude/phase/period shifted?  And so I would conclude that there is also like a saw-tooth component or a square-function component mixed up in the signal as well?

Saying that the signal contains NO pure sinusoidal component makes me feel like its decomposition should not include ANY amplitude/phase/period shifted sine-waves.. but that seems a little extreme.

Could someone clarify this for me?  Thanks.


texts:
I'm interesting in knowing more about different kinds of data representations that are used for speech data. I know of FFT, but not any others. More precisely, I have the 3 following questions.

What data representations for speech data?
What is considered the most 'raw' representation?
How has the use of different representations evolved over time?

Simply answering 1 or 2 of the questions would also be great. Thanks.


texts: Suitable signal processing techniques for frequency response functions?

texts:
Good day everyone
I have recorded experimental frequency response functions (frfs) for a loose bolt monitoring project. Please see figure 1 below for an example of the frf.

Figure 1
The purpose of my project is to determine if loose bolt conditions can be determined using vibration testing. I used a lapped beam made up of two plates, which are joined with 4 bolts in the following configuration (figure 2). The one end, (left hand side in figure 2), of the beam is fixed to a table vice to simulate a fixed boundary condition, while the other end, (Right hand side in figure 2), is free. Therefore, the beam boundary condition is fixed - free in a cantilever orientation. The beam was excited using a modal impulse hammer (instrumented hammer). The resulting vibration was measured using micro accelerometers positioned at different locations on the beam.

Figure 2
The following figure 3 shows the frf results of the loose bolt testing for one of the damage cases. The natural frequencies shift when the bolts become loose. The dashed blue line shows the condition when the bolt is fully loose. (I've focused on the high frequency range since this shows the affect of bolt looseness best).

Figure 3
I've plotted the frfs and plan on using a wavelet transform in the FRF, (using a scaleogram in python). Figure 4 shows my wavelet attempt so far. I'm using python as the program to apply my signal processing methods.

Figure 4
My question is, are there any other signal processing techniques which I could apply to the measured FRF's in order to show a difference from the healthy case, (Fully tightened bolts), to the damaged cases, (loosened bolts)?
In summary I'm asking, what signal processing can I complete on frfs to show possible loose bolt conditions?


texts: Single pole IIR filter, fixed point design

texts:
We want to do a fixed point implementation of the single pole IIR filter:

$y[n] = a\cdot x[n] + (1 - a)\cdot y[n-1] \quad ;\qquad 0<a<1$

What are the main design considerations to think about ? In particular, is the fixed point design more challenging for smaller a or larger a ?


texts:
Assume we have a series v[k] of length M=16. It's shifted to the right in a circular manner by k0=2 samples.

Which phase difference between the DFT spectrum of the original signal and that of the shifted version is to be expected?


texts: Does negative frequency actually exist or it is just theoretical?

texts:
This below questions gives good explanation regarding negative frequency

What is the physical significance of negative frequencies?

But I have one query

Does negative frequency only exist theoretically or does it actually exist in nature and can be measured?


texts: IIR coefficients that simply boost the signal

texts:
Is there a way to get IIR coefficients that only amplify a signal, nothing more? I suppose some phase shifting would be ok as well as long as it's not too noticeable.

Background: I am using a MiniDSP board and I'm attempting to use the filter section as a level booster to drive the sound into a compressor downstream. The MiniDSP allows you to type in whatever filter coefficients you want in the EQ section.


texts: Stabilizing an unstable system and removing oscillations from step response

texts:
I have a system with the transfer function given in this MATLAB code
num = [-2.341e07 -2.478e10 -1.393e12 -2.58e13 - 1.027e14 1.689e15 1.474e16 2.227e16];
den = [1 2474 1.451e06 2.622e08 1.544e10 6.874e11 2.656e13 5.294e14 4.09e15 8.13e15 3.771e15 1.122e13];
G2 = tf(num,den);

The system has 2 poles and 1 zero in the RHP. The poles are a complex conjugated pair.
ans =

   1.0e+03 *

  -1.7134 + 0.0000i
  -0.4939 + 0.0000i
  -0.2000 + 0.0000i
   0.0032 + 0.0424i
   0.0032 - 0.0424i
  -0.0375 + 0.0000i
  -0.0211 + 0.0000i
  -0.0117 + 0.0000i
  -0.0020 + 0.0000i
  -0.0007 + 0.0000i
  -0.0000 + 0.0000i

This obviously makes the system unstable, but how do I stabilize the system? I have read that you can cancel out poles in RHP by adding a zero in the exact same spot, however it was not recommended and I am not sure how you would do that when the pole is complex.
Looking at the root locus plot, however, shows me that if the unstable poles will move to the LHP with appropriate gain (the cyan and purple are the unstable poles):-

But the problem is, that if I add a gain high enough such that the unstable poles move to the left, then some of the poles in the LHP will move to the RHP in the process:-

Edit
I made it stable! I added this term $G_d = \frac{s+0.002}{0.002s+1}$ and also a gain of $Kp = 1.6 $ to the forward branch. The closed loop step response with unity feedback looks like this (the 1 at the top indicates a stable system):-

The next step is just to remove the oscillations and improve settling time.


texts:
I have sound files that contain recordings of an impulse signal in a room.

I'd like to make such a plot from it. I basically want to compare early reflections.

How do I go about it? Is just taking the waveform, pulling the absolute values and plotting it in bar/impulse form the right way? Or is this just an idealized form? If this is all wrong, could anyone point me towards the correct way of comparing early reflections in a plot form?


texts:
I'm working with data that looks something like this:

sec Hz amp
0.0 2630 0.001
0.1 2340 0.1
0.2 2220 1.0
0.3 2200 0.7
0.4 2200 0.2
0.5 2200 0.01

sec Hz amp
1.0 463 0.001
1.1 534 0.1
1.2 440 0.4
1.3 440 0.7
1.4 440 0.2
1.5 440 0.01

This data is for two separate harmonics. You can see that the frequency drifts a little with the attack of the note and that the amplitude beings to fade out towards the end of each harmonics. I'm not showing all the samples.

Here's what I'm doing to establish the relative loudness of these harmonic.

Harmonic 1 has a maximum amplitude in the frequency domain of 1.0.
Harmonic 2 has a maximum amplitude in the frequency domain of 0.7.
So there amplitude ratio is equivalent to 3.1 dB.

I now take into account that loudness is dependent on frequency and do so via the following table:

(freq,dbs)
(0, -50)
(20, -43)
(30, -33)
(40, -27)
(50, -23)
(60, -21)
(70, -19)
(80, -17)
(90, -16)
(100, -15)
(200, -8)
(300, -6)
(400, -6)
(600, -6)
(700, -7)
(800, -8)
(1500, -9)
(2000, -7)
(2200, -6)
(2500, -4)
(3000, -1.5)
(3700, 0)
(4000, -0.5)
(5000, -4)
(6000, -9)
(7000, -14)
(9000, -16)
(10000, -15)
(12000, -25)
(15000, -40)
(20000, -55)
(30000, -70)

Harmonic 1 has a frequency of 2200 Hz, which gives a value of -5 dB in the look up table.
Harmonic 2 has a frequency of 440 Hz, which gives a value of -6 dB in the look up table.
So that's a difference of 1 dB.

The total difference is then 3.1 dB + 1 dB = 4.1 dB. Right?

So a difference of 10 dB is equivalent to a doubling of loudness:

2^(dB/10)=increase in loudness, with
2^(4.1/10) = 1.33

So the first harmonic is approximately 33% louder than the second.

Am I on the right track with regard to estimating the difference in loudness? Any obvious mistakes. Any obvious improvements?


texts: Use of complex numbers to calculate Doppler effect?

texts:
First of all, I'm a beginner in this field, please tell me if any of what I'm asking is too basic / can be found with some google research.

I have a situation with a static TX and a moving RX (v is its velocity vector):

I know the value of $\vec{v}$ and the position of $TX$ and $RX$.

My goal is to simulate the Doppler shift that the $RX$ would experience, with the desired output similar to this:

so I ended up with the following equation:

$$ f' = \frac{c + v\cos(\theta)}{c}f $$

and I ended up with

(This is LOS, so I didn't consider reflectors, so no noise)

Question

This seems to work fine; however in some papers (and I have been told) that to apply the doppler shift to a signal, one must apply a rotation to it, so multiply by $e^{i\theta}$. Is this useful / necessary for Doppler ? In which cases should I use it ? How ?


texts:
I am trying to implement this research paper:

I understand everything in the paper except the part about the nearest neighbors calculation (section 3).

The only MATLAB function I can think of that makes sense with this research paper squared euclidean distance is the pdist2 function. It would give me the D matrix.

Assuming I am correct, but what is the input to the pdist2 in terms of X and Y? Research paper mentions 100 nearest neighbors and sorted in ascending order, I am assuming this:

[D,I] = pdist2(X,Y,'squaredeuclidean','Smallest',100);

and X and Y is the magnitude spectrogram of the mixture signal. X = Y ?

Also, after I get D matrix, the paper mentions a P matrix of size n x p, I am not sure how to get that matrix from the previous calculation.

After I get that P matrix, I can do the rest of the research paper. So basically, I am just trying to figure out the nearest neighbors calculations D and P.

The author used MATLAB, and I would be happy if someone can provide MATLAB code for this nearest neighbor calculation, just like in the paper.


texts: Detecting changes in signal due to server delay

texts:
I'm currently working on an application that can be used to determine when a signal changes due to a server delay. Essentially, I have an API that is used to output data to a UI. However, for reasons I have yet to discover, there is the occasional lapse in server service, resulting in my API simply transmitting old data to the UI resulting in small intermittent flat-lines.

The above is a sample of one of the signals, where each color represents a days worth of data, and I'm getting a data point every 5 minutes. As you can see, in the middle, the data is being delayed. Note that all signal segments have the same number of data points; the data in the bad sections is simply repeated.

Does anybody know of an effective metric to distinguish between the bad and good signals? I need to be able to look at the data sample for a single day and determine if its bad or not. My first thought was to look at the frequency spectrum (Fourier Space) and see what the frequency distribution is like, but I cant seem to be able to isolate any one reliable metric.

Any Help is greatly appreciated!


texts: Differences between Matlab resample() and CMSIS decimate_f32()

texts:
I am pretty new to DSP and I need some help to pinpoint my mistake.

I am using Matlab to simulate an embedded environment. I have three signals all centered on 50Hz (6.4KHz sampling rate) which have no offset or harmonics in them. I generate such signals and write them to file using a trusted program. All signals have the same magnitude and frequency content (ie only 50Hz signal) but are 120 degrees apart. Signal 1 starts at zero degrees, second signal is at 240 degrees and third at 120 degrees.

The Matlab signal chain starts with the opening (/dumping) of the file which contains the AC signals. Decimation of the signals is performed using resample() from 6.4KHz down to 1.6KHz (Decimation factor 4), followed by an FFT on a full signal cycle. From the fundamental component (50Hz) the RMS-Magnitude is calculated.

On the ARM Cortex M7 platform now, in a very similar manner as above, I have the same signals written in flash memory. I zero pad at the end of my signal data block to compensate for the FIR group delay. I then decimate the signals using CMSIS arm_fir_decimate_f32(), with filter coefficients generated from Maltab Filter Designer, floowed by a left shift to compensate for the FIR group delay. I then perform an FFT using arm_rfft_fast_f32() on a full signal cycle. Finally, from the fundamental component (50Hz) the RMS-Magnitude is calculated.

I was expecting the Magnitude estimation of the embedded signal to closely match that of the known generated magnitude (/Matlab estimation). However, I am finding the magnitude estimation on the embedded platform to be slightly off when compared to the signal magnitude I know I am generating.

Signal 1 is ~+0.4% (higher), signal 2 is ~-1.7% (lower) and signal 3 is ~-2.03%.

My best guess at the moment is that this discrepancy lies with a mistake I have made with regards to the arm_fir_decimate_f32() filter coefficients. As far as I can tell Matlabs resample() uses the firls() function to generate coefficients.

I have used the same firls() function to generate the coefs, from filter order 20 up to 80 but still get this discrepancy.

Typically I am using Fpass: 160Hz, Cut-off frequency (Fstop): 800Hz, Apass: 0.1dB, Astop: 106dB (ADC SINAD value).

Does resample() compensate for the FIR response?

Any help much appreciated.

Thanks
Alex


texts: Nyquist theorem vs sampling theorem vs shannon sampling theorem?

texts: Is there any difference between these three?or these are just three names of same theorem?


texts: Generate loopable sine wave cycle for given frequencies

texts:
I am somewhat new to DSP so bare with me. I am working on a simple wavetable oscillator. What I am trying to do is generate one cycle of a wave form for each note (frequency) and store it in an array for later playback. I know I could generate one frequency, store it and resample to the other frequencies in real time but I'm looking for performance and I'm still learning so I'm trying to keep it simple for now.

In my first attempts I was able to generate one cycle of a sine wave at each frequency but when I went to play back the stored wave forms the frequencies were off by 0.5 - 0.10 hz or more and had a noticeable clicking noise when the cycle repeated. I know this is because the start and end of the wave form are not lining up on 0. I've been struggling to solve this problem.

Below is my most recent C# code I use to generate and store the sine wave. This will produce more cycles but seems to fix Hz variance I was getting with just generating one cycle. The only issue that remains is the clicking when it loops back. I may be going about this completely wrong so any suggestions would be greatly appreciated.

double frequency = 440.0; //A4
double sampleRate = 44100;
double numSamples = sampleRate / frequency;
double phase = frequency / sampleRate;

int j = 0;
for (double i = 0.0; i < numSamples; i += phase)
{
    double sample = Math.Sin(i * 2 * Math.PI);

    sineWaveTable[j] = sample;

    j++;
}

I'm not sure if it's even possible to generate a single cycle of a sine wave for each note and have it start and stop on 0. If not, am I stuck with having to use resampleing to get the other desired notes?


texts:
I want to calculate the loudness of a given signal and I've come across this thread. I'm slightly confused about the A-Weighting aspect of it. I can't post images, but I think this site has the formula I need. (Wa = 10log...)

What I don't understand is how to actually use it in my program. If the f stands for frequency, then presumably I can hardcode the values since they will remain constant. If that is the case, how do I apply Wa to my sample values and what values do I use? Do I calculate the power spectrum to get WINDOW_SIZE/2 values and multiply each value in the frequency band with relevant precalculated Wa value or is that the wrong way of doing it? Thank you in advance.


texts: Out of memory problem with filter design tool in Matlab

texts:
I have a set of data in excel like this:

column A is time in ns and column B is the electric field strength.
now I want to convert the time-domain signal from these data to a frequency-domain signal with DSP toolbox in matlab.

to calculate Fs (sampling frequency) in order to use in signal analyse i use this formula:

time = T(:,1);
L=2033;
Ts = mean(diff(time));
Fs = 1/Ts;

which leads to :

Fs= 5e+09

then I import the signal (E) with sampling frequency Fs in signal analyze toolbox.
my signal is like this:

now i want to apply a bandpass filter in 16-32 MHZ range , so :

I've increased the paging file to maximum on my system with no success!
I should say that my system configuration is like this:

i5 CPU at 2.5 GHz

8 GB R3 Ram at 1600 MHz

I have two specific questions:

1- what should I do? Is there any thing that I should do to to be able to design the filter on my system?

2- if I change the time to second and the frequency to hz , how much does the results change?


texts: Can I run a GA to optimize wavelet transform?

texts:
I am running a wavelet transform (cmor) to estimate damping and frequencies that exists in a signal.cmor has 2 parameters that I can change them to get more accurate results. center frequency(Fc) and bandwidth frequency(Fb). If I construct a signal with few freqs and damping then I can measure the error of my estimation(fig 2). but in actual case I have a signal and I don't know its freqs and dampings so I can't measure the error.so a friend in here suggested me to reconstruct the signal and find error by measuring the difference between the original and reconstructed signal e(t)=|x(t)−x^(t)|.
so my question is:
Does anyone know a better function to find the error between reconstructed and original signal,rather than e(t)=|x(t)−x^(t)|.
can I use GA to search for Fb and Fc? or do you know a better search method?
Hope this picture shows what I mean, the actual case is last one. others are for explanations

Thanks in advance


texts: I´d like to use some OCR algorithm (Image to Text) into an Android app (Java). I have previously used several algorithms but for a PC (Matlab) app. Which library or algorithm should I use? Computational cost and response time are important issues.


texts: Valid approach to implementing a band pass filter

texts:
Suppose I want to perform Spectral shaping on a signal, i.e, modify the gains in a band of frequencies. Would there be any difference if I do that using the following two methods? -

Use a band pass filter to apply the gain in the band.
Calculate the bin numbers corresponding to the band, and apply the gain in those bins.

I'm interested to know if the second method is a valid approach, if not, why is it discouraged?


texts: Viterbi decoder on a bit stream where the preamble is also coded

texts:
I hope this is not off-topic for this site.

In my problem, Viterbi decoder is used for decoding convolutional-coded (rate = 1/2, constraint length = 7) messages.

A message is 250 bits where the first 8 bits are 1/3 of a preamble. There are several types of messages. A message is received as 500 bits because of the coding, which means, the preamble is also coded.

Since there is no place marker other than the coded preamble, I am in trouble with finding the first bit of the 500 bits to start decoding.

I would really appreciate any suggestions and comments.


texts:
How do you show the Discrete Time Fourier Transform of $x[n]=\cos(2\pi f_0n)$ is $ \frac{1}{2}  \delta(f+f_0) + \frac{1}{2}\delta(f-f_0)$?

Here is my thought process:

The definition of DTFT in my textbook is:
$$X(f) = \sum_{n=-\infty}^{\infty} x[n] e^{-j2\pi fn}\quad\text{for}\quad \frac{1}{2} \leq f \leq \frac{1}{2}$$

Therefore for this specific problem we have:
$$X(f) = \sum_{n=-\infty}^{\infty} \cos(2\pi f_0n) e^{-j2\pi fn}$$

I know from Euler's identity that
$$\frac { e^{i\theta} + e^{-i\theta}}{2} = \cos\theta$$

So we can convert the cosine above into the complex exponential like so:
\begin{align}
X(f) &= \sum_{n=-\infty}^{\infty} \frac { e^{j2\pi f_0n} + e^{-j2\pi f_0n}}{2} e^{-j2\pi fn}\\
&=\sum_{n=-\infty}^{\infty}   e^{-j2\pi n(f-f_0)} + e^{-j2\pi n(f+f_0)}
\end{align}

This looks very close to the $\delta(f+f_0) + \frac{1}{2}\delta(f-f_0)$ I'm looking for - but I'm not sure how to get there.


texts: converting digital length to physical length using reference object

texts:
I am trying to find actual length of an object, say X, from an image. For that I'm using a reference object , say Y, ( object of known dimensions ). From image while converting pixel length of X to physical length, using reference object dimension , it is consistently resulting in error b/w 1.2 inch to 1.6 inch.

I am using one frame of 60 inch * 48 inch as a reference object and actual object is placed inside the frame.
My formula is actual length of X = pixel length of X * actual length of Y / pixel length of Y.I am using overhead camera of 13 MP. what can be the reason of error ? and how to reduce this within 1 inch ?


texts:
I wanted to know what are the well-known methods of scaling the FFT power of a signal? I am referring to EEG signal but this should apply to all signals I guess.

I need to plot the powerspectrum/PSD of frequencies but without correct scaling lower frequencies are prominent while higher frequencies are not.

What are the math formulas? (i.e.: 10log10(power))?


texts: I have a matlab code for OFDM system, in this code the auther added a zero padded subcarriers before the IFFT stage, in the middle of the raws, and added zero padded guard interval after IFFT, my question is that why i need to add zero padded subcarriers and what is the relation between the number of null subcarriers and sampling frequency??


texts: Discrete signal power. Does it depend on sampling frequency?

texts:
I`m confused on how to calculate a signal power. For example, suppose I generate a complex: signal $$x[n] = (1 + j3)e^{j2 \pi k n/N}$$

The DSP theory says the average power of a periodic signal with period $N$ is:
$$ \frac{1}{N} \sum \limits_{n=0}^{N-1} \left| x[n] \right|^2$$

Does that mean the signal power is independent of its sampling frequency? For example, suppose I have these $N$ samples within 2ms and another signal with these $N$ samples within $1ms$. The above formula for average power yields the same result, although from a continuous time perspective the second signal would present the same energy in less time, which would mean more power.

Is it correct?

Suppose a want to generate a signal with a given power in Watts and assume the sampling frequency is given, how should I control the signal power (through normalization), using the discrete signal average power formula or considering symbol period (in seconds)?

Thank you


texts:
I am designing a schematic in which a Counter is to be increased whenever a particular band of frequencies is received at the Audio input.
We are receiving the audio input as electrical Signal and I have already designed the bandpass filter with the required passband. How can I design the Counter for the same purpose?


texts: Fixed point multiplication with negative numbers

texts:
I am stumped on a simple problem. Let's say I have two 4 bit numbers in Q0.3 format. One sign bit and three fractional bits. So I can represent $-1$ through to $0.875$.

Let's now say I wish to do this calculation: $-0.25 \times 0.875$. Which is:

$$
\frac{-2}{2^3} \times \frac{7}{2^3}
$$

Which means I am multiplying $1110$ ($-2$) by $0111$ ($7$). Of course the answer is $-0.21875$ or $-0.25$ using the closest Q0.3 number.

Let's do the working.

$$
1110 \times 0111 = 01100010
$$

which when viewed as a Q0.6 number is $1.100010$, which is $-0.46875$ by my books. Why is this incorrect? I expect an answer of $1.110010$ ($-0.21875$).

What have I done wrong?


texts:
For a flat fading channel (SISO system) we have:
$y=h \star s+n$

But for a mimo system, we have:
$y=Hx+n$ with $H \in \mathbb{C}^{N_r \times N_t}$

Why is there not the product of convolution for a mimo system?


texts: MMSE- Channel estimated based - DFE Equalization

texts:
For HF ionospheric channels ( frequency range 3 up to 30 MHz), I Want to make channel equalization in time domain, using MMSE criterion. I have to do it using the channel estimation.

I have some questions:

Can some one elaborate more on the closed-form solution solution for the feedforward and feedback FIR filters ?
And what is the exact relation between the number of taps of the filters and the channel delay spread ?

Any help will be really appreciated

Thank you


texts:
Both of zernik moments and Local binary pattern (LBP) are feature detectors and can achieve rotation invarient.

How can they achieve rotation invarient over an image?

What are the advantages of applying zernik moments to an image?

What are the advantages of applying LBP to an image?

What is the computional cost of each one?


texts: Why should the cut off frequency and the transition bandwidth (BW) be expressed as a fraction of sampling rate?

texts:
I came across this confusion in Chapter 16,"Book - The Scientist and Engineers guide to DSP" and Topic is "Windowed Sinc-Filters". I am doing some calculations for designing the sinc filter and came across these doubts:

                               M = 4/BW

where "M" is the filter kernel length and "BW" is the transition bandwidth. The author says that "The BW must be expressed as a fraction of sampling rate with a value between 0 to 0.5 and same goes with the cut off frequency". For the values of M = 20, 40, 200, the BW is 0.2, 0.1, 0.02 and like we can see, it satisfies the condition of 0 to 0.5.

After I searched online, I understood that the value of cut off frequency and BW to exist between 0 to 0.5 has to do something with the power (dB) and presumed that 0 is 0db and 0.5 is -3 dB, since 10log(0.5) = -3dB.

My question is, what is the relationship between the cutoff of frequency and BW being a fraction of the sampling rate and between the values 0 to 0.5? What does it mean?. Is it something to do with the frequency components present beyond the cut off freq or BW being attenuated?

For example: If my sampling rate is 100sps, so the cut off frequency and BW must be a fraction of 100 sps with a value between 0 to 0.5?


texts: Where does homomorphic filtering stand in regards to DSP applications?

texts:
I am studying my Oppenheim and Shaffer book, (New Edition), and the last chapter deals with something called homomorphic filtering. I have read the wiki and some other websites about it, but they do not really delve into details on applications. Moreover, I have almost never heard of it be brought up in discussions or recent papers, etc.

So what are some applications of this processing, and why/how is it so quiet out there in regards to it? Is it because it has been overtaken by more advanced techniques, or is it just too clunky or some other reason? Have you used it before, if so, for what purpose?


texts: Find impulse response and frequency response through given filter

texts:
I cannot find anything truly helpful in my book, and I find mostly theoretical answers and not practical.
So I am posting the exact exercise I want to solve, and through it I hope I'll work some things out.

Our data is that we filter voice/speech signals with this filter:
$y(n) = x(n) - 0.8 x(n-1)$

a. What's the impulse response of the filter
b. What's the measure of the frequency response of the filter, in dB, on the frequency $2000 Hz$. The sampling frequency is $Fs = 16000 Hz$.

I started doing this:

$y(n) = x(n) - 0.8x(n-1)$

$Y(z) = X(z) - 0.8X(z^{−1})$

$Y(z) = X(z) [1 -0.8z^{-1}]$

$H(z) = Y(z) / X(z) = 1 - 0.8z^{-1} / 1 = 1 - 0.8z^{-1}$

But I think I'm not there at all. And I actually don't get the first step where $y(n)$ becomes $Y(z)$ etc. Why do this?
And how do I now if I have a FIR or an IIR? [and what does this affect?]


texts: Channeling two named PIPEs with a GNU Radio flowgraph | String transmitted on one end does not reach the other end

texts:
1)
I created two named PIPEs:

$ mkfifo pipe_in
$ mkfifo pipe_out

2)
Then connected pipe_in to pipe_out with the following GNU radio flowgraph:

File Source config:

Repeat: No
Vec Length: 1 (default setting)
Add begin tag: pmt.PMT_NIL (default setting)

File Sink config:

Unbuffered: Off
Vec Length: 1 (default setting)
Append file: Overwrite

3)
Finaly, I start running the flowgraph, then write a string to pipe_in hoping to see it reach pipe_out by running the following two commands in separate terminals:

TERM2 $ tail -f pipe_out

and

TERM1 $ echo 'hello world!' > pipe_in

Unfortunately the string never reaches pipe_out. Can someone shed some light please?


texts: best window for close frequency components

texts:
I'm currently designing a receiver which has to determine whether a signal contains specific frequencies or not. The frequencies are at constant 215Hz difference:

{16,351  16,566  16,781  16,996  17,211   17,426  17,641  17,856  18,071}

I sample at 44100kHz and I have 1024 samples each time. Therefore my resolution is 44100/1024=43.06Hz, and the bins centers are multiples of 43.06:

Bin[1]=43.06Hz,... BIN[385]=16578.10    BIN[386]= 16621.16
BIN[387]=16664.22    BIN[388]=16707.28     IN[389]=16750.34
BIN[390]=16793.40    BIN[391]=16836.46    BIN[392]=16879.52
BIN[393]=16922.58    BIN[394]=16965.64    BIN[395]=17008.70
BIN[396]=17051.76    BIN[397]=17094.82,....

My algorithm is based on comparing the values of the desired bins (or the nearest ones) to the values of the bins in between.
for example, if I wish to know if 16,566 exists or not, I compare BIN[385] to BIN[386],BIN[387],BIN[384],BIN[383] and if it's value is significantly larger (say by a hundred) then the average value of the side ones then I conclude that this frequency does exist.

My question is as follows: considering the fact that I work in high noise environment, and the algorithm I use is the one above, what would be the best window for me to apply before the FFT, other than the obvious rectangular window I currently use.

Thanks


texts: How to cover all spectrum in wavelet when it which is behalved?

texts:
As I know , wavelet decomposition behave with halve.
I mean that a way like this HH HL LH LL.

But I wonder, how to corver the all spectrum when it was halved?
I think if it want to all cover spectrum then it might be needed infinity halve.

How can cover all the spectrum?


texts: CoeffFracLength negative or larger than the CoeffWordLength [Fixed-Point Filter Properties in Matlab]

texts:
I have been reading the fixed-point filter properties in Matlab and I have found that the parameter "CoeffFracLength" can be either zero, negative or positive. And also, it can be larger than the associated word length "CoeffWordLength".

I understand the fractional length as the number of bits designed for the decimal part of a number. I can't visualize how the fractional length can be greater than the word length itself, or a negative value.

I suspect that I am misunderstanding the concept "fractional length". Could you point whether I am wrong with an explanation and providing an example, please?

Answer in this link: mathworks.com/help/simulink/ug/fixed-point-numbers.html


texts: Inverse Fourier transform of $\frac{\frac{2}{1+2i\pi f}-\frac{2}{4+2i\pi f}}{\frac{1}{1+2i\pi f}+\frac{1}{3+2i\pi f}}$

texts:
I wanted to calculated the inverse fourier transform of the transfer function :
\begin{align}
H(f) &= \frac{\frac{2}{1+2i\pi f}-\frac{2}{4+2i\pi f}}{\frac{1}{1+2i\pi f}+\frac{1}{3+2i\pi f}}\\
&\text{
I did some simplification :
}\\
&= \frac{3}{4}\left(\frac{1}{2+i\pi f}+\frac{1}{1+i\pi f}\right)
\end{align}
and after applying $\mathcal{F}^{-1}\{H(f)\}$ I obtained
$$ h(t)=\frac{3}{2}\left(e^{-4t}+e^{-2t}\right)u(t)$$ $$(this\ formula\ is\ corrected)$$
I used the fact that $$\mathcal{F}\left\{e^{-at} u(t)\right\}= \frac{1}{a+2i\pi f}$$
where $ u(t)$ is the unit step function.
Can I get some help to know if my process is correct?


texts: Effect of window function on audio output

texts: If I have a low pass filter, does the choice of window function I use have any effect on the quality of the audio input? What would be the effective difference between using a rectangular window and a blackman window of the same size?


texts:
I trying to build 27 points long median filter on FPGA using Verilog. The filter is 1-D (used to clean noise from a spectrum - I want to clean some random peaks).

I already built an 9 points median filter using this paper.

Now I want to build a 27-point median filter using the same algorithm presented there but to extend it to 27 input points, I tried to extend it but faced a failure in the implementation and the complexity was too hard.

Does it seem possible to extend the algorithm there for 27 - 54 median filters?

Is there is some efficient algorithm for long median filters for HDL? (27~54 points)


texts: Kalman filter to filter noise from acceleration data

texts:
I would like to apply a Kalman filter to remove noise from my measured acceleration data. The idea is then to compare the results obtained in this way whit the results obtained by applying a low-pass filter.

So, the Kalman filter equations are the following:

$x_k = Ax_{k-1}+q_{k-1}$

$z_k = Hx_k+r_k$

where $x$ is the state vector, $A$ is the transition matrix, $z$ is the vector of measurements and $H$ the observation matrix. $q$ and $r$ represent the process and measurement noise respectively.

Since I am working with one signal only (acceleration), the state vector $x$ is actually a scalar entity and so are all the other terms in the previous equations. In my case I had $A = 1$ and $H = 1$.

My understanding of the Kalman filter is that it computes an estimate of the input signal, therefore it is not a proper filter. So what I have to tune to smoothen the measured data is the $Q$ value (process noise covariance) in order to change the way in which the signal is estimated. The idea is to have a "worse" estimate in such a way that the peaks introduced by the noise are removed from the signal (which means the filter follows the original signal less accurately).

Is this the correct way to procede?


texts:
I am working on a scientific application where I would like to evaluate luminance in an image, however I am unsure if what I receive from my setup is luminance (Y) or luma (Y'). I use a camera with a TOSH IK CU51 (PAL) control unit which is connected via S-Video to a Canopus ADVC-300 analog to digital converter. The digitized data are streamed to a computer and presented in YUV2 format.

Now the problem: I read into luminance and luma and realized that I do not know if gamma compression is applied somewhere on the way between the camera and the computer, so that really I am getting Y'UV2 instead of YUV2, is there e.g. a definition for a PAL signal to be gamma compressed and for an S-Video signal not to be corrected?

Edit: As there are no answers yet, I think I should be more specific: Is there any flexibility in the PAL or S-Video standard or in how a device is generally expected to work where I would have to take gamma correction into account?
A little more background: luminance is proportional to energy per spatial area. If gamma correction were applied then I'd get a somewhat distorted value. If I knew gamma, I could adjust for this.


texts: Granular synthesis of a periodic waveform - How to derive grain start and end point

texts:
I understand to find the length of the grain I need to perform an FFT over the source to find the fundamental harmonic, I can do that and find an accurate grain length, but now I need to find a start and end point of each grain and I'm not sure how to decide how to do it.

From what I can think of I have the following options

Always cut at the zero cross over point, ignoring the accurate grain length.
Cut the first grain at zero, from then on rely on the FFT information to cut accurate grain lengths and hope each start and end will be close to zero.
Find the centre of each grain using an average of amplitude, then use the accurate grain length (this would put duplicate data in grains next to each other, as each grain would not care where the last grain ended, this doesn't seem right)
The above but guarantee each grain starts where the other ended, and sacrifice both zero crossover AND grain length
Nothing, just use grain length and not care about zero crossings or being anywhere near them.


texts: When modelling noise,how do they decide whether additive or multiplicative?

texts: How does one take a decision of whether noise is additive or multiplicative?


texts:
This question is regarding two view geometry where a point lying in the image plane of the first frame/ position of the camera is mapped onto the image plane of the second frame/ position of the camera. This mapping is done with the help of Fundamental Matrix, $F$.

The rank of the Fundamental Matrix is 2 and I am trying to understand why. I have seen this question and answer. But that's not the perspective I want to discuss.

The book Multiple View Geometry in Computer Vision says:

  Geometrically, F represents a mapping from the 2-dimensional
  projective plane $P^2$ of the first image to the pencil of epipolar
  lines through the epipole e . Thus, it represents a mapping from a
  2-dimensional onto a 1-dimensional projective space, and hence must
  have rank 2.

1) My understanding was that the pencil is a family of planes passing through epipoles which rotates about baseline depending on the 3D point for which it is considered. What is a "pencil of epipolar lines"?

2) Depending on the point considered in a 2D plane, in the first image plane, the Fundamental matrix will map it into a line in the second image plane. But different 2D points can be mapped to different lines. So, the 2D projective plane is being mapped into a set of lines, not just one line. Why is that a mapping to 1D?

3) How does this change in dimension relate to the rank? Shouldn't rank be related to the output dimension?


texts: Why is there little emphasis on phase distortion?

texts:
I have a question regarding the frequency response of digital filters. Specifically the phase aspect of the frequency response.

Why do we not seem to care about the nonlinear phase response in certain applications?
Is it possible to correct the phase distortion if we are filtering offline (i.e. not in realtime)?
Given that we have a model of our filter, can we take the outputted phase distorted signal, and then individually shift the frequencies within the signal?
It also seems that for applications where we can't allow phase distortion, we often implement FIR filters. What are some applications where FIR filters would be absolutely necessary? Essentially anything being filtered in realtime?


texts:
So I am working on a project where we are supposed to detect and count the red and gold ornaments in the picture provided in the link below. I am having issues detecting and counting each ornament and cant seem to figure out why. I will outline my process:

1) input image and convert to grayscale then binary
2) using a disk structuring element perform a closing operation to remove the areas around the ornaments.
3) use a method to detect the circles (No problems here I think the main issue is in 2).

Is there a better way for me to isolate the red and gold ornaments? I just need a pointer in the right direction as I have tried a variety of things and none of them seem to work so I am starting to panic. I am working on this project in MATLAB and have included the current output below.

http://www.deviantart.com/art/Xmas-tree-png-3-HQ-large-398885414


texts:
I'd like to design a Digital Differentiator with a pre-specified lowpass characteristic.

I've tried Wiener Filters (using inverseFFT to transform from frequency to time-domain), Savitzky Golay and others. Intuitively, I've come to the conclusion, that by specifying DFT points, i.e. uniformly distributed samples of the frequency response, one can achieve only a maximal low-pass frequency. For example using $N$ points, the minimal lowpass frequency would be $1/N$ bins of the FFT, thus $\pi/N$ $rad/sample$.

Is this notion correct?

And further along this path: if it's true, is this a universal boundary, or are there methods, where one can implicitly or explicitly specify not-equally sampled frequency points and thus achieve lower stopband frequencies with FIR filters?

For IIR filters I think this is no problem, since with a simple $1/(z+a)$ one can choose $a$ to achieve a variable stopband frequency just as in the continuous case.


texts: Amplitude and Phase spectrum of a signal


texts:
I have been attempting to make a basic, slow, DFT in Matlab and have noticed peculiar behavior that I don't understand.

I have been trying to plot the phase of a 100Hz sinewave captured at 250kHz sample rate with a record length of 10k points. I find that the real part of the DFT is negative at 100 Hz, which I think makes sense due to a sinewave having negative correlation with a cosine wave. However, the imaginary part at 100Hz is also negative, which again makes sense because a sinewave is shifted -90 degrees from a cosine wave.

When I take the inverse tangent of the real/imaginary, obviously this is a positive number. Resulting in a +90 phase shift instead of a -90. Am I misunderstanding something, or do I just have incorrect results?

edit: I've realized the issue is that due to spectral leakage and the fact that this operation there are non-zero magnitudes that need to be filtered out before calculating the phase.

Is there a good way to choose a threshold for when to zero out DFT results? It seems a hard value to choose as if I throw in an arbitrary waveform then I have no information beforehand to choose a proper threshold value. My initial idea is to calculate the bin size based on the time length of the input, and then use a lookup table to change the threshold to be 10%, 1%, 0.1%, etc, of the maximum magnitude in the DFT.


texts: Different approaches for partial image derivation


texts:
I have a mixture of Gaussians and I want to look at their power power spectrum. The spatial distribution looks like this:

It's already been convolved with a Gaussian window function. I subtract the mean over all values and run an FFT in matlab.
For the power spectrum I used $|\mathcal{F}|^2 $ and the image under is a section through the middle of the 2D phase space.

The zero phase component is orders of magnitude bigger than the rest of the spectra; given the nature of the problem I expected the power spectral density to look like a combination of Gaussians.

Edit:
The data is initially given as a bivariate poisson process, defined on $ \mathbb{R}^2$. The weights are assumed to be equal and the Gaussians are equally spaced on a hexagonal grid. Now, I'm supposed to estimate the variance of the Gaussians, and wanted to do it using the empirical characteristic function,because the modified EM doesn't work well with data (I guess it's because sample is relatively small ~300 points in total). Following supervisor's suggestion, I estimated a density using Gaussian kernels, and then ran the FFT.
Concerning the Matlab implementation:
The 2D spatial density matrix is 'x'

nfft= 2^(nextpow2(max(size(x))));
fftx = fft2(x,nfft,nfft);
mx = abs(fftx)/length(x);
mx = mx.^2;

I selcted arbitrarily a section and plotted plot(ffshift(mx(2048,:)))

Edit2: I added a link to the data.
https://www.dropbox.com/s/y5sgz0ataxe9z3s/FFT_problem_DataSet.mat