texts:
I am developing a project where I must analyze an incoming signal that was acquired from a microcontroller. The objective is to obtain the main frequency of the incoming signal.

At first, I’m analyzing an RC step response signal. So, basically, I want to obtain the frequency response, from the characteristic charging curve of an RC circuit.

My mentor told me that I could achieve this with the FFT. He told me that if I applied it twice at the incoming signal, I would obtain the frequency response curve. I think I did, but my only issue is the frequency axis. They’re completely messed up. Even when I apply the method to obtain the frequencies, it goes bad. (I know it's wrong because my cut-off frequency is around 11 Hz)

https://drive.google.com/file/d/1-ppjp6qE8J8O96Lj4uaJx36o2pt3KMSG/view?usp=sharing

So, what I’m asking is:

Why is it that applying the FFT twice to the signal give the frequency response?
Does anyone know how I can obtain the correct frequency axis?


texts:
I need to find the timedelay between two signals.  I guess MSE is the best approach. How to find that MSE?  I am writing the code and I have access to the autocorrelation matrix of one signal and the crosscorrelation of both signals plus the power of the signal.  Is this enough information to calculate the MSE?  Any tips on how that would be done?

Thanks.


texts:
Is there a function in MatLab to scale a given signal to a specific range, like how soundsc does it with the input?

I have to signals, one is a wave file, using wavreader (I know one should use audioreader now) to load the file, and another file that is being read using fopen and fread.
Now I want to compare those to signals, but the values of wavreader seems to be between -1 and 0, but the other file's signal goes anywhere between -5000 and 0.


texts: How to analyze medical image of a brain?

texts:
I have a small project to do on Image Analysis of a brain image signal. I have the following dataset.
The total frame rate = 1500 and sampling time is 77 ms. What I need to do is, analyse the theta waves and perform following task:

To produce frequency spectral of the theta waves using FFT.
To identify the frequency of the theta waves in the above chosen region.
To design a suitable FIR and IIR filters to remove the noise in the frequency spectral.

I wrote the following code, but I am not sure if it is correct.
clear;
clc;
data = xlsread('DSP_signal.xlsx');
x = [data(:,3),data(:,4)];
x(1,:) = [];
x = detrend(x);
l = 1500;
dt = 0.077;
fs = 1/dt;
output = fft(x)/l;
output = abs(output);
out = output(1:l/2+1);
f = fs * (0:(l/2))/l;
out(1:end-1) = 2*out(1:end-1 );
plot(f,out)
xlabel('freq')
ylabel('Amplitude')

and the output is,

First, I doubt if the process is correct. Creating a matrix X for two column pixel, is this process correct? I read in other forum that averaging the data of fft or fft of average data would destroy the information. Should I use fft2() instead?
Besides, the frequency range of theta waves (4-8 Hz) has almost no significant peak. The peak seems to appear only for the low frequency range i.e. near 0-1 Hz. I also need to use fir/iir filter to remove noise.
Please help me with this.


texts: Determining the average probability of error

texts:
I'm trying to solve the following problem:

In a binary PAM system, the input to the detector is
$$y_m = a_m+n_m+i_m$$
where $a_m = \pm1$ is the desired signal, $n_m$ is a zero-mean Gaussian random variable
with variance $\sigma_n^2$ and $i_m$ represents the ISI due to channel distortion. The ISI term
is a random variable which takes the values, $\frac{-1}{2}, 0, \frac{1}{2}$ with probabilities $\frac{1}{4}, \frac{1}{2},\frac{1}{4}$ respectively. Determine the average probability of error as a function of $\sigma_n^2$.

My try: I think the probability of error is $$P_e = \mathbb{P}(y_m<0 |a_m = 1) + \mathbb{P}(y_m\gt 0|a_m = -1)$$According to the definition of conditional probability, we have $$\mathbb{P}(y_m<0 |a_m = 1) = \frac{\mathbb{P}(y_m<0 \cap a_m = 1)}{\mathbb{P}(a_m = 1)} = \frac{\mathbb{P}(n_m+i_m<-1)}{\mathbb{P}(a_m = 1)}$$ By law of total probability $$\mathbb{P}(n_m+i_m<-1) = \mathbb{P}(n_m+i_m<-1\cap i_m = \frac{-1}{2}) + \mathbb{P}(n_m+i_m<-1\cap i_m = 0) + \mathbb{P}(n_m+i_m<-1\cap i_m = \frac{1}{2}) = \mathbb{P}(n_m<\frac{-1}{2}) + \mathbb{P}(n_m<-1) + \mathbb{P}(n_m<\frac{-3}{2})$$
Each term can be written as a function of $\sigma_n^2$ easily. So it seems we need $\mathbb{P}(a_m = \pm1)$ instead of $\mathbb{P}(i_m = \pm\frac{1}{2},0)$ which can't be true because we should certainly use values of $\mathbb{P}(i_m = \pm\frac{1}{2},0)$. What's my mistake here? Also is there any difference between "average probability of error" and "probability of error"?


texts: I really need to know the difference when doing a fourier seires between even and odd square waves. I've been trying to understand but I just get the same results and the same spectrums... Is the difference in the formula? If so, I can't find any formulas online that match with that my professor gave me. They're all a little different.


texts:
My problem is to cluster some time series together. But due to a huge length I was interested in using some methods to reduce the dimensionality. I was thinking of Discrete Wavelet Transform since the data are discrete. And I was wondering how many levels should I use to extract coefficients? Is there any best practise for that?
Also for clustering I was thinking to use Coeffs of Approximation only OR extract statistics such as mean, kurtosis , max etc.. from each coefficient (Approximation and all the Details)
Also, I've seen some methods using Fourier and extracting something like "m" components. But that does not seem very promising.
I'd like to hear your opinion on this. Thanks a lot.


texts: Difference in the meaning of kernel, filter, and dictionary atoms

texts:
While reading literature on wavelets, I have encountered keywords filters and dictionary atoms and their exact meaning is confusing for me. Basically, one can use them interchangeably and I won't see a problem. the following text is an example

  Our objective in this section is to develop a method to generate a
  system of filters such that (i) the filters are translated versions of
  each other in the graph spectral domain, and (ii) the $M \cdot N$
  dictionary atoms constructed by applying each generalized
  translation operator $T_{i}$ to each filter form a tight frame. More
  precisely, given an upper bound, $\lambda_{\text { max }},$ on the
  spectrum and a desired number of filters, $M,$ we want to find a
  kernel $\widehat{g}^{U}(\cdot)$ and constants $a$ and $A$ such that . . .

Would someone be able to comment on the how kernel, filter, and dictionary atoms differ with each other in this context? Thanks!

The text is from Spectrum-Adapted Tight Graph Wavelet and Vertex-Frequency Frames (DOI:10.1109/TSP.2015.2424203).


texts: Finding zebra-like pattern in image (Detection of structured-light fringe centerline from photo)

texts:
I'm working in a project where fringes are projected against a subject, and a photo is taken. The task is to find the centerlines of the fringes, which represent, mathematically, the 3D curve of intersection between the fringe plane and the subject surface.

The photo is a PNG (RGB), and former attempts used grayscaling then difference thresholding to get a black-and-white, "zebra-like" photography, from which it was easy to find the midpoint of each pixel column of each fringe. The problem is that, by thresholding and also by taking the mean height of a discrete pixel column, we're having some precision loss and quantization, which is not desired at all.

My impression,  by looking at the images, is that the centerlines could be more continuous (more points) and smoother (not quantized) if they were detected directly from the non-thresholded image (either RGB or grayscale), by some statistical sweeping method (some flooding / iterative convolution, whatever).

Below is an actual sample image:

Any suggestion would be much appreciated!


texts: Would the locations of SIFT features generally agree with features detected by Shi-Tomasi method?

texts: I am having a comparison of different feature detection methods. So if we compare the SIFT (Scale-invariant feature transform) and Shi-Tomasi method, will their feature locations agree and why? Are they comparable? Thanks in advance.


texts: Can you get flat response with Linkwitz-Riley cross-over?

texts:
Many pictures display that the Linkwitz-Riley has $-6\textrm{ dB}$ dips at the cross-over frequencies.

Are these fixed or can these made flat?


texts:
Consider the next sum
\begin{equation}
\sum_{k = 0}^{N - 1}e^{-j\frac{2\pi}{N}k}
\end{equation}
Its geometric meaning is the sum of uniformly distributed vectors on the unit circle.
Thus, we can say that the sum is zero.
If we try to be more precise, then for the case of even N, we can single out pairs of opposite vectors, each of which in the sum 0. What to do in the case of an odd N?
Is there a way to calculate the sum analytically, i.e. to prove this in general?


texts: How to efficiently compute a sliding FFT/DFT with a variable window?

texts:
I aim at performing a sort of sliding FFT/DFT on an audio input with a variable time-window, that depends on frequency.

I am aware of sliding FFT/DFT algorithms. But instead of having a window of constant duration 100 ms or whatever, I would like to make the window shorter for higher frequencies and longer for lower frequencies. So: the idea is that higher frequencies would appear and vanish quickly in the FFT output than lower frequencies. Is such a thing doable as efficiently as traditional sliding FFT/DFT? Are there algorithms for this already?


texts: Sampling a low-frequency sound doesn't work at some sampling rates

texts:
When sampling a low-frequency sound (like a 55Hz sine wave) I hear an additional high frequency sound at certain sampling rates, but not at others. This happens in Audacity and in my own program. For example, I hear both a low and a high pitch when sampling at 44,100 Hz, but only a low pitch when sampling at 48,000 Hz. What could this be?
More information:
The high frequencies are present for other input frequencies and it's not dependent on amplitude.
I'm sampling the sine wave using the standard sin() function in C++:
for( int i = 0; i < N; i++ )
{
    float time = float(i) / float(samples_per_second);
    output[i] = sin( 2*pi * 55 * time ) * 0.5;
}

Not sure how Audacity is doing it. With Audacity I generate a sine tone, and then changing just the project's sampling rate will make the high pitch appear/disappear.
The same thing happens playing back a bass drum sound (in Audacity and my program). I sample it just by indexing into a table loaded from a .wav file.
Even more information:
I noticed that the high frequency artifact sounds the same as sampling at a different rate with no interpolation, like this:
float in_idx = 0.0f;
for( int out_idx = 0; out_idx < N; out_idx++ )
{
    output[out_idx] = input[ int(in_idx) ];
    in_idx += 44100.0f / 48000.0f;
}

So maybe Windows or the driver or the hardware are deciding not to use interpolation for some reason.


texts: What is the variance of DFT of Fourier coefficient of difference of a vector of white noise?

texts:
Consider $\big\{x[0], x[1], \ldots, x[N-1]\big\}$. Suppose,
\begin{cases}
x[n] \sim \mathcal N\left(0, \sigma^2\right)\\
\big\langle x[n], x[n-1]\big\rangle = \frac12 & \forall \ n\\
\big\langle x[n_1],x[n_2]\big\rangle = 0 & \text{whenever}\quad\lvert n_1-n_2\rvert > 1
\end{cases}
I need to compute $\operatorname{Var}\{X[k]\}$ where,
$$
X[k] = \sum\limits_{n=0}^{N-1} x[n] \ e^{-i 2 \pi \frac{nk}{N}}.
$$
The definition of variance I am using is
$$
\operatorname{Var}\big\{X[k]\big\} = \operatorname{E}\big\{\big\lvert X[k]\big\rvert^2\big\} - \operatorname{E}\big\{\big\lvert X[k]\big\rvert\big\}^2
$$
The second term is zero. But I am failing to compute the variance. I am not sure how to do it.


texts: How do I determine whether I have pattern-free noise?

texts:
For microscopy, we're frequently testing cameras. Since my applications involve very low signal-to-noise ratio, it becomes important that the noise is free of correlations and patterns, because local correlation is all that really distinguishes signal from background.

To test the noise, I usually acquire a series of ~100 dark frames, i.e. frames where no external light hits the camera, determine the fixed camera pattern by time-averaging, and subtract that from the series.

I've observed patterns in the noise by simply taking the standard deviation for each pixel through time and looking at the resulting image (where e.g. different rows/columns of the camera had different noise standard deviations), and by doing row and column-wise cross-correlation (where I noticed for some interleaved camera that the noise was correlated between every other row).

The first of these tests is qualitative only, and the second only gives me (relatively) global correlations. Are there better (and faster?) ways to determine whether there is any correlation or dynamic pattern in the noise of the camera?


texts:
I've been doing FFT's (on sound) for a while and usually use the highest intensity or the ones above average to get the spikes in an FFT result.

What would be a good method to get all the 'spikes' in an FFT. I can't use averages or peaks because the frequency response drops off. Visually its quite obvious there is a spike but I can't get a way extract the frequency from the spike.

Low frequencies always tend to have a higher itensity than higher ones but don't necessarily have any spikes in them.

Are there any good reliable techniques for this?


texts: How to create a wide-sense stationary time series with a frequency of 40 Hz?

texts:
I want to create a time series in MATLAB which has a peak frequency of 40 Hz but is also a wide-sense stationary random process. I then want to use power spectral density estimation to recover the spectral content (with a peak at 40 Hz).

Any ideas on how to to do this?

I have tried doing a variety of things including:

1) Create a time series and add random noise. Both the Fourier transform and the PSD recover the true spectrum and the Fourier transform recovers sharper peak. So why use PSD?

2) Create a time series and add a random phase. Fourier transform recovers sharper peak at 40 Hz. Why use PSD?

3) Create a time series with random noise and then randomly sample the time series by pulling data samples from the time series with replacement. This results in random spectra with no peaks using either Fourier transform or PSD.

4) Create a time series with random noise and then re-sample the time series at a lower sample rate. This results in both Fourier transform and PSD recovering the peak at 40 Hz but, once again, the Fourier transform has sharper peaks.

I am trying to create a synthetic time series where PSD estimation is necessary and useful to recover the correct spectral information. But so far I can only create a time series where either a) Fourier transform is superior and recovers sharper peaks; or b) Neither Fourier transform or PSD recover useful spectral information.

Below is an example of a 1 s noisy time series composed of sinusoids with 200, 300 and 400 Hz. The Fourier transform recovers very sharp peaks (e.g. approximately delta functions) whereas the PSD smooths out the peaks due to windowing and averaging.


texts: I am working with a modular spectral processing STFT toolkit I have written in C.  I often need to carry spectral peak detection and analisys  (frequency estimation, peak displacement, etc) but I am into troubles when there are two or more peaks merging in a same apparent peak, i.e many overlapping peaks resulting in a single peak detectable as a single local maximum. I am aware that this problem has been addressed copiously in literature, in particular in chromatography or mass spectrometry. A commonly suggested approach is analysing the 2nd derivative looking for valleys, but this trick is not viable when the spectral resolution is insufficient, as when you have perhaps two or three peaks sharing few bins. Also I found many cases where a very low frequency sawtooth spectrum results in a smooth and large single peak, for which even the 2nd derivative of magnitude looks monotonous. So what to do ? I suspect that proper analisys of phases other than of magnitudes alone could give more clues of the actual underlieing peak structure but I am not a maths guru despite skilled enough. I would like to be able, once detected a whole peak "body", to decompose in its constituting overlapping peaks (if more than one) and possibly isolate them, or at least having a good estimate. Is there a way to do that, which is not too computationally intensive and which can be done in real time ? Thanks for any relevant answers!


texts: "Low-pass filter" in non-EE, software API contexts

texts:
I am an experienced software engineer and am working on smartphone sensors. I've taken fundamental EE classes in DSP and am trying to apply my knowledge. I believe that I understand convolution, transfer functions, z-transform, etc. I know a little bit about FIR and IIR filters.

Now, when reading through software APIs and documentation, I see people are applying a LPF to sensor data in the time domain. I know that you do that through the use of difference equations (e.g. y[i] = y[i-1] + 2*x[i]), but I learned in my EE class that LPF are typically applied through the convolution operation where you convolve the time signal with the coefficients of a sinc wave (for example) and with a specific cut-off frequency. So the colloquial use of "low-pass filter" is not exact enough for me.

For example, the Google Android API has this documentation:
http://developer.android.com/reference/android/hardware/SensorEvent.html#values

 public void onSensorChanged(SensorEvent event)
 {
      // alpha is calculated as t / (t + dT)
      // with t, the low-pass filter's time-constant
      // and dT, the event delivery rate

      final float alpha = 0.8;

      gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];
      gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];
      gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];

      linear_acceleration[0] = event.values[0] - gravity[0];
      linear_acceleration[1] = event.values[1] - gravity[1];
      linear_acceleration[2] = event.values[2] - gravity[2];
 }

How do I interpret that low-pass filter? What is the cut-off frequency? What is the transition bandwidth? Are they using this LPF solely to do averaging?


texts: Counting percentage of fouling on a surface

texts:
I am completely new to image processing and python. I hope I can find some help here. I am trying out a project on detecting fouling% on a ship hull using raspberry pi. I am trying to learn how this going to be done and how can i pre-process these images. Images will be captured underwater using Picam module and purpose of stitching is to generate an overview of overall fouling and to calculate the percentage of fouling. Below are ways I will approach this problem, but am I right to say haarcascade will not be able to use in this project because it is not possible to use it to calculate percentage of fouling?

To classify type of fouling and percentage of fouling

Macro fouling and microfouling pictures added and trained using Haarcascade or PCA algorithm to identify them OR Colour Segmentation/blob detection. The final result can be then obtain accurately in comparison to manual image segmentation like Grabcut algorithm.


texts:
Question on LSI system
Why second option (1) is not correct ?


texts:
A real valued causal sequence $x1[n]$ exists with length of the sequence being $N$.
Valid indices of x conform to $0 \le n \le N-1 $

The DFT of x[n] is:
$$
X1[k] =  \sum_{n=0}^{N-1} x1[n].e^{-j.2.\pi.k.n/N}
$$

The normalized frequency spectrum exists from 0 to $2\pi$. This frequency spectrum contains discrete frequencies which are integer factors of $\frac{2 \pi}{N}$.

A properly sampled signal fulfilling Nyquist criteria will have the valid range of normalized frequencies from $0$ through $(\frac{N}{2} - 1)$ $\frac{2\pi}{N} $.

As an example, for N=8, the valid frequencies are $0$, $2\pi.n/N$, $4\pi.n/N$ and $6\pi.n/N$.

When $x1[n]$ is upsampled with a factor of 2, we essentially insert a $0$ after each sample. This creates a new sequence $x2[n]$ with a length of $2N$.

The DFT of this new sequence will now be:
$$
X2[k] =  \sum_{n=0}^{2N-1} x2[n].e^{-j.\pi.k.n/N}
$$

The discrete frequencies of this new sequence are $0$, $\pi.n/N$, $2\pi.n/N$, $3\pi.n/N$, $4\pi.n/N$, $5\pi.n/N$, $6\pi.n/N$, $7\pi.n/N$ and so on.

So it is clear that each new sample that was added to $x1[n]$ has introduced a new frequency component.

I have two questions now:

As the harmonics (as the math seems to suggest) lies amongst the desired frequencies (e.g., $\pi.n/N$  is less than $2\pi.n/N$, and $3\pi.n/N$  is less than $4\pi.n/N$), shouldn't the interpolation filter be a comb filter?
When I take a FFT of $x2[n]$, I expect to see the harmonics in the original pass-band. But instead, the frequency spectrum of x1[n] has been replicated.

What have I misunderstood?


texts:
This morning i was experimenting with GNU Octave.
I created several signals(Sine, Saw tooth, square wave and noise). After this i used the periodogram. in the periodogram the square wave weren't showed.
I tried a test file from where the square wave is broken.

A = 1;
f = 2;
T = 2;
fs = 512;

if isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;
    pkg load signal
    clear isOctave;
end

t = 0:1/fs:T-1/fs ;
sine = A * sin(2*pi*f*t);
sq =  A * square(2*pi*f*t);
F = 0:(fs/(T*fs)):fs/2;
SINE = fft(sine);SINE = abs(SINE(1,1:(T*fs)/2+1));
SQ = fft(sq); SQ = abs(SQ(1,1:(T*fs)/2+1));

figure;
subplot(2,1,1); plot(t,sine, t,sq);
legend('Sine', 'Square','Location','northoutside','Orientation','horizontal')
subplot(2,1,2); plot( F, 20*log10(1/(length(SINE))*SINE), F,20*log10(1/(length(SQ))* SQ));

figure
periodogram(sine,[],length(sine),fs,'power'); hold all
periodogram(sq,[],length(sq),fs,'power')
legend('sine','square')

What i found out is that till the fft everything works as suspected.
But when i take the log of the square wave. the result disappears.

My question is why does this happening?

what cause this problem.
Happens this also in Matlab or python.
What solution fix this problem?


texts: Multiple biquads vs higher order filtering

texts:
I've heard that you can stack biquads on top of each other to get the same (or similar) effect as higher order filters.

For instance a biquads is order 2, so putting something through 3 biquads is like an order 6 filter.

I've heard that doing this is more numerically stable than an actual order 6 filter.

I was wondering though, besides increased numerical robustness, are there any differences between doing this compared to just using a higher order filter?

Does it impact processing speed or frequency response or anything else?

For some context, this for audio synthesis for electronic music, on a modern desktop computer, using 32 bit floating point math.


texts: How can I plot the spectrum of a signal in MATLAB?

texts:
Consider an input signal x_total and the complex envelope of an output signal y_total in MATLAB:

T = 10e-9;
f_s = 1e12;
t = [0 : 1/f_s : T]';
f_c = 11.5e9;

f_1 = -0.1e9;
f_2 = 0;
f   = [f_1 f_2]';

x_1 = 1*sin(2*pi*(f_c + f(1))*t);
x_2 = 1*sin(2*pi*(f_c + f(2))*t);
x_total = x_1 + x_2;

y_envelope = A_out .* exp(1i* theta) .* exp(1i*Phi);

2 Questions:

How do I plot the spectrum of x_total? X_total = fft(x_total) yields a complex result. I want the x-axis of my spectrum to be in Hertz.

And I want to plot the spectrum of my output signal y_total as well. From the complex envelope, can I say y_total = A_out*sin(2*pi*f_c*t + (theta+Phi))?

I just read:
A = abs(X_total) * 2/(f_s*T) should yield the amplitude
and f = linspace(0,f_s,length(X_total)) should yield the corresponding
frequency.
Why do I have to normalize the amplitude by 2/(f_s*T) ? Applying this code yields the spectrum for x_total, which I want.
Applying the same for y_total does not yield a spectrum at all, when I plot it. Why not?


texts: How do we use signal::filter and signal::butter in R for EEG data?

texts:
I am trying to design an experiment to determine the peak amplitude of an EEG signal in response to a stimulus. Till now, our team has been using MATLAB and since we wish to go open source, we are trying to replicate the same in R.

High pass cutoff: 0.3 Hz
Low pass cutoff: 30 Hz
Number of observations: 59000
Sampling rate: 500 Sps

The code I have written is as follows:

#Trying to pass parameters as pi-radians
bf <- signal::butter(2,W=c(0.3,30)/250,type="pass",plane="s")

#test is my EEG dataframe in R
for (i in 2:9) {
  test[,i] <- signal::filter(bf,test[,i])
}

I tried following the example on stackoverflow:

How do I run a high pass or low pass filter on data points in R?

However, the amplitudes which I am getting via this is greatly different for the same set of parameters when using MATLAB's EEGLAB which uses pop_basicfilter.m.

Please let me know if you need any additional information.


texts: Morphology - Why does the concept of opening and closing images exist when we already have erosion and dilation?

texts:
If we consider the closing operation of an image, we first dilate the image and then erode it. So, first we expand the foreground (white pixels) and and then we take away some part of the foreground. The result of this particular operation is similar to dilation, but less destructive of the original shape boundary.

However, we can combine erosion and dilation in different ways to control the extent of increase or decrease of the shape boundary. Then, why do we specifically define closing and opening operations?


texts:
I have received from a client a 32-coefficient FIR filter running at 1 kHz. I would like to adapt the filter to a 24-coefficient FIR filter running at 750 Hz while preserving the 0-375 Hz frequency response as much as possible, especially the 0-30 Hz band. Is there a way to resample my FIR coefficients?
Edit :
The FIR has linear phase, is a low-pass filter, and also has zeroes at specific frequencies (multiples of 60 Hz)


texts:
If $x(t)$ is a zero mean stationary Gaussian process and if $y(t)=x^2(t)$,then $\{y(t)\}$ is called a square law detector process. Now i want to find autocorrelation function $R_{yy}(t_1,t_2)$,that is
$$R_{yy}(t_1,t_2)=E({y(t_1)y(t_2)})$$
$$=E(x^2(t_1)x^2(t_2))$$
Now after this step every books give the result like this

  $$R_{yy}(t_1,t_2)=E({x^2(t_1)})E({x^2(t_2)})+2E^2({x(t_2)}X
(t_2))$$

But i don't know how this derivation came. Can anyone help me here please?


texts: Trouble with understanding moving average filter as an oversampling filter

texts:
I am struggling with understanding how an moving average filter can increase ENOB in a given sample.

I wrote a test for a simple MA (moving average) filter in matlab. The algorithm to create new MA value simply subtracts the new signal value from and old one (that is $n$ samples away), and adds the previous value of the filter to it. I run the fft and it seems to work as low pass filter  - exactly how expected.

I am aware that this same algorithm can be used to increase number of bits of resolution for a sample. Furthermore, if the old value that we used to build the difference with the new value is $n$ sample away, then the filter value is supposed to have the resolution increased by $n$ bits....
I just don't really understand how is that possible. To my understanding:

we take the old filter value ($m$ bit long),
we add a new value to it that is a difference of the current signal value and a past signal value, that is $n$ samples away - both values also $m$ bit long,
how is it possible that resulting filter value could be now $m+n$ bit long?

Lets say we have 12 bit($m$) signal values. How is it possible to 'gain' additonal 6 bits($n$) bits by adding the signal value that is 6 samples away from the current sample? Why should the outcome have the resolution of 18 bits?

Thanks in advance for your answers!


texts:
There is a system (consisting of several LTI analogue filters) whose input and output signals are being recorded at $20 \ \mathrm{kHz}$ (the sampling period is in the range of 10 times the system's transient response). Suppose I calculate

$$ G = \frac{\mathrm{FFT(output)}}{\mathrm{FFT(input)}}$$

What does that correspond to? Can you call it the frequency response? If it does not have anything to do with the frequency response, can someone provide an (ideally mathematical) explanation why it doesn't? I think, that it is legit if there were no transients present in the measured output. But since they impact the signal significantly I wonder if one can still get useful information from $G$.

EDIT: I guess I should rephrase the question. I know that the frequency response is defined as $$X(\omega) = \frac{Y(\omega)}{U(\omega)}$$. The issue here is that $y(t)$ and hence $Y(\omega)$ are greatly impacted by the system's transient response. May $X(\omega)$ still be called frequency response ?


texts: "Fourier Transform can localize signals in frequency domain, but not in time domain." -- What does it mean in layman's terms?

texts:
I was studying the introduction to wavelets and its benefit over the frequency domain. I said that:

  Fourier analysis can't localize signals both in time and frequency
  domain. Fourier analysis can localize signal in frequency domain very
  well, but not so much in time domain. While wavelet has the advantage
  of localizing signals both in time and frequency domain.

What does this mean? Could you give me any example or link that explains this scenario better?


texts: Deriving a Kalman Filter Equation for a Linear Gaussian Filtering Model with Non Zero Mean Noise

texts:
I am trying to answer an exercise question from the book Simo Sarkka - Bayesian Filtering and Smoothing.
The question is:

Does anyone know if there is a resource that has the solutions for this book?


texts: Visible light communication and LED modulation

texts: I work on a VLC system in which 16-PAM symbols with complex pilot symbols are as ifft input. I made the ifft output real and positive. Now how should i use these ofdm symbols to modulate LED? Their apmlitude or their power are used to be multiplied by time domain response time of LED?


texts: Algorithm that Fills the White Holes Within the Character Image

texts:
I have this degraded image :

Using paintbucket tool in Paint.NET Windows application, I fill the character image black.

My questions are :

What algorithm can we use to fill up the holes within the character image?
Is there any corresponding built-in function in Python that fills up the white holes in a character image?
What probable algorithm does the paint bucket tool in Paint.Net uses ?

Thanks.


texts: What is the name of the following 1st order high-pass IIR filter?

texts:
What is the name/family behind the following high-pass IIR filter:

$
T = 1/f_s \\
f_c = 5 \\
c_1 = \displaystyle \frac{1}{1 + \tan(\pi f_cT)}\\
c_2 = \displaystyle \frac{1 - \tan(\pi f_cT)}{1 + \tan(\pi f_cT)} \\
b = \left[c_1, -c_1\right] \\
a = \left[1, -c_2\right]
$

Where $f_s$ is the sampling rate and $f_c$ the cut-off frequency.


texts: Compute time constant of discrete exponential decay pulses

texts:
I want to retrieve (within a FPGA) the time constant $\tau$ of incoming pulses of the form $$x[n]=Ae^{-n/\tau}u[n]+C$$
In addition to the offset, inputs are subject to noise.

To measure the integral of the pulses, I used a trapezoidal filter (2 successive differentiator+accumulator) whose properties allow for DC offset removal and noise attenuation. Starting from that, I was wondering if there is were a smart way to compute an approximation of the time constant.

A few articles mention Fourier Transform or Corrected Successive Integration technics but I could not find any free material.

Any tip to put me in the right direction would be appreciated.


texts:
I have a triaxial accelerometer giving me acceleration along x, y, and z. I then combine the 3 axes by calculating magnitude of acceleration over all time points (details in my question here)

I'm wondering about the correct time in the process to low pass filter my signal to eliminate some of the high frequency noise in the signals. I guess I have a few options:

Filter the raw xyz signals, calculate magnitude and use it as is
Filter the raw xyz signals, calculate magnitude, filter the resulting magnitude vector, and then use that
Use the raw xyz signals (no filtering), calculate magnitude, filter the result then use it

From a theoretical standpoint, does it matter which signals I filter and in which order?

I would imagine that if I dont filter the raw signals (#3) and directly calculate the magnitude I would end up amplifying a lot of noise? But is there a harm to double filtering (the raw signals, and then the magnitude) in #2?


texts: Prove using superposition that an LTI system is linear

texts:
Given an LTI system of the form:

$$ \frac{d}{dt}{x}(t) = {A} {x}(t) \ + \ {B} {u}(t) $$

where ${x}(t)$ is the state variable, ${u}(t)$ an input and ${A}$ and ${B}$ constants, how does one show, by superposition, that the system is linear? I've searched and searched and tried to do it myself and I am unable to do so. Seems more difficult that it seems. Most books seem to gloss over the fact.


texts: How do you compute for fc and t in modulating an I and Q component

texts:
I know that in a $2^b$-ary QAM system you need to modulate the $I$ and $Q$ components through the mixer and are separated by 90° through a local oscillator (by applying a $\cos$ and $\sin$).

By mixing them through the mixer, the $I$ component will be multiplied by a $\cos(2\pi f_c t)$ and $Q$ by $\sin(2\pi f_c t)$. My question is, if I have a 8 bit sampler and the sampling frequency I used is 10 kHz, what will be my value for the carrier frequency $f_c$ and the time sweep, $t$?

My idea is that I can compute the carrier frequency by computing for the symbol rate (bit rate over the number of symbols) and multiplying it by 2 to satisfy the Nyquist Sampling rate. Is that true? And I really don't have any idea what increment value of $t$ I will use.


texts: Square law demodulator. How can we eliminate the term containing $m^2(t)$?

texts:
We are trying to extract the message signal from the AM signal using square law demodulator.

In the final expression, $V_2(t)$, the term encircled in blue has to be retained, and the others have to be eliminated. The terms encircled in green can be eliminated by low pass filter(the career frequency being high). The constant term can be eliminated with the help of coupling capacitor as mentioned below the derivation. But the problem is that the spectrum of the term $\frac{k_2 {A_{c}}^{2}{k_{a}}^{2}m^2\left ( t \right )}{2}$ will lie around the origin. It is just that the width of the spectrum of this signal component will be twice of that of $m(t)$[Multiplication in time domain is convolution in frequency domain]. The spectrum of the the component $k_2{A_{c}}^{2}k_am\left ( t \right )$ will also lie around the origin. Will the spectrum of $k_2{A_{c}}^{2}k_am\left ( t \right )$ and  $\frac{k_2 {A_{c}}^{2}{k_{a}}^{2}m^2\left ( t \right )}{2}$ not interfare? How can then we extract the message signal?


texts: Discrete Fourier Transform: Prove that only N distinct values of {X(k)} can be computed

texts:
Please can anyone answer this question:

The Discrete Fourier Transform (DFT) is a sequence of $X(k)$ in frequency domain of the  time sequence {$x(n)$} of $N$ terms. The periodic property of the DFT is often used to reduce its computational time. Prove that only $N$ distinct values of {$X(k)$} can be computed.


texts: Part 2: Root Locus, Transfer Functions and Unit Step Response?

texts:
I'm continuing my question referenced here: Part 1 Question / Problem Description
Say I have a new Root Locus shown below
Consider the generic feedback loop, and the transfer function $G(s)$ shown by the following root locus plot.

Where $\mathbf{x}$ denotes the open-loop poles, $\square$ denotes the closed loop poles, and $\circ$ the open loop zeros.
I want to determine if this root-locus produces any of the following output responses to a unit step reference signal:

Question:
I don't fully understand how Matt goes from the closed-loop characteristic equation to solving for the value $K$. Is he comparing coefficients? If so, how can I do that for one real axis pole and two imaginary? I can find the closed-loop transfer function, but it results in a cubic polynomial. Also, his process determines the final settled value, but A) and B) both settle to 1, so how can I differentiate the two?
Thanks!


texts:
Confused about a few topics w.r.t. differential encoding/decoding. First, consider the below BER curve taken from wikipedia ( https://en.wikipedia.org/wiki/Phase-shift_keying ) comparing BPSK/QPSK and DBPSK, DQPSK
I ran some simulations in matlab and found that by including standard differential encoding of my QPSK that my error rate was approx 2x higher than normal QPSK (which seemed correct given the error propagation of the differential coder). However according to this curve, the penalty for DQPSK appears much worse, am I missing something or is there a mistake in this graphic?
EDIT: I'm going to answer this first question - I've conflated terms. The performance in the graph for DQPSK i.e. differential QPSK, is different than differentially encoded QPSK (which is the system I've described in my post). In differential QPSK, I believe the transmitter I described using modulo-M differential encoding is still correct (in that it encodes the information into the phase transitions of the constellation) - however the key difference is that DQPSK at the RX side is assumed to be operating differentially and so detection of the data is done by comparing the current and prev phase of the constellation.
It's clear now my questions are not about DQPSK but instead about differentially encoded QPSK. In this case, we demodulate using a coherent receiver (i.e. including a costas loop) and the differential encoding is only used to resolve the 2*pi/M phase ambiguity. Thus we only get a small BER penalty from the error propagation in the differential encoding.
I'm still interested in the subsequent questions below on the topic of differential encoding schemes.
Secondly, I want to understand two forms of differential encoding for M-PSK that I am aware of. The traditional way as I know it is shown below (assuming perfect timing/freq sync already) where it takes a stream of input bits, groups them into log2(M) chunks, re-maps them via a grey code, differentially encodes them (modulo M), and then maps to symbols (not shown in the flowgraph but the constellation here must be natural, i.e. no mapping). In other words this encodes the data into the transitions of the constellation as opposed to the absolute phase. For QPSK this allows us to correct the 90 degree phase ambiguity problem as seen in the costas loop for example.

The alternate method I am aware of for example with M=4 involves taking the stream of input bits, deinterleaves them (even and odd bit indices) and differentially encodes each stream separately modulo-2, interleaves them back up, groups into chunks of 2-bits, re-maps them via a grey code, and then maps to symbols. This essentially is treating it as two independent DBPSK streams. This is as shown below:

Questions:

Is there a common name for the alternate encoding scheme or other reference material on it? I've found none.
EDIT: I have since found that the interleaved scheme does not appear to handle 90 degree ambiguity (only 180deg) as I had originally thought. In fact I came across a paper that seemed to state as much as well https://ieeexplore.ieee.org/document/1632094 I still am unclear why exactly this is the case however.. I had originally thought that since each stream could separately handle a 180 degree offset, combined they could handle 90 as well.
Is this alternate method acceptable for higher order M-ary PSK?


texts: How can define an indicator which measures the degree of similarity between two signals?

texts: The similarity of two signals is calculated by cross correlation. But, how to define an indicator which quantitatively measures the degree of similarity between two signals? Thanks.


texts: What are some methods for detecting a sinusoid in noise?

texts:
I'm looking for a broad classification on the kinds of techniques available. Something I can use to begin a literature survey.

Some details:

should be feasible for real-time implementation.
Binary decision, I should be able to input the signal continuously, and the algo has to detect the start and stop times of the sinusoid in the waveform.
There is no other signal, i.e. if the sinusoid is not present, then there will only be noise
the input is band-limited, and the sinusoid, if present, is assured to be within that band.
Tradeoffs are between speed (how soon after the appearance of the sinusoid can the algo detect its presence) and false positives (should be minimal)
I can't provide any exact numbers about acceptable performance measures, because I'm not sure myself. I intend to implement all your suggestions for my application and find out myself. I'm just looking for the "standard" techniques for tackling this problem.

Further details:

The input is the output of a band pass filter, so the noise is
also significant only in the pass band.
There is no surety when
the sinusoid may appear. The duration of the sinusoid is in the
range of 50-100 ms. The amplitudes of the sinusoid will fluctuate.


texts: Image getting completely white on downsampling

texts:
I performed an image downsampling with averaging operation(The image is divided into 2 by 2 blocks,then it is downsampled by 4 times.New pixel values od downsampled image is replaced with the mean of each block) as follows.

img = imread('cameraman.gif');
avgfilter = fspecial('average', [2 2]);
avgimg = filter2(avgfilter, img);
down1 = avgimg(1:2:end,1:2:end);
imshow(down1);

I used a graysacle image as input.

but I'm getting a complete white image as output on downsampling.
I tried with jpg image also. Why this happened?
Please help.


texts: How to find tennis courts in aerial imagery

texts:
I'm interested in finding all tennis courts (and other similar well defined features like basketball courts) in my county, and I have aerial imagery of good (but varying) resolution, but I'm not sure of the best way to find them. Here are two examples of the imagery:

I've looked at the various methods, and I think template matching wouldn't work as it would be very slow since there can be arbitrary scale and rotation, and also the color can vary. The Hough transform sounds promising, but once I get all the lines I'm not sure how to find lines that constitute a rectangle with the appropriate ratio (about 36x29 feet), or better yet to account for the other marked lines.

For background, I'm aiming to add all tennis courts in my county to OpenStreetMap.


texts: Why is Scipy implementation of Hilbert() function different from Matlab implementation of the function?

texts:
I am trying to fit Hilbert envelop to a high frequency ultrasonic signal of frequency 250 KHZ and sampling rate 12000000. Raw signal looks like below: .

I used hilbert() function from scipy.signal package in python this is what it looks like .

The python code looks like below

from scipy.signal import hilbert
import numpy as np
 def Hilbert(self,i=0):
    analytical_signal = hilbert(self.sensor["s"+str(i)])
    amplitude_envelope = np.abs(analytical_signal)
    return amplitude_envelope

The Matlab implementation looks like this

Matlab code is as follows:

figure;
plot(abs(hilbert(signal)),'r');
hold on;
plot(signal,'b');

The line data is as follows Signal.
I am wondering which one is correct?


texts:
I need to perform the Helmholtz decomposition of a 2D flow. An old and obvious problem is the numerical differentiation (largely amplifying the noise).

I do understand the procedure I am just looking for useful tips and tricks or a literature reference -- surely I am not the first one to perform the task.

I am aware that there was a matlab package where the decomposition was implemented. But it worked only for square input matrices.

Do you know any algorithm other than straightforward discretization of integrals and derivatives?


texts: Fourier transform of a discrete periodic signal

texts:
The given sequence
$$x[k]=\delta[k-1]-3 \delta[k] + \delta[k-2]$$
represents a period of some discrete periodic signal $e[k]$ with period N=3. Find the Fourier transform  of $e[k]$.

This is an exercise in my textbook and i don't get it. Is $x[k]$ the first period of $e[k]$? If so, does that mean that the DFT of $x[k]$ is the same as the DFT of $e[k]$?


texts: Deep zeros in the spectrum of the input data?

texts:
I wanted to know the meaning of "deep zeros" in the spectrum of the input data. I came across this terminology while going through the introduction of chapter 2 (Bussgang techniques for blind deconvolution and equalization) of the book named "Blind Deconvolution" by Simon Haykin.

Thanks,
JK


texts:
I'm trying to filter noise from an audio signal. The signal was and is going to be recorded in a city environment which always contains some white/pink noise.

At this moment I'm using two options to filter the noise.
Spectral Subtraction algorithm and Wiener filter.

I'm assuming the initial samples are noise only and that's how the filter starts subtracting noise, but I can't make this assumption at all times. I have to automatically detect when it's noise and when it's not.

I'm using Matlab btw.

If anyone has any sugestion... thanks


texts: As the title suggests, I have a confusion here. In a Systems text I am going through, it mentions of the Unit Impulse as an unbounded signal. Yes, the unit impulse "height" is unbounded, but the "strength" of the signal as the way it is mentioned in many texts, is finite, given by the area of the unit impulse. By that line of thinking it is giving me a bounded signal. What am I missing here? How is the unit impulse interpreted/treated in terms of being an input or an output to a system? Thanks!


texts: Least Mean Squares (LMS) Filter Weight Update

texts:
I have a general question regarding Least mean squares adaptive filters.

Using the example of noise cancellation, I understand that if you have a set of reference signals (S) and corrupted signals (S+N) then you can perform minimisation of the error to find the optimal weights for the set of inputs.

I am wondering if this is normally performed 'offline' or if this can be performed on the fly with the weights changing over time?


texts: Given MFCC values for some wav’s, how can I easily tell if all speakers are the same?

texts:
Context: for a research project I have at regular times a batch of wav files  with recordings of voice. The hypothesis is that all speakers in a batch are the same, but there might be 1 or a few “others” in it. There are 5 to 10 files in a batch.

My goal is to obtain a similarity matrix for all wav files (speakers) in a batch.

What I got so far: I calculate MFCC (16 values) with an existing tool, I have between 2000 and 4000 frames per wav file. Simply taking the average of MFCCx is not meaningful. Next I perform a GMM clustering on each wav and obtain something like this: (MFCC0 discarded)

Wav1
Class   Mean (MFCC1)    Mean (MFCC2) …     Proportion
        1       -44             6               0,09
        2        46           -23               0,37
        3        20           -26               0,10
        4        43           -43               0,06
        5        57           -52               0,06
        6        66           -55               0,18
        7       108           -46               0,15

And here I am stuck, what do I do next to get a similarity matrix, can I calculate some “distance” between the different wavs and how?

Voice is natural talk. Recordings are under various channel conditions (sometimes background noise) and can be with varying emotional status (eg laughter, some excitement,..). Speakers are of random nature (man, woman, old, young, …).

I would like to avoid more difficult algorithms for speaker recognition because that is beyond my current knowledge. Given that speakers are random, it will be rare that the other(s) is very similar to the normal speaker, and some error rate is acceptable, so a basic method should be ok.


texts: Why is deconvolution used in telescopes, CT scans and seismographs?

texts: Can you explain to someone with no mathematical background why is deconvolution used in telescopes, CT scans and seismographs? How do you explain that the same technique can be used for different things. The distortions in telescopes, CT scans and seismographs are all different from each other.


texts:
I've been reading this lab sheet which explains the signal processing math of the RTL-SDR radio dongle. http://www.eas.uccs.edu/~mwickert/ece4670/lecture_notes/Lab6.pdf  In pages 5 and 6, the local oscillator (LO) is said to be modeled by a multiplication with the complex frequency $e^{-j2{\pi}f_{c}t}$ as shown in the image below taken from the lab sheet.
I understand how, mathematically, this multiplication with the negative frequency will shift the signal spectrum to the left by $f_c$ Hz, but what I don't understand is how a local oscillator can physically achieve this. The negative frequency in the behavioral model does not have a physical interpretation (does it?), and the physical LO signal in reality is just a sine wave with frequency $f_c$. Multiplying $sin(2{\pi}f_ct)$ with the radio signal of interest $s(t)$ will not remove the carrier frequency $f_c$ from the radio signal, for example if the radio signal is also $sin(2{\pi}f_ct)$, the resulting product will be a signal with frequency $2f_c$. Can someone explain what I am getting wrong?


texts:
I have a homework problem that I'm not quite sure how to complete.  The problem is as follows:

PROBLEM

Write the definition of the Fourier coefficients, and show that

$$f(t + \frac{1}{2}T) = f(t) \rightarrow c_{2n+1} = 0$$
$$f(t + \frac{1}{2}T) = -f(t) \rightarrow c_{2n} = 0$$

Also show that this is a consequence of the similarity theorem in the Fourier analysis.

ANSWER

I have been able to solve the first part.  The definition of Fourier coefficients is:

$$c_n = \frac{1}{T} \int_{0}^{T} f(t) \exp(-2 \pi i n t/T) dt$$

Now let $f(t) = f(t + \frac{1}{2}T)$.  If we plug this in we get:

$$c_n = \frac{1}{T} \int_{0}^{T} f(t + \frac{1}{2}T) \exp(-2 \pi i n (t + \frac{1}{2}T)/T)dt$$

$$ = \frac{1}{T} \int_{0}^{T} f(t + \frac{1}{2}T) \exp(-2 \pi i n t/T) \exp(- \pi i n) dt$$

From this last expression we se that when $n$ is even, $\exp(- \pi i n)$ is $1$, and when $n$ is odd, $\exp(- \pi i n)$ is $-1$.  Thus we see that if we want $f(t + \frac{1}{2}T) = f(t)$ we must have all odd Fourier coefficients equal to $0$, and if we want $f(t + \frac{1}{2}T) = -f(t)$ then all even Fourier coefficients must be equal to $0$.

I don't know quite how to approach the last question though - how to show that this is a consequence of the similarity theorem.  Of course, the definition for  the similarity theorem is that:

$$f(t/ \gamma) \leftrightarrow |\gamma| F(\gamma \omega)$$

and a property is that if we "stretch" the function in the time domain, then we "shrink" it in the time domain, and vice versa.  But how this apply to the problem above?  My intuition tells me that since every second Fourier coefficient is set equal to $0$ we are "stretching" the function in the frequency domain, but I don't know how to show that we then get a "shrinking" in the time domain.

If anyone can give me some help in how to attack this last part of the problem, then I would be extremely grateful!


texts:
I am trying to understand what a codec actually is

Wikipedia says

  In hardware, audio codec refers to a single device that encodes analog
  audio as digital signals and decodes digital back into analog. In
  other words, it contains both an analog-to-digital converter (ADC) and
  digital-to-analog converter (DAC) running off the same clock. This is
  used in sound cards that support both audio in and out, for instance.

So this implies codec is something that comes with both ADC and DAC converters (so a codec should have an analog input with a corresponding digital output and a digital input with a corresponding analog output)

From my limited understanding, codec should have some kind of coder and a decoder, that is, for whatever digital representation I get from a particular analog input, the codec should should give me a different, encoded version of this digital representation, and it should also be able to reverse this encoding (since it's a codec, unless I got it wrong and the digital equivalent itself is considered a type of encoding?)

However, this doesn't seem to make sense to me in terms of the DSP that I am working with

The following figure is from the datasheet of the CSR8670 Bluetooth Audio chip

In a lot of a places, the datasheet, other documents and comments in the sample programs mention the audio input ADC as a codec, so I assumed codec here meant the wikipedia definition

Looking at this picture, we can see that it shows ADC and digital codec to be two separate entities. Moreover, both the inputs from the analog mics as well digital mics go through the digital codec

What exactly does this mean? I can use the debugger to check the DSP memory for the numerical representation of whatever audio that comes in through the microphone. Does this imply that the numerical representation that I see in the DSP memory is not the same as what was generated by the ADC?

What is codec here, in very simple terms?


texts:
I already know the simple definition that causal system is the one that does not depend on future values of input but today i was confused as i came across a new definition of causality after reading "signal processing first "about causality  as shown in attached snapshots

I have attached two pages snapshots and i have drawn a thin red line to left side of common para, para that occurs in both snapshots

As shown in common para in  second line ,"cause does not precede corresponding effect"

This statement is about causal filter but what does this statement means in simple words?

Both snapshots contain a table ,upward snapshot contains table of non causal filter

Bottom snapshot contains table of causal filter

We can see from table of causal filter that both input and start at same value of time (n=0)while table of non_causal filter shows that output starts at earlier value of time(n=-2) while input starts at a later value of time(n=0),thus
Indicating that output(effect)precede input(cause) in case of non-causal filter


texts: Programming a parametric equalizer - preventing clipping

texts:
I've been developing a music player for Android for many years, and I've recently started working on the implementation of a parametric equalizer.

I'm having trouble preventing a gain at one band from adversely affecting the gain at a neighbouring band, resulting in a peak gain higher than desired, which ultimately may result in clipping.

I've been following the Orfanidis paper on 'Digital Parametric Equalizer Design With Prescribed
Nyquist-Frequency Gain' as well as an example Matlab implementation of some of the concepts outlined in the Orfanidis paper.

The equalizer effectively acts as a graphic eq - I've fixed the center frequencies and bandwidths to specific values:

(Values in Hz, Bandwidth in brackets)

63 (15)
125 (30)
250 (30)
400 (45)
630 (75)
1000 (115)
1600 (180)
2500 (290)
4000 (460)
6300 (730)
10000 (115)
16000 (1825)

The plan is to allow a maximum boost/cut of 12dB, with bandwidth gain set to 3dB below peak. Ideally, I could first apply a 12dB cut across the entire spectrum, so that a peak boost of 12dB is guaranteed not to cause any clipping.

The problem is, if a user applies a boost of 12dB at, say, center frequencies 63Hz and 125Hz, the peak gain at both frequencies ends up being more than 12dB, which may result in clipping. Here's what the FFT looks like for that case:

Notice the peak gain is actually greater than 12dB.

The effect is compounded if a boost is applied across all the frequencies mentioned above (this is the worst case scenario):

Notice the peak gain is more like 15dB.

Maybe I should expect this, and the answer is simply that bands shouldn't be spaced too closely if applying a lot of gain. But, my problem is I'm trying to provide this functionality to a casual music listener, but I don't want them to configure the equalizer in such a way that clipping occurs, as they'll likely claim that it's faulty.

So my questions are - does this look like a correct implementation of a parametric eq? Does it make sense that neighbouring bands can have a greater peak gain than the specified 'boost gain'? How can I prevent a user from causing clipping in this situation?

Any help is appreciated.


texts: What are Method to phase shift 50 Hz digital signal using microcontroller. Appart from storage of samples to array and shift sample wise,how to shift this signal fractionally.


texts: Can the Nyquist sample rate be extended to stochastic sampling?

texts:
It appears there are lots of questions here about Nyquist, and a few questions about stochastic sampling here.  But I haven't found any that address quite what I'm after.  This is the closest I've found here, and searching around has led me to some work on Compressed Sensing, but I have no idea how to navigate that field.

So there's the Nyquist sampling rate: given a signal composed of frequencies lower than $F$, Nyquist gives a lower bound on sampling frequency necessary to reconstruct the signal.

But I think that's usually applied when trying to find an appropriate fixed sample rate.   So I'm curious if there is an extension to stochastic sampling: for the same signal as above, assume it is sampled such that the space between samples is distributed by Poisson $\mathcal{P}(\lambda)$ (or some other friendly distribution with parameters $\theta$.)

I'm hoping there exists a high probability bound on the ability to reconstruct the signal based on the sampling distribution.

Or, if signal reconstruction isn't well defined in this setting, perhaps there is an expression that can be derived that connects the source signal's frequency composition, the sampling distribution parameters, and the maximum mutual information between the source signal and the stochastically sampled signal.

But I have no idea if either actually exist.  Can anyone help me figure this out?


texts: How to measure a lung nodule in a CT Scan DICOM image?

texts:
In this question, I would like to focus on intensity value of the CT Scan. First, take a look at the image below:

The upper image is the original image, while the lower image is the thresholded version. In order to measure volume of any shape, theoretically, it is possible to simply just count the number of voxels in the image. However, the outermost layer of the object (ex. nodule) shows darker intensity, while all voxels inside the object have very high intensity. If I simply count the voxels in the thresholded version, I will highly likely to get a result volume larger than the actual volume for the lung nodule.

I also see that there are variables such as window center (level) and window width, which can be used to adjust the DICOM image's intensity information. Different intensity can alter the result volume.

So here is the question: if I am to measure any given lung nodule, what should I do in order to achieve the best possible precision? When should we ignore the lower intensity voxels? Or must I do this in some other ways?


texts: Impact of Interpolation Types in Image Filtering (Laplacian Pyramids)

texts: I am trying to construct Laplacian pyramids with different interpolation schemes such as bilinear, nearest neighbor, cubic and spline to observe the effect of interpolation types. I wrote a code in MATLAB to see the effect, but I could not come up with a solid answer that points the advantages and disadvantages of those schemes. I am trying to understand their advantages/disadvantages intuitively and mathematically,any help would be appreciated. Results that I have obtained are depicted in the following figures.


texts: derivating input output relationship of a block diagram when there is noise added to the output

texts:
For the following system, I am not quite sure how the equation representing the input output relation is derived.
Here, r is an input reference signal, $d_e$ is external disturbance and $n$ is noise. What I can write is
$G[K(-Hy + Fr)+G_dd_e]+n = y$
so
$(1+GKH)y = GKFr + GG_dd_e +n$
so $y = F\frac{GK}{(1+GKH)}r + G_d\frac{G}{(1+GKH)} + \frac{1}{(1+GKH)}n$
however, the correct answer for the $\frac{1}{(1+GKH)}n$ term seems to be
$\frac{GKH}{(1+GKH)}n$? What have I done wrong?


texts: How to get the autocorrelation of this finite discrete function?

texts:
This is the function:

$$
x(n) =
\begin{cases}
1, & \text{-N  $\leq$ n $\leq$ N ;}\\
0, & \text{otherwise.}
\end{cases}
$$

And I tried to solve it, using sigma notation or summation:

\begin{equation}
\ r_{xx}(l) = \displaystyle\sum_{n=-\infty}^{\infty} x(n)x(n-l) \end{equation}

I get 2N-1 but that is wrong. Because when I do the autocorrelation in MATLAB I get something like:
For exmple if N = 2, the discrete function rxx(l) would be like:

Which is something like rxx(l) = 2N-1+|l|
But I don't know how to get there... Can you help me?


texts:
Add together some sinusoids with irrational or "nearly" irrational frequency ratios, and you get something pseudoperiodic. If there aren't too many, you can hear that it has only pitched components, even if you can't isolate them by ear.

If there are enough of them playing together, it will sound like steady noise.

The same goes with random transients. If they're separated in time well enough, you can hear them as distinct sounds. If they become very dense it sounds like steady noise.

Is there a model that predicts when a long-playing signal sounds like steady noise, and when it sounds merely rough or dissonant?


texts: DFT algorithm designed for a "sample-by-sample" senario

texts:
Suppose I have a system that wants to take an input signal (audio in this case) and wants to output a Discrete Fourier Transform of it in real time (ie every sample).
My initial thought is that if you are just every sample adding a new sample and bumping off a the oldest sample you could reuse the some of the computation from the last sample.
After googling around I wasn't able to find anything like that on the web.
So my question is this:
Does an algorithm like this exist and what is it called?


texts: Algorithm to convert a GeoTIFF file to PNG image format

texts:
I have a bunch of GeoTIFF files that I am processing into a TFrecords format for machine learning. Now I can't put tiffs directly into a TFRecords format and so I have to convert the files to either PNG or JPEG. However, I did not want to generate a big bunch of converted PNG files to clutter up my computer and was hoping to do the conversion of the data in-memory.

The GeoTIFF has only 3 bands--it is RGB PanSharpened--so no problem with selecting out the bands I need. When I imported a sample GeoTIFF file into python using rasterio I found that the range for pixel values was between [282, 1560], which seemed rather high. This is satellite imagery, BTW. Now PNG or JPEG files seem to have pixel ranges of between [0, 255] or [0,1], from what I gather. This seems like a simple rescaling of the values to my naive eyes.

So my question is whether anyone could provide the basic algorithm to convert TIFF file pixels into PNG or JPEG pixels. I don't need to worry about the spatial coordinates in this case, so I can treat this as a straight TIFF --> PNG or JPEG conversion.

Could I just divide every TIFF pixel by the max in the range, like 1560? I don't know what the maximum value for a TIFF pixel is, but I could divide by the max otherwise. Or I would have to divide by a factor that maps the range [282, 1560] --> [0, 255], right. So that is just a simple scalar multiplication.

I looked around the web but no one seems to have a basic algorithm for this. I read the file specification for TIFFs and PNGs but could not find the maximum and minimum pixel ranges. All I can find is either people converting the images to new files--using GDAL or gdal_translate or in some cases using PIL. Or other answers fall into using GUI tools like QGIS to again save to new files. But like I said, I would rather not save to a file.

Hopefully someone might know the algorithm to do this conversion manually. Thanks.


texts: Transforming digitized noisy signal before applying cross-correlation

texts:
I'm trying to grasp the concept of cross-correlation as it applies to CDMA in the GPS C/A signal where noise is involved and the SNR is low.

My understanding is that before calculating the cross-correlation with the C/A code one has to transform (just shift by its average value?) the digitized and demodulated received signal so that there are both positive and negative values in the sequence and the sum of these on average should be zero, is this correct?

(I understand that there's much more to acquiring the GPS C/A signal, but I'm trying to grasp how cross-correlation can be applied to a digitized signal)


texts: How to understand the implementation codes in Debevec and Malik's HDR paper

texts:
The paper titled "Reconvering High Dynamic Range Radiance Maps from Photographs" from Debevec and Malik is a seminal paper in high dynamic imaging. In this paper, it proposed a method to estimate the camera response function (CRF), which is equal to optimize the following objective function:

$$\mathcal O = \sum_{i=1}^N\sum_{j=1}^P\left\{w\left(Z_{ij}\right)\left[g\left(Z_{ij}\right)-\ln E_i-\ln\Delta t_j\right]\right\}^2+\lambda \sum_{z=Z_{\rm min}+1}^{Z_{\rm max}-1}\left[w(z)g''(z)\right]^2$$

The author also provides MATLAB codes to optimize this object function:

%
% gsolve.m − Solve for imaging system response function
%
% Given a set of pixel values observed for several pixels in several
% images with different exposure times, this function returns the
% imaging system’s response function g as well as the log film irradiance
% values for the observed pixels.
%
% Assumes:
%
% Zmin = 0
% Zmax = 255
%
% Arguments:
%
% Z(i,j) is the pixel values of pixel location number i in image j
% B(j) is the log delta t, or log shutter speed, for image j
% l is lamdba, the constant that determines the amount of smoothness
% w(z) is the weighting function value for pixel value z
%
% Returns:
%
% g(z) is the log exposure corresponding to pixel value z
% lE(i) is the log film irradiance at pixel location i
%
function [g,lE]=gsolve(Z,B,l,w)

n = 256;

A = zeros(size(Z,1)*size(Z,2)+n+1,n+size(Z,1));
b = zeros(size(A,1),1);

%% Include the data−fitting equations

k = 1;
for i=1:size(Z,1)
  for j=1:size(Z,2)
    wij = w(Z(i,j)+1);
    A(k,Z(i,j)+1) = wij; A(k,n+i) = −wij; b(k,1) = wij * B(i,j);
    k=k+1;
  end
end

%% Fix the curve by setting its middle value to 0

A(k,129) = 1;
k=k+1;

%% Include the smoothness equations

for i=1:n−2
  A(k,i)=l*w(i+1); A(k,i+1)=−2*l*w(i+1); A(k,i+2)=l*w(i+1);
  k=k+1;
end

%% Solve the system using SVD

x = A\b;

g = x(1:n);
lE = x(n+1:size(x,1));

The implementation codes are well understood, and my question is why this implementation can optimize the object function. If I understand well about this implementation, the solution to the object function is the one that makes the gradients of the object function equal to zero. However, one thing I am confused is that why the first part and the second part of the object function are treated independently.  How could it be possible?


texts: Independent component analysis for one observation of a Signal

texts:
So I am a complete novice to ICA, so excuse my question if it is bad one, but I have the signal:

$$\sin(2\pi x) + \sin(4\pi x) + \textrm{Additive White Gaussian Noise}$$

I want to try to separate the two signals and apply a Fourier Transform on each one individually, to see if I can get a better spectral estimate than if they were together. I was thinking of using scikit's FastICA Algorithm. So my plan was to take the signal of length $3200$ samples, split it into $16$ windows each with length $200$ samples, apply a Hanning Function on each window, and do an ICA on 4 subsequent windows at a time.

Would this theoretically work, or does the ICA have to act on two different observations of a signal?
Is the ICA dependent on each observation of the signal having a different mixing matrix, or can it be the same?


texts: Simplest way to generate AR(2) process on MATLAB

texts:
As part of a project I need to use autocorrelation method of estimating model paramters of an autoregressive process on MATLAB.

Can anyone tell me the simplest way to generate an AR(2) process on MATLAB so that I can estimate its model parameters $\hat{a}_{p}(k)$ and $\hat{b}_{0}$?

The difference equation for the process is given below:

$$x(n) = -0.9x(n-1) + w(n)$$


texts:
Consider the context of image processing and computer vision, and, in particular, discrete Fourier transform.
For example, in the sentence

In the Discrete Time Fourier Transform the forward Fourier Transform correspond to a discrete function of a sequence $x[k]$, however the inverse transform still remains continuous:
$$x(t) = \frac{1}{2\pi} \int_{-\pi}^{\pi} \hat{x}(\omega) e^{j \omega t} d \omega, \; \forall t \in \mathbb{R}$$
the inverse Fourier Transform is typically limited to integration on $[−\pi, \pi]$ (with $T = 1)$ as frequencies outside of the interval just correspond to replicas of the original spectrum produced by the sampling procedure.

or in the sentence

To make the inverse transform treatable by modern digital computer, we need to discretize the spectrum of the signal as well

The word "spectrum" is used. I have seen it being used in several other places. However, I still do not get its meaning.
What is the spectrum? I think this is related to the concepts of time, frequency, spatial and spectral domains, but how exactly?
I have a little understanding of Fourier transform, but I haven't yet fully grasped the concept of discrete Fourier transform. Furthermore, my knowledge of signal processing, image processing and computer vision is very limited.


texts: How to classify audio files based on their ZCR, energy, and enthropy of energy features?

texts: Let's say I wanna classify the audio files of race car exhaust and normal car exhaust. I attain few features such as ZCR, energy and enthropy of energy from  the training set and I wanna build the prediction model out of those. How do I do that? Is there some machine learning model that I could use?


texts: References on the MP3 encoding algorithm

texts:
Does anybody have a reference describing the MP3 algorithm in a step-by-step manner and clear to understand?

These references were a little bit confusing:

Audio compression using modified discrete cosine transform,The MP3 Coding Standard, Joebert S. Jacaba, 2001
The Theory Behind Mp3, Rassol Raissi, 2002

I am willing to encode a bitstream to MP3 after reading the reference that you introduce, manually, for a complete understanding of the procedure.


texts: How are these 2 frequencies aliases of each other?

texts:
I'm trying to understand this solved example from a book, given an analog signal $x(t) = 3\cos(100\pi t) $. This signal has a frequency of $50hz$. If sampled at $F_S=75Hz$ ,I obtain the discrete time signal $3\cos(\frac{2\pi n}{3}) $.

Now I am supposed to find the frequency $F $ lying in the range $0 < F < F_S/2 $ that yields identical samples. Now I get that this frequency will be $F = 25Hz$ by using $f = \frac{F}{F_S}$.

However, I learnt earlier that this frequency is supposed to satisfy the relation $F_k = F_o +kF_S$ for integer values for k, and as it is obvious, there seem to be no integer solutions for this. Where am I going wrong ?

Any help would be appreciated.

Book Reference : https://engineering.purdue.edu/~ee538/DSP_Text_3rdEdition.pdf


texts: Role of Riccati Equations in Kalman Filter Design

texts:
I am working on a Kalman Filter (KF) design problem and I am struggling to understand the role of the Riccati equations in the design process of a KF.

Some sources discuss the importance of Riccati equations to the design of KF (e.g., Grewal and Andrews) while others do not mention it at all! Unfortunately, I have not actually found any source that really provides a good reason why I should care about these equations beyond a theoretical perspective (most just dive into the theory and do not explain why it is relevant). Given the depth of the math involved in to solve these equations, I would like to understand how important they are to a KF design process before committing (probably a lot) of time to understand them.

Here is what I think I understand about the role of Riccati equations for KFs:

The KF algorithm is an algorithm (numerical?) solution to the Riccati equation for the given system model. More specifically the state covariance matrix, $P$, is the solution to the equations when the KF is run for infinite time (assuming it converges at all).
We can (in principle, for simple systems) solve the Riccati equations ahead of time to find the $P$ matrix that the KF will converge towards if all operational assumptions of the KF are satisfied (e.g., Gaussian noise, etc.).

What I am trying to understand is the role of working out the solution (point 2 above) to the Riccati equations ahead of time? Is this simply a matter of allowing the designer to understand the idealized $P$ matrix for their filter? Why would I bother doing that over just using a simulation package (e.g., Simulink) to work out the value of $P$? What advantage does the analytical solution provide me?

Thank you!


texts: Convolution in frequency domain, what is the output bandwidth

texts:
If two signals do convolution in frequency domain, would the output width/BW be related to the width/BW input signals?
Would it be addition or any other?


texts: FIR filter digital differentiator with low cutoff

texts:
I'm trying to design a digital differentiator FIR Filter. It features a lowpass, such that above the cutoff frequency the amplification is very low. I get the coefficients by a linear program minimizing the chebychef error of desired and actual frequency response.

It works really well, but I cannot place the cutoff frequency below some 0.1*pi rad/sample. Small cutoff frequencies still have very steep rising amplitude responses in low frequencies and thus need a broad transition band.

The picture shows such a design and the very broad transition band. The red is the desired and blue obtained frequency response. I've weighted the bands accordingly. Also I'm not talking about bandpass, nor lowpass, I design a differentiator - thus the linear slew rate in low frequencies.

There are limits to the possible lowpass frequency, correct? How can I make the cutoff even smaller, or even better: why is this degradation happening?

I know, that the frequency response in my formulation has the form
$$
H(e^{j\omega}) = 2\sum_{k=0}^M j \,h(k)\, \sin(k \omega)
$$
where $M$ is $(N-1)/2$ with order $N$ filter. And thus the shape can be better traced by having longer filters. But the gain actually is very small.

Also I read, that with a derived then sampled Blackman Window (without control over cutoff frequency) one obtains a cutoff of around $\omega_C \approx 0.005$, while I struggle with $0.1$... I want to know why exactly.

This document suggests a method for a first order differentiator, where "only" the derivatives at $\omega = 0$ are matched to the ideal one. It results in an earlier drop off. However, as I understand it, this cannot be achieved with higher order differentiators, since second order is a quadratic function and I am not sure if a (basically taylor) approx in derivatives is sufficient for that. Let alone even higher orders.


texts: Filter design with zero - pole placement method

texts:
I have some question for you about Filter design.

Α. Calculate the transfer function in order to stop the frequency of $300\textrm{ Hz}$ for sampling frequency at $12\textrm{ kHz}$. Use the
zero – pole placement method
Β. Calculate the absolute value for the designed filter at $f_1=300\textrm{ Hz}$ and at $f_2=200\textrm{ Hz}$.

Can someone show me how can i solved this problem.


texts: Creating a noise model with a fixed PSNR

texts:
My goal is to create a noise model so that the PSNR of the noisy image compared to the original is some pre-defined constant $\alpha$. This means the mean squared-error will also be a constant.

My model is as follows:

The additive noise is a random normally distributed variable with $\mu = 0$ and unknown $\sigma$.

$K(i,j) = I(i,j) + f(x; 0, \sigma)$

So,

$$ MSE = \frac{1}{mn}\sum_{i = 0}^{m - 1}\sum_{j = 0}^{n - 1}\ [K(i,\ j) - I(i,\ j)]^2 = \frac{1}{mn}\sum_{i = 0}^{m - 1}\sum_{j = 0}^{n - 1}\ [\ f(x;\ 0,\  \sigma)]^2$$

where $$f(x;\ 0,\ \sigma) = \frac{1}{\sqrt{2\pi}\sigma}e^{\frac{-x^2}{2\sigma^2}}$$
i.e. the Gaussian pdf with unknown variance.

What I'm confused about is how to solve for sigma when the values of the pdf are supposed to be independent samples from the distribution. If I'm understanding correctly, this means that the MSE itself becomes a random variable and cannot be a constant.

If we were to make it a constant, wouldn't the values of $f(x)$ for each pixel have to already be known for the equation to be solvable? In which case the distribution would need to be already known to randomly sample the distribution to produce the values of $f(x)$...

Anyhow, if anyone has advice on how to construct noisy images with a pre-defined PSNR, that would be appreciated.


texts:
This might not be the right place to ask this, but I'm hoping someone can explain two of the arguments in the MATLAB fir2 function.  It is a function for designing filters using the frequency sampling method.  There are two optional arguments:

npt - Number of grid points, specified as a positive integer scalar. npt must be larger than one-half the filter order: npt > n/2.
lap - Length of region around duplicate frequency points, specified as a positive integer scalar.

I am struggling to find any meaningful literature around this so if anyone could explain these two in further detail or point me to something to read that would be greatly appreciated.


texts: Fourier transform and anti-trasform--identity missing

texts:
I have a very silly doubt:

If we define the power spectral density:

S(f)=$\frac{1}{2\pi}\int exp(-i\tau2\pi f)r(\tau)d\tau$ (1)

where $r(\tau)$ is the correlation coefficient.

If we do the Fourier anti-transform, we obtain
$r(\tau)=\int exp(i\tau2\pi f)S(f)df$ (2)

Now my doubt is: if I substitute in the second equation the first equation, it seems to me that I don't find the identity
$r(\tau)=r(\tau)$

I hope you can help me, maybe I am missing something


texts: difference equation block diagram delay or advance confusion

texts:
When does the unit delay, become unit advance essentially.
Goal is to deduce difference equation from block diagram.
Green text is notes about what the value should be in that node of the diagram.
It appears that the difference equation should be equal to
\begin{align}
y[n+2]&=x[n]&-&0.9y[n]\\
x[n]&= 0.9y[n]&+&y[n+2]
\end{align}

Green text denotes my personal notes.


texts:
I have used Scilab functions to produce a low-pass filter for an audio signal and the coefficients for the associated constant coefficient difference equation (CCDE).  I then produced filtered signals by running the Scilab filter() function and by running my implementation of the CCDE on the audio signal.  The results are identical.

The Scilab filter() function runs considerably faster, by perhaps a factor of 30.

I am new to DSP and I am trying to better understand what the Scilab filter() function is doing that allows it to use the same coefficients so efficiently.  In looking at the associated Scilab files, it looks like there is some compiled code behind the filter() function.

Any pointers as to technique or reference materials would be appreciated.


texts: Crop all written letters from single image

texts:
Above image has handwritten hindi / deavanagari letters all on a single

image.
Task is to Prepare a dataset from the given assignment.jpg image using image

processing tools
Idon't have clarity whether i can use photoshop editing tools like adobe photoshop etc.
If image processing tools mean opencv , is it really possible to create like a emnist like dataset from single image.
I am not able to come up with any way to seperate the letters from eachother


texts: PSD of a sum of two stationary real signals

texts:
I have 4 signals ($w_1(t),w_2(t),u_1(t),u_2(t)$ of which I know the power spectral densities (PSDs) $S_{w_1,w_1}(\omega),S_{w_2,w_2}(\omega),S_{u_1,u_1}(\omega),S_{u_2,u_2}(\omega)$ and the cross PSD $S_{w_1,w_2}(\omega),S_{w_1,u_1}(\omega),S_{w_1,u_2}$,... etc for all.

Is it possible to obtain the PSD of $S_{\Gamma,\Gamma}(\omega)$:

$\Gamma(t)=w_1(t)-w_2(t)-u_1(t)+u_2(t)$

using the PSDs that I know?


texts: Understanding SURF Features Calculation Process

texts:
So, I was reading the paper on SURF (Bay, Ess, Tuytelaars, Van Gool: Speeded-Up Robust Features (SURF)) and I can not comprehend this paragraph below:

  Due to the use of box filters and integral images, we do not have to
  iteratively apply the same filter to the output of a previously filtered
  layer, but instead can apply box filters of any size at exactly the
  same speed directly on the original image and even in parallel
  (although the latter is not exploited here). Therefore, the scale
  space is analysed by up-scaling the filter size rather than iteratively
  reducing the image size, figure 4.

This is figure 4 in question.

PS: The paper has an explanation of integral image, however the whole content of the paper is based on the particular paragraph above. If anybody has read this paper, can you briefly mention what is going on here. The whole mathematical explanation is quite intricate to have a good grasp first up, so I need some assistance. Thanks.

Edit,couple of issues:

1.

  Each octave is subdivided into a constant number of scale levels.
  Due to the discrete nature of integral images, the minimum scale
  difference between 2 subsequent scales depends on the length lo of the
  positive or negative lobes of the partial second order derivative in
  the direction of derivation (x or y), which is set to a third of the
  filter size length. For the 9x9 filter, this length lo is 3. For two
  successive levels, we must increase this size by a minimum of 2 pixels
  (one pixel on every side) in order to keep the size uneven and thus
  ensure the presence of the central pixel. This results in a total
  increase of the mask size by 6 pixels (see figure 5).

Figure 5

I could not make sense of the lines in the given context.

  For two successive levels, we must increase this size by a minimum of
  2 pixels (one pixel on every side) in order to keep the size uneven
  and thus ensure the presence of the central pixel.

I know they are trying to do something with the length of the image, if its even they are trying to make it odd, so that there is a central pixel which will enable them to calculate the maximum or the minimum of the pixel gradient. I am bit iffy about its contextual meaning.

2.

In order to calculate descriptor Haar wavelet is used.

How is the middle region has low $\sum\ dx$ but high $\sum\ |dx|$.

3.

What is the necessity of having an approximate filter?

4.
I have no issue with the way that they found out the size of the filter. They "did" something empirically. However, I have some nagging issue with this piece of line

  The output of the 9x9 filter, introduced in the previous section, is
  considered as the initial scale layer, to which we will refer as scale
  s = 1.2 (approximating Gaussian derivatives with  σ= 1.2).

How did they found out about the value of σ . Moreover how does the calculation of scaling done shown in the image below.The reason I am stating about this image is that the value of s=1.2 keeps on recurring, without clearly stating about its origin.

5.
The Hessian Matrix represented in terms of L which is the convolution of second order gradient of Gausssian filter and the image.

However the "approximated" determinant is said to contain only terms involving second order Gaussian filter.

The value of w is:

My question why the determinant is calculated like that above, and what is the relationship between approximate Hessian and Hessian matrix.


texts:
I have already tried searching about subject and the only one thing I could understand is that computer vision involves object recognition but image processing does not involve object recognition

What are other differences between image processing & computer vision??


texts:
IIR filters have feedback whereas FIR filters don't use feedback.
Then why is it said that FIR filters sometimes have the disadvantage that they require more memory and/or calculation to achieve a given filter response characteristic?

Can you please explain explain what is it that makes FIR filter computationally more complex compared to IIR although it doesnt use feedback?


texts: How to reverse frequency spectrum of a 2D image?

texts:
Reversing spectrum of an audio signal is said to be often used in DSP – i.e. applying a low-pass filter is quite a simple operation, compared to a high-pass. So they shift the specrtum by multiplying each other sample by -1, apply the Low-pass filter and then reverse again.

I am wondering if the same processing technique could be applied to images: reverse frequencies, apply edits/processing, reverse again.

Please advice how can a spectrum of a 2D signal be reversed?

Is it something as simple as each other sample inversion as for a 1D audio signal? I'd prefer some code snippets / visual examples to math equations.

I also wonder if FFT of an image, reversing the frequencies, IFFT, FFT, another reversing, IFFT can be considered lossless to the source image?

Upd. I found an amazing github repo "javascript-labs" containing FFT / IFFT implementations in JavaScript. It helped me understand the spectrum inversion better. They just swap quadrants of the FFT image to reverse the spectrum.

Also I discovered to myself that a 2D FT can be parallelized into 1D FT's for vertical and horizontal pixel sets.

My research goal is to find a reversible transform of a source image "S" to another image "T", such as that T carries no visual clues to the content of the original image S. A transformation that is reversible, and also not dependent on precise pixel-to-pixel correspondence. I.e. it should be possible to recover original image S after taking a photo of a printed poster with transformed image T – of course with adequate losses / distortions / color regression. Hypothesis that reversing spectrum of an image would scramble it original content has failed.


texts: Analysing 2500 frequencies using FFT with an input vector of 2048 samples?

texts:
I am currently reading the paper A Highly Robust Audio Fingerprinting System and on page 4 one can read about the technical parameters they use: Sampling rate of 5000 Hz, frames of 2048 samples as input to the FFT and with these settings they analyse frequencies from 300 Hz to 2000 Hz. Here are the respective quotes:

  Since  the  algorithm  only  takes  into  account  frequencies
  below 2kHz the received audio is first down sampled to a mono
  audio stream with a sampling rate of 5kHz.

.

  The most computationally demanding operation is
  the Fourier transform of every audio frame. In the down sampled
  audio signal a frame has a length of 2048 samples.

.

  These bands lie
  in  the  range  from  300Hz  to  2000Hz

What I don't understand: How can one analyse frequencies up to 2000 Hz using 2048 samples as input to the FFT? As far as I know the FFT output is mirrored, therefore with 2048 samples as input I get an output vector of length 2048, however what I can effectively really use are the first 1024 values (2048/2 due to mirroring). So I would have only 1024 values for 2500 different frequencies? (sample rate is 5000 Hz and according to Nyquist maximum possible frequency therefore 2500 Hz)

Thanks for any hint!


texts: mathematical expression to detect modulated data within a vector

texts:
Assume I have such modulated data which is, for example, $x=0.7+0.7i$. That modulated data is encapsulated in a vector as below:

OR

where $c$ is any constant number, let’s say, for example:  $c=0.7$ . My question is how can I detect if the received vector is $y_1$   or $y_2$ ? I mean is there a mathematical expression I can apply for detection?


texts: Adequate representation of frequency domain amplitude/magnitude of FFT of a signal

texts:
I'm quite new to the subject and am having fun playing around with the FFT. What I am currently doing is trying to sample an audio signal and display its frequency spectrum at the same time. This works alright with what I am doing so far, but there are still a few missing puzzle pieces.

This is what I have implemented so far:

I get the raw audio data (i.e. my signal) and sample it with a sampling frequency of 44.1 kHz.
For each time instance of the audio file where I update the spectrum (e.g. every 1/24 th second), I grab a certain amount of samples from my sampled signal around the time instance, apply a window function to it (Hann window) and then I transform it using the fftw library.
Then I look at what I get. Since all my input data is real, I get n/2 + 1 complex values, am I correct in that assumption?
Now, I'd like to display this spectrum. I calculate the magnitude of each of the n/2 + 1 vectors using the l2-norm and try to display that.

The last part is where I'm note sure of how to proceed. First, is this magnitude I calculate called the amplitude in frequency domain or am I mixing stuff up?
As far as I know, the amplitude of the original signal in the window I transformed is somehow spread across my spectrum (i.e. my frequency bins).
What I am looking for is a nice mapping in order to display these frequency bins nicely (in fact...I always group a few together to get larger frequency bands).
Here is what I am trying to do:
For my visualization, I have 12 bands and each has 15 discrete levels. So effectively what I am doing so far is trying to map the maximum of all bins in a frequency band into {0,1,...15}.

I have just been playing around so far, trying things like logarithms and linear mappings, but none seem be giving me the results I am expecting. For example, the lower frequencies might have a very high amplitude where higher ones are comparatively low, even though the corresponding audio signal would have me expecting higher magnitudes for the higher frequency bands.

So my main question, could this be mainly due to the fact that I am always picking the maximum? Would a mean value over all bins in a band be better?

My gut tells me thats just the tip of the iceberg. A linear transformation is, for example, difficult to adjust since I don't know what the maximum frequency magnitude is when I am calculating my spectrum on the fly.

I would appreciate it if some of you Gurus could help me learn what I am missing and, perhaps, tell me if there is anything horribly wrong with what I am doing up to the point where I want to visualize the calculated spectrum.

Cheers!
Brick


texts:
I'm trying to apply the compressed sensing theory (CoSaMP algorithm) to the DOA estimation in FMCW ULA (made of 48 elements). In the dechirped signals processing I use a first FFT to solve the range and then instead to apply another FFT along the cross-range direction (following the standard 2D FFT) I use CoSaMP algorithm to get the direction of arrival bin by bin.
If we refer to the equation (per each single range bin):
y = Φ Ψ s
y contains all the 48 FFT complex values, Φ is the measurement matrix that I use to select 30 out 48 antennas, Ψ is the representing FFT basis matrix, and s the sparse solution I look for (the same length of y vector)
In the below figure 1 the range-angle radar images that I got using  a)CoSaMP (30 out 48 randomly chosen antennas) on the real part of the first (range) FFT complex output and b)FFT of order 180 on the first (range) FFT complex output. I have two main questions:

Is it possible to run the CoSaMP (or another CS algorithm) on complex values? As you can see in the image1 I got a symmetrical output due to the fact I'm applying the CoSaMP to the real values of the complex FFT output (range).
How I can improve the resolution in the sparse domain? This is subjected to the basis matrix dimension (in my case 48*48).

Thanks,


texts: What Is the Significance of a Large Residual When Applying Principal Component Analysis?

texts:
I am using Matlab function PCA (principal component analysis) to reduce the dimensionality of a data set with approximately 20 000 observations x 100 dimensions.

After having obtained the principal component coefficients of the data I recreated the input signal in the original coordinate system using the transformation matrix from the PCA function. This yielded a very large residual when comparing with the input signal. I have tried around with different data sets and sizes and it appears to be commonplace to have a large residual. I am not sure yet whether it is due to round-off errors or high SNR in the input data. The dimensionality reduction could of course still be useful, but is this something that one should be cautious about when performing principal component analysis? Or is there another metric that is better to assess the performance of the principal component analysis?


texts: Calculating the magnitude spectrum and phase spectrum

texts:
From a window function $x(t)=u(t+2)-u(t-2)$, we can get the Fourier Transform $X(j\omega)=\frac{2\sin(2\omega)}{\omega}$.

Then, I want to calculate its magnitude spectrum and phase spectrum.

The magnitude spectrum is the magnitude distribution at every $\omega$, so it's simply absolute value of $X(j\omega)$, is this correct?

And how to calculate the phase spectrum?


texts: Is uniform noise present in some real processes?

texts:
Is noise with uniform distribution present in some real-life applications?

It seems that most of the internet sources describe uniform noise as something theoretical.


texts:
Given a LTI-system  $$y[n]=x[n]-2x[n-1]+y[n-1]- \frac{8}{9}y[n-2]$$
The transfer function $H(z)$ is:
$$H(z) = \frac{1-2z^{-1}}{1-z^{-1}+ \frac{8}{9} z^{-2}} $$
How do I calculate the amplitude transfer function so I can plot a Bode diagram like this? (in hand, not in MATLAB)

I thought that I should substitue $z=e^{j\omega}$ in $H(z)$, but it doesn't seem to be right. I hope you guys can help me out.


texts: Image Processing and applicability of 2D Fourier Transform

texts:
As a newbie in the world of signal processing, I am having a hard time in appreciating image 2-D fourier transforms.

I am fully able to appreciate the concept of 1-D Fourier transform. Essentially, given a random causal signal, it can be decomposed into sinusoids. We cross-corelate known sinusoids (Basis functions) using FT and obtain the frequency spectrum. This is just perfect.

Please help me understand why in image processing, transformation along both axes is needed.

Given a greyscale image, like the Lena image, stored in a matrix $M \times N$, I infer the following:

Pixel intensity varies from left to right
Pixel intensity also varies top to bottom
A FT performed on 1 Row, Left to Right, gives us a spectrum of frequencies belonging to that row
Similarly, such a FT can be individually performed on each of the rows.
So in the end, we end up with M frequency lists of frequencies. e.g., Freq-List[Row-0] = {f1, f2, f4 ... fj}, Freq-List[Row-5] = {f2, f11 ..}

With this data, the Row frequency lists, will we not be able to tell how each pixel is affected by frequencies of that row? Shouldn't the row frequencies be sufficient?

Will the frequency lists along the columns also have a bearing on the pixels?