texts: FIR-Decimation and Low-pass filter (taps vs number of input points vs number of decimation stages)

texts:
I am new to digital filters and trying to understand parameters behind them.

Scenario

I am trying to get DC value from signals sampled at 100kHz sampling rate. such high frequency is used due to system hardware limitations. A very sharp low-pass filter is to be used with cut-off frequency at 1Hz. The plan is to capture 10000 ponints first and then FIR-Decimate the income signal with several stages:

stage 1: decimation factor 10, FIR cutoff frequency 1/20 (128 taps), 100kHz->10kHz

income 10000 points, result 1000 points

stage 2: decimation factor 10, FIR cutoff frequency 1/20 (128 taps), 10kHz->1kHz

income 1000 points, result 100 points

stage 3: decimation factor 10, FIR cutoff frequency 1/20 (128 taps), 1kHz->100Hz

income 100 points, result 10 points

stage 4: decimation factor 10, FIR cutoff frequency 1/20 (128 taps), 100Hz->10Hz

income 10 points, result 1 point

Then a FIR with cut off frequency will be implemented with cutoff frequency 1/10.

Questions

In the FIR decimation, the FIR cut-off frequency is always stricter than the decimation factor to avoid aliasing, is this design necessary?
What are the tradeoffs of choosing number of decimation stages and decimation factors?
At stage 4, there are only 10 income points. However, FIR has 64 taps... Would the one point result still be valid?


texts: Missing delay in heavyside step function

texts:
I found the following task that was inspired by an example in the book A. V. Oppenheim and R. W. Schafer, "Discrete-Time Signal Processing", 3rd Edition, 2014.

Task:

Consider the 2nd-order IIR filter $$H(z) = \frac{1}{1 - 2\cos(\theta)z^{-1} + z^{-2}}\,.$$

Show that the impulse response $$h[n] = \frac{\sin(\theta(n+1))}{\sin(\theta)} u[n] \, ,$$ with $u[n]$ the heavyside step function.

My solution:

I started from
$$
\sin(\theta n) u[n] \leftrightarrow \frac{\sin(\theta)z^{-1}}{1-2\cos(\theta) z^{-1} + z^{-2}} \, ,
$$
which I looked up in a table and divided both sides by $\sin(\theta)$, i.e.
$$
\frac{\sin(\theta n)}{\sin(\theta)} u[n] \leftrightarrow \frac{z^{-1}}{1-2\cos(\theta) z^{-1} + z^{-2}} \, .
$$
Now I just had to get rid of $z^{-1}$, hence I multiplied with $z$ in z-domain, which corresponds to a convolution with $\delta[n+1]$ in time-domain, i.e.
$$
\frac{\sin(\theta (n+1))}{\sin(\theta)} u[n+1] \leftrightarrow \frac{1}{1-2\cos(\theta) z^{-1} + z^{-2}} \, .
$$

Comparing my solution with $h[n]$ in the task above, the only difference is the delayed function $u[n]$.

Does anybody see what I might did wrong or what properties can be exploited here?


texts: Why is one of the modulated frequency spikes smaller?

texts:
This is a simple amplitude modulation experiment. Both waves are sinusoids of the type

cos(2 x pi x f x t).

The base signal has a frequency 100Hz, and the carrier wave frequency is 1000Hz. The three figures below are the modulated signal in time and frequency domain for three different sampling periods.

For sampling frequency, Ts = 3000Hz

For sampling frequency, Ts = 4000Hz

For sampling frequency, Ts = 10000Hz

I expected both frequency components at 900Hz and 1100Hz to be of the same height. Except for the case when sampling frequency is 4000Hz, in the other cases this is not so. Why?


texts:
In the article Analysis of the Performance of a Non-Coherent
Large Scale SIMO System Based on M-DPSK
Under Rician Fading Fig.1:

I would like to know if we could invert the block of the sum with the symbol detection. That is to say, make a symbol detection on each antenna and after the sum where the bit $0$ is defined by $-1$. I would like a mathematically justified answer


texts: Why does the autocorrelation get its peak at zero?

texts: I know that zero shifting in the autocorrelation function is equal to its energy, yet, I would like to understand why the peak is at zero.


texts: Relationship between Bandwidth and Bit Rate

texts:
In one of my classes I have learned that if we look at transmitting a binary signal with ASK, we can get the bandwidth (i.e. the width of the main lobe in the frequency domain) with BW = 2 * Fb, where Fb is the bit-rate (i.e. 1/T, where T = 'length' of one bit).

I am a little confused as to how this BW <-> Fb relation comes to be. Intuitively I understand that if we assume a carrier frequency of 2GHz and transmit a signal with a bitrate of 5 bits/s, we simply modulate the amplitude of our 2GHz carrier signal, without any frequency changes. Why, then, do we have a lobe in the frequency domain with a width that is greater than 1? As I understand it, there is only one frequency, the 2GHz signal?.. I know my understanding is wrong, but intuitively I do not understand how we have a variance in frequency, independently of what our bitrate is. How is modulating the amplitude of a 2GHz signal 5 times a second different from doing it 20 times a second when viewed in the frequency domain?


texts:
For the problem given in the fig. how to solve it?

My approach:

Let $y(n)$ be the first output (e.g for 1st case output of system $A$ is $y_1(n)$; for 2nd case output of system $B$ is $y_2(n)$, then $$y_1(n)=x_1(-n)$$ $$V_1(n)=y_1(n+1)=x_1(-n+1)$$

And for the 2nd case:

$$y_2(n)=x_2(n+1)$$ $$V_2(n)=y_2(-n)=x_2(-n-1)$$

So if $x_1(n)=x_2(n)=x(n)$, then $$V_1(n)=x(-n+1)$$ $$V_2(n)= x(-n-1)$$

So the answer should be 'C', but the given answer is 'B'.

What is the mistake and how should I proceed?


texts: Frequency estimation of circularly shifted single tone signal

texts:
I have a discrete signal $y[n] = <e^{j ~ 2 \pi f ~ n}>_J + ~w[n]$ with $n \in [0, N[$ and $w[n]$ AWGN, $<x[n]>_K$ denotes the signal $x[n]$ circularly shifted by $K$ samples. Let's define $Y_k = \mathrm{DFT}(y[n])$ the output of the $N$-point DFT of $y[n]$. By ignoring the AWGN and using well-known Fourier properties, we can deduce that $Y_k$ is a sinc function centered around $f$, multiplied by $e^{\tfrac{k J}{N} }$ due to the circular shift.

In my application, $J$ is unknown to me but I am interested in obtaining an estimation of $f$ (which is real-valued in $[0, N[$). Over the years, many estimators $\hat{f}$ for single tone signals $z[n] = e^{j ~ 2 \pi f ~ n} + ~w[n]$ have been designed, and they work fairly well.
These estimators rely either on the complex values $Z_k$ (i.e. the DFT of $z[n]$, see e.g. [R1], which I can't use because I don't know $J$), or use the amplitudes of interpolated DFT bins, e.g. $\hat{f}_{res}$ which computes the residual frequency offset inside two DFT bins from [R2]:

$$ \hat{f}_{res} = \frac{|\bar{Z_1}|^2 - |\bar{Z}_{-1}|^2}{u(|\bar{Z_1}|^2 + |\bar{Z}_{-1}|^2) + v|\bar{Z_0}|^2} $$

where $\bar{Z}_k$ is the zero-padded $2N$-point DFT ($N$ points are from $z[n]$, the following $N$ points are $0$). $\bar{Z}_0$ is the bin with greatest amplitude and $\bar{Z}_1$/$\bar{Z}_{-1}$ are its neighbors. It is interesting to note that in the case of a $N$-point DFT, $|Y_k| = |Z_k|$. However this property does not hold anymore for the interpolated bins in $\bar{Y}_k$ obtained through the zero-padding, and I am unable to figure why analytically.

Here's an illustration of the difference of amplitudes between $\bar{Z}_k$ (zero-padded DFT of true single tone signal) and $\bar{Y}_k$ (zero-padded DFT of the circularly shifted signal):

and the MATLAB code used to generate the figure:

N = 256;
f = 100.4/N;
J = 125;

% Compute z[n]
n = 0:(N-1);
z = exp(2*pi*1j*f*n);

% Compute zero-padded DFT Z[k]
z2 = zeros(1, N*2);
z2(1:N) = z;
Z2 = fft(z2);

% Compute zero-padded DFT Y[k]
y2 = zeros(1, N*2);
y2(1:N) = circshift(z, J);
Y2 = fft(y2);

subplot(2, 1, 1);
stem(abs(Z2));
hold on;
stem(abs(Y2));
xlim([1 2*N])
legend('|Z(k)|', '|Y(k)|', 'Location','northwest')

subplot(2, 1, 2);
stem(abs(Z2) - abs(Y2))
xlim([1 2*N])
legend('|Z(k)| - |Y(k)|', 'Location','northwest')

Does someone have any clue on how to model analytically the interpolated DFT bins in $\bar{Y}_k$, or the DTFT of $y[n]$ ? Thanks.

[R1] https://www.researchgate.net/publication/3321864_Fast_Accurate_Frequency_Estimators_DSP_Tips_Tricks

[R2] https://ieeexplore.ieee.org/document/5910415 (unfortunately behind a paywall)


texts: How to deal with variations in amplitudes when doing voiced/silence detection?

texts:
I have a collection of wave files that has a few well separated words spoken. My goal is to split them into individual files. I wanted the program to work on all files, not just one of them or require tuning on each one.

So I get started to look at the wave forms. They are well separated. The recording environment can be noisy or quiet.

To suppress the noise, I made a simple non-linear transformation to suppress number with small amplitude and expand the other as follow

$ y[t] = e^{x[t] * x[t]/M} $ where M is the maximum of the squares, that is, the exponent is at most than 1. That leads me to this:

With that, it is fairly easy to segment the audio. I used a Hidden Markov Model for that purpose, but we have a problem here:

In this case, the audio has an interesting peak at the second word, all the rest are normalized according to the max. Note that it is still pretty easy to eyeball the separation, but it would be hard to find a single threshold (or in my case, a single HMM) that fits all the files.

I think I will need some adaptive techniques. I was thinking something like adaptive thresholding in image processing, but I have no control on how long the silence would be so there is no good window to use to find the threshold.

Any idea how to deal with the variations? I could have train a different HMM for each file on the fly, but that is really slow.


texts: Fitting new images from a SVD/PCA calculation

texts:
I'm trying to replicate the ideas from the Eigenface page on wikipedia. From a hundred sample images represented by a data matrix $\bf X$ (where each image flattened to a vector of length $n$, thus $\bf X$ is a $100$ by $n$ matrix), I've computed a SVD decomposition:

\begin{equation}
\bf X = U \Sigma V^{T}
\end{equation}

hence:

\begin{equation}
\bf X X^{T} = U \Sigma^2 U^{T}
\end{equation}

By taking a subset of the largest $q$ eigenmodes, I can approximate the matrix (let $\sigma_1 \ge \sigma_2 \ge \cdots$):

\begin{equation}
{\bf X} \approx \sigma_1 u_1 v_1^{T} + \sigma_2 u_2 v_2^{T} + \cdots + \sigma_q u_q v_q^{T}
\end{equation}

Now given a new vector $y$, which represents an image not in $\bf X$, how do I determine the weighting of the $q$ eigenvectors $\bf U$ to best represent my new image $y$? Except for pathological cases, is this representation unique?

In short, what I'd like to do is this (from the wiki page):

  These eigenfaces can now be used to represent both existing and new faces: we can project a new (mean-subtracted) image on the eigenfaces and thereby record how that new face differs from the mean face.

How do I do that projection?


texts:
I want to count the threads of a bolt in an image. My solution is this:

capture an image
Find the bolt
Get one dimentional data from it's top to bottom
Find the thread count from signal

This is the bolt with a red line specifying where the samples are being picked:

And this is the generated signal from pixels in the image:

How can I get thread counts from this signal?

How can I find the threads part?


texts: Sound glitches using fft segmented convolution

texts:
I’m trying to build a binaural audio player, I'm using MIT Kemar c library to get the hrtf and a fft segmented convolution. It works on real time but the problem is each time I change the hrtf I hear noises like small cracks or something like vinyl noise. But I'm not sure why. Please help.
If you are interested in the project here is my github repo:
https://github.com/Bk8/Binaural


texts: Why using a secondary observation increases the estimation variance?

texts:
The output of a 2-input 2-output communication channel is given by:

$x^{(i)}(t) = \sum_{j=1}^{2}\sum_n {a^{(j)}_n}h_{ij}(t-nT-\tau^{(j)})$,

where $x^{(i)}(t)$ is the i-th output, $\{a^{(j)}_n\}$ are BPSK symbols of the j-th input, $h_{ij}(t)$ is the channel response from input j to output i, $T$ is the symbol period, and $\tau^{(j)}$ is the timing offset associated with input j.

I estimate the parameter $\tau^{(1)}$ using a linear combination of the past samples $x^{(i)}(t)$ according to:

1) $ \tau^{(1)} =  x_k^{(1)}a_{k-1}^{(1)} - x_{k-1}^{(1)}a_{k}^{(1)}$

2) $ \tau^{(1)} = \sum_{i=1}^{2} (x_k^{(i)}a_{k-1}^{(1)} - x_{k-1}^{(i)}a_{k}^{(1)})$

where $x_k = x(kT)$. Both are unbiased estimators.

Method 2 is supposed to be an extension of method 1 where we utilize the secondary output, $x^{(2)}(t)$ in addition to $x^{(1)}(t)$ for a better estimation. However, my simulations shows method 2 has much higher estimation variance than method 1, if output 1 picks up more of input signal 1 than input signal 2, for example when:

$h_{11} (t) = h_{22} (t) = 0.8 \times sinc(t/T)$ and $h_{12} (t) = h_{21} (t) = 0.2 \times sinc(t/T)$.

Is there a better way to utilize both outputs without an increase in variance?


texts:
Which bins of FFT result are useful? For example I made FFT on 1024 real samples, and it produced result with 1024 complex samples.
I read somewhere, the only half of that result is useful if input samples are of type real.

Is bin number 513 (nyquist frequency) useful? Should I cut this bin or it should stay?


texts: Finding The Coefficients of the digital filter?

texts: I want to design a digital filter for pulse shaping. Pulses are of 100us Fall time. and the sampling rate is 100MegaSamples/sec. and the Shaping time is 5us. What should my coefficients be??? And how to obtain them using matlab or any other related software.


texts: adequate sampling frequency in measuring acoustic emission

texts:
I am measuring acoustic emission signals. The a.e. frequency range is 20kHz to 1 MHz. The sampling frequency that I,set was 100kHz
Samples per second. I must be able to detect a maximum of 50 kHz signal using it. But when I do fft I get a maximum of only 300Hz.

Can anyone tell me where I would have gone wrong?


texts: Variance and Co-variance of a Linear Forecast

texts:
Consider a linear forecasting problem where all shocks $\{\epsilon_i\}_1^n$ are independently distributed with $\epsilon_i\sim N(0,\sigma_i^2)$ for all $i$. Suppose you want to forecast $\theta = \sum_{i=1}^m a_i \epsilon_i$ for $m<n$, while observing signals $\mathbf x = \{x_j\}_1^p$ with each $x_j=\sum_{i=1}^n b_{ij} \epsilon_i$.

Let $\mathbb E[\theta|\mathbf x]$ denote the optimal forecast, that minimizes the mean squared error. I want to show that

$$\frac{\partial\operatorname{Cov}(\mathbb E[\theta|\mathbf x],\theta)}{\partial \sigma_i}<0, \quad\text{for }i\in\{m+1,\dots,n\}.$$

I think this is true because an increase in the variance of $\sigma_i$ for $i\in\{m+1,\dots,n\}$ makes the signals more noisy, therefore, the forecast less accurate.

By a similar argument it should also be possible to prove that

$$\frac{\partial\operatorname{Var}(\mathbb E[\theta|\mathbf x]|\epsilon_i)}{\partial \sigma_i}<0, \quad\text{for }i\in\{m+1,\dots,n\}.$$

For simple examples of this problem I've been able to prove this, but I haven't been able to generalize it. I suspect these results might exist, so just a reference of where I could find them would be of great help.


texts: Why is the relationship between Es/N0 and SNR different for complex and real signals?

texts:
I try to use the AWGN Channel model of MATLAB to build my simulation model, but the explanation of the relationship between Es/N0 and SNR in the official manual of MATLAB makes me confused.
It says that :

\begin{align}
E_s/N_0 \ \text{(dB)}&= 10\log_{10}(T_{sym}/T_{samp})+SNR\ \text{(dB)}\quad\text{for complex input signals}\\
E_s/N_0 \ \text{(dB)}&= 10\log_{10}(0.5T_{sym}/T_{samp})+SNR\ \text{(dB)}\quad\text{for real input signals}
\end{align}

I wonder why there is a $3\ \rm dB$ difference whether the signal is complex or real.


texts: How can I calculate the amplitude of a signal from its power in dBm?

texts:
$$\begin{align}
P_\text{out} &= 51.787\text{dBm}\\
P_\text{out} &= 10\log_{10}\frac{A_\text{out}^2}2\\
A_\text{out} &= \sqrt 2 \cdot 10^{\frac{P_\text{out}}{20}}\\
&= 549.3701
\end{align}$$

Is this calculation correct to yield the amplitude of my output signal when the output power in dBm is given? Or do I have to calculate power in dBW first? I assume an average output power of $P_{out} = A_{out}^2/2$


texts: How to Calculate the Hann Low Pass Filter / Kernel for Image Processing

texts:
I'm currently studying for an exam in image processing and stumbled upon a exercise which i could not answer and my professor will not be available before the exam anymore. The exercise goes as follows:

  Create a Hann-lowpass kernel of size $3\times 3$ and calculate the result of the convolution at $(2,2)$ in the image.

The given solution for the filter kernel is shown below, but I do not understand how he got there:

$$
A = \frac{1}{4}
\begin{pmatrix}
\frac{1}{4} & \frac{1}{2} & \frac{1}{4}  \\
\frac{1}{2} & 1 & \frac{1}{2}  \\
\frac{1}{4} & \frac{1}{2} & \frac{1}{4}  \\
\end{pmatrix}
$$

The second part of the question is a simple convolution with the image which I'm able to do. The factor in front of the kernel is given by the constraint $ \sum A = 1$ to achieve a filter gain of one.
I've done literature research but none of the books in the library do explain how to calculate such a kernel. The professor gives a "hint" in his presentation pointing to the generalized cosine window with $A = 0.5$, $B = 0.5$ and $C = 0$:

$$
w_k = A - B\cdot \cos\left(2\pi\frac{k}{K-1}\right) + C\cdot \cos\left(4\pi\frac{k}{K-1}\right)
$$

Yet I cannot derive the final kernel from the given formulas. Can anyone give me a step by step solution for the problem?


texts: Where has this complex component come from?

texts:
I'm trying to do an exercise where I have to link the images below to eachother. I'm fairly sure R1 and R4 go together but I'm not sure where the 0.25+/-j0.43 has come from.
If my reasoning is correct the 2.5 is the frequency and the 1 is the DC offset of the signal (please correct me if I'm wrong) and the equations with cosines have been found with Euler.

Thanks


texts: Calculating phase response of maximum phase filter using Hilbert Transform

texts:
Given only a magnitude response $A(\omega)$ of a minimum phase filter, one can calculate the phase response using the Hilbert Transform:

$$θ(ω) = -\mathcal{H}\{\ln(A(\omega)\}$$

This paper suggests that there is another Hilbert Transform relationship between magnitude and phase for maximum phase filters, but I can't find anything beyond that in the cited references and elsewhere.

Does anybody know what the exact Hilbert Transform relationship is between magnitude and phase for maximum phase filters?


texts:
I'm trying to calculate the short term energy of a digital signal
in python, using a rectangular window, but don't understand
the basics of how this works, a pointer to any good explanation would be great.

Specific things I'm confused about:

Where do I initialise the window? (at position 0,window_length,
or -window_length,0, and then work through the signal? ...)
If I sum up the squares of all samples at every position inside the window,
don't I end up with a 'square signal', where all the values are the
same for the length of the window step?

Thanks.


texts: What statistic is used to determine presence of a signal in noise?

texts:
This is a detector problem I believe:

I am being stumped by what appears to be a simple problem. Basically, I have a band of interest. If signal energies exist within this band of interest, then I perform operation X on my signal.

My problem is that I am not sure exactly how to go about 'deciding' if a signal exists or not. In that, after I perform an FFT, I can look for peaks.

But now what?

Is the statistic used usually comparing this peak to the surrounding mean of the spectrum? Or is it some other statistic?
What statistical measure do I use to simply determine if a signal is present, and go from there?
How do I set this value? Simple thresholding?

EDIT Based on feedback:

For this simple case, I am assuming a tone, in white gaussian noise. What I am trying to get  a handle on are:

How exactly does one generated a ROC curve. Does one have to go and label all the data first, and then get the true-positive and false-positive rates for a multitude of thresholds?
How does decreasing SNR affect the ROC curve? Move it towards the diagonal?
What is adaptive thesholding doing to a given ROC curve that was otherwise generated without an adaptive threshold?

3a. What are some common adaptive threshold techniques I can look at that are common?


texts:
I'm studing Representations of Random Processes and the book talks about Orthonormal functions, but doesn't make it clear what is it.
I was able to realize that a set of functions are orthonormal if they are normalized and orthogonal.
I'm familiar with the concept of orthogonal functions, but I couldn't find out what exactly is a normalized function in that case, since is a widely used term in math.
I'm studing using the following book: Detection, Estimation, and Linear Modulation Theory Part 1 by Harry L. Van Trees


texts: How do piecewise affine transformation work?

texts:
How can piecewise affine transform be used to warp an arbitrary collection of input landmark coordinates to a corresponding set of base coordinates?

Can anyone give any physical examples, the book I am currently reading on image processing dose not seem to give a good explanation, and I can't find any physical example on the internet.


texts:
I've just one question :

How can I write a model like y = x + w,( with w a white gaussian noise) with a fixed SNR and a noise variance equal to 1. What coefficient may I have before x ?

Thanks !


texts: Loosing information in decimation - without aliasing

texts:
We sample each other sample (01010101). Now say we have a signal - that is inside the original sample which has the pattern of (010-1).
Decimation gives us 000 for this sub-signal.
How to prove this is an example of aliasing? Or why else do we have lost information?


texts: Record Signal after Threshold Reach in GNU Radio

texts:
I would like to use GNU radio to begin recording a predetermined number of complex samples to a file sink automatically as soon as a signal magnitude threshold is reached. For example, as the gnu radio flow graph is running, it should be monitoring a signal and waiting for the amplitude to reach a threshold. As soon as the threshold is reached, the next 10,000 complex samples should be written to a file sink. No more samples should ever be written to the file.

What is the best way of doing this?

Is this possible to accomplish using a custom embedded python block that has one input and one output that only allows a predetermined number of samples through to the output after the threshold has been reached and never allows any more samples through?


texts: Design of FIR Filters with Arbitrary Magnitude and Phase Responses

texts:
I found many information in this thesis "Algorithms for the Constrained Design of Digital Filters with Arbitrary Magnitude and Phase Responses",i want to understand it.

This question is a continuation of a previous question(Complex Least Squares Approximation).

in Matt L's answer

$$H(e^{j\omega})=\sum_{n=0}^{N-1}h[n]e^{-jn\omega}=\mathbf{c}^H(\omega)\cdot \mathbf{h}\tag{1}$$

I want to approximate (1) by the following desired frequency response:

$$D(\omega)=M(\omega)e^{jP(\omega)}\tag{2}$$

My problem with this specifications :

Frequency domain specification is not symmetrical (linear phase filter with not symmetric impulse response),with order of filter and constant group delay, constant weighting function .

1-Before to start the design filter, must be know the problem is linear or no,does this have relation by 'h'?

In the case of FIR filters, we formulate the design problem using the complex least squares .The passband error function is

$$E(\mathbf{h})=\int_{\omega_1}^{\omega_2}| H(e^{j\omega})-D(e^{j\omega})|^2d\omega \tag{3}$$

How can i solve the integral in this case?or what is the steps which allow me to formulate an equation by least squares?

In complex leastsquares there is continuous and discrete approximation .However, often these integrals cannot be solved analytically.In
this case one either has to resort to numerical integration or formulate the problem a priori as a discrete approximation problem. What is the better for (3)?use the continuous or discrete approximation?


texts: How do I measure the amount of information within an image?

texts:
I'm trying to find some information threshold that is required for performing detection of objects in images. However, I'm not sure how exactly to quantify the amount of information contained within an image.

Thoughts:

  I imagine that looking at the gradients/edges of the image would be a
  good idea, but simply counting the number of edge pixels doesn't seem
  enough. Maybe looking for patterns within the edge image?

  Perhaps I should look at the image in the frequency domain?

  I don't think I can just use Shannon's entropy because it doesn't
  really "look" at the big picture.

Any help/guidance would be appreciated.

My problem with Shannon's entropy is that it is calculated without considering
spatial structures. For example, the following two image have the same entropy score:


texts:
I am sending 6.6Vpp square wave across a narrow-band, 40 kHz Transmitter to a narrow-band, 40 kHz Receiver. I want to find a very accurate distance between the two (sub millimeter).

My assumption so far is that if I can get very consistent results at a fixed distance, that I can calibrate the speed of sound and an offset error time to get consistent results (and absolute, not just relative) at a bunch of different results.

Unfortunately, I've tried 3 different signal processing methods and none of them are yielding the perfect results I'm looking for. I'm sampling at 500 kHz.

Threshold method: I transmit 10-20 periods, and then look for the received waveform to pass a given threshold, then I take this sample to be the TOF. Obviously if there is noise, there is going to be some error, so its understandable why this doesn't work.
BFSK method: I transmit 50 periods at 41 kHZ, 20 periods to linearly transition to 39 kHz, and then 50 periods at 39 kHz. I receive the waveform, and use a zero detection algorithm, then detect instantaneous frequency. When I detect the frequency crossing at 40 kHz, I use this to determine TOF. This is my most accurate method. But I come across a strange error: sometimes I get all of my results with precision all within 0.5mm (500 trials), but othertimes I run this code, I get a BUNCH of errors, like 50% of the errors are greater than 5 mm.
Cross correlation method: I store a previous received signal that was taken at a known distance in memory, then I correlate my received signal to this result. My correlation only uses 4-5 periods on each side of the peak of the trial signal to reduce the computation time of the correlation.

Any recommendations on real-time, robust, sub-mm signal processing methods for ultrasound rangefinding?


texts: How to manipulate output of Matlab's 'spectrogram' function for additional spectral analyses

texts:
all,
I have an audio recording that contains several frequency-modulated elements (think animal calls like birds/bats). I have read this file into Matlab using 'audioread' and plotted the oscillogram from which I took timing information (duration, interval of calls, etc...). I then used the 'spectrogram' function to plot the frequencies. I don't fully understand the output of this function [s,f,t] = spectrogram(signal,window,overlap,fft,Fs). I know that 's' should yield my frequencies but this is a matrix of complex numbers and I'm not sure what to do with it. There is a ton of information on generating these values but I can't seem to find anything about what to do after. My ultimate goal is to isolate each element of the audio file (i.e. each chirp/call) and determine the highest, lowest, and peak frequencies as well as overall bandwidth. The method I used to isolate each call is to use the on- and offset of each element to determine a slice and then perform a separate FFT (using spectrogram function) for each slice. This gives me 's','f', and 't' for each element but I'm still not sure how to manipulate this output to get the desired metrics. If anyone has a solution for all or part of my issue, or can perhaps just explain the concepts I am missing, I would be very appreciative.

This is an example of the type of audio files I have. This was generated using an FFT size 512.

When I attempt to isolate the first element in the above spectrogram, I take a time slice and generate another spectrogram (also FFT = 512) and get this. This is not actually what I want to generate.

I would like to see something like this (a zoomed in version of the first plot).

So that I can measure these parameters, preferably not by hand as there are hundreds of thousands of them.


texts: Is there an intensity estimation algorithm working solely in time domain

texts:
Given a second of sampled sound pressure signal, speed of sound and medium density, can the average sound intensity be estimated without performing DFT, that is in linear time by simply traversing all samples?

Could you provide\link a proof that it is correctly evaluating\approximating this definition from wikipedia:

A lot of examples deal with pure tonal sine waves, where particle velocity member can be transformed to pressure, and amplitude is clearly defined, but I'm struggling to find an example for random signal.


texts: Discrete Fourier Transform in Signal Processing - Interpreting graphs of transformed signals

texts:
Given above are the real parts of the signals I to IV. Which of the following statements are correct?

(i): Signal III is the result of the discrete Fourier transform of signal I. The associated imaginary part is 0.

(ii): Signal III is the frequency spectrum of an oscillation with a frequency.

(iii): Signal IV is the frequency spectrum of an oscillation with 2 different frequencies.

(iv): Signal IV is the result of the discrete Fourier transform of Signal III. The associated imaginary part is 0.


texts: Is $O (N \log N)$ FFT speed the fastest we can ever attain?

texts:
I am wondering about whether or not there is a theoretical limit as to the speed at which we can compute a DFT. We all know that the FFT executes in $O (N \log N)$ time. However, is this a lower bound of some sort?

Might there be yet faster algorithms that have yet to be discovered which we do not currently know about that are faster, or is this a holy boundary that cannot be crossed?

Edit: Apparently this is a known unsolved problem in CS, (thanks to @John).

So, what are the details of the problem? Where would one start to try to make improvements?


texts:
How do I apply a bandpass filter on an audio file which is in wav format?
And write back the filtered data in a new wav file for further analysis.


texts: How to convert my transfer function to the frequency domain

texts:
I have the following transfer function in the time domain:

$h\left(t\right) = B x\left(t\right) + a x^2\left(t\right) + b x^3\left(t\right)$.

My simulation is in the frequency domain, so I would like to have a transfer function of the form $H\left(\omega\right)$.

I didn't find any suitable Fourier/Laplace identities so I tried substituting as follows $\theta_1\left(t\right) = x\left(t\right)$, $\theta_2\left(t\right) = x^2\left(t\right)$ and $\theta_3\left(t\right) = x^3\left(t\right)$. The resultant frequency domain function

$H\left(\omega\right) = B \Theta_1 \left(\omega\right) + a  \Theta_2 \left(\omega\right) + b  \Theta_3 \left(\omega\right)$,

wasn't of much use to me because I only have $\Theta_1\left(\omega\right)$ and I don't know how  $\Theta_2$ and $\Theta_3$ are related to $\Theta_1$.

I would like my transfer function to depend only on $\Theta_1$, which is the variable that I know.

How can I go about solving this problem?


texts:
A quick question, is there any way to do channel estimation on a (G)FSK receiver. I'm trying to build a DASH7 receiver.

I found that there is a block for a OFDM channel estimator, but i can't find it for FSK.


texts: Introduction to Statistical Signal Processing

texts:
There is a postdoc in my lab whose specialty is "statistical signal processing". He has a PhD in Electrical Engineering and he analyzes the neural data collected.

I am wondering what courses/topics I should start studying to follow in his footsteps. I'm not exactly looking for things like statistics and signal processing, I've had basic classes in both but still find it hard to understand his work.


texts: feature detectors and descriptors comparison

texts:
There are several kinds of detectors and descriptors, like SIFT, SURF, FAST.
I wonder are they all eligible for real-time applications? Which is the best or better?

And furthermore, is Harris-Laplacian dectector still useful when we already have the above three? Is it better than them?


texts: Discrete approximation to Gaussian filter

texts:
One method of producing a discrete approximation kernel to a Gaussian filter of variance $\sigma^2$ is to assume a cutoff of $5\sigma$. This seems to suggest the following procedure:

Create a uniform grid $\mathbb{x}$ of size $11(=2*5+1)$ between $[-5\sigma,5\sigma]$
Evaluate $\mathcal{N}(\mathbb{x};0,\sigma)$ and obtain the discrete approximation.

The blue lines in the second plot below depict the discretized values(for $\sigma=1.5$).
In this case, the result is not a proper filter kernel since the sum of values is not $1$.

But MATLAB's fspecial does things a bit differently. For the call fspecial('gaussian',[1 11],sigma)

Create a uniform grid $\mathbb{x}$ of size $11(=2*5+1)$ between $[-5,5]$
Compute $\mathbb{x}'= e^{\frac{-\mathbb{x}^2}{2\sigma^2}}$
Normalize $\mathbb{x}'$ so that it sums to $1$

The green lines in the first plot below the values as computed by MATLAB's fspecial(for $\sigma=1.5$).

What is the difference between both methods ?


texts: I watermarked a picture in sound .WAV file, when today i find this sound file after 3 years  try to extract picture embed in sound but i understand format of this chang to .mp3 and thus I can't extract completely picture of watermarked .My question about , find a watermarking algorithm that is resistant to any kind of compression?


texts:
For a given input signal, for each discretized sample, $dt=1$:
$$ x(t) \sim N(0,1)$$

and a given LTI low order filter with transfer function:
$$ H_{fil}(f)$$

which would be is the a priori distribution of the filtered signal?
$$ x_{fil}(t) \sim ? $$

this is, not the conditional distribution of the 1 step predictor:
$$ x_{fil}(t)|x(t-1) \sim ? $$

but the distribution of the $n=t/dt$ steps simulation:
$$ x_{fil}(t)|x(0) \sim ? $$

For example, the special case of the integration:
$$ H_{int}(f)=\frac{1}{2\pi f}$$

has a distribution of the sum of gaussian distribution:
$$ x_{int}(t) \sim N(0,\sqrt{\frac{t}{dt}}) $$

this is a normal distribution, with a variance which increases linearly with the number of samples.


texts: Analytically designing a notch-filter for specified frequency 50 Hz

texts:
I tried to analytically construct a causal notch filter that stops frequencies at 50Hz and I thought if zeros are more than poles it will be non-causal so I chose equal amount of poles and zeros resulting in

$$\dfrac{\left(z-e^{100\pi i} \right)\left(z-e^{-100\pi i} \right)}{z^2} $$

Is this correctly designed and causal?


texts: Understanding 2D alignment using least squares

texts:
In Computer Vision Algorithms and Applications book by Richard Szeliski, the author explains 2D alignment using least squares as follows:

  Given a set of matched feature points ${(x_i, x_i')}$ and a planar parametric transformation of the form
  $$x' = f(x;p),$$
  how can we produce the best estimate of the motion parameters $p$? The usual way to do this
  is to use least squares, i.e., to minimize the sum of squared residuals
  $$E_{LS} = \sum{\lVert{r_i}\rVert^2} = \sum{\lVert{f(x_i,p)-x'}\rVert^2},$$
  where $r_i$ is the residual between the measured location $x_i'$ and its corresponding current predicted location $f(x_i; p)$.

  Many of the motion models presented in Section 2.1.2 and Table 2.1, i.e., translation,
  similarity, and affine, have a linear relationship between the amount of motion $\Delta{x} = x'-x$ and the unknown parameters $p$,
  $$\Delta{x}=x'-x=J(x)p$$
  where $J=\partial{f}/\partial{p}$ is the Jacobian of the transformation $f$ with respect to the motion parameters $p$ (see Table 6.1). In this case, a simple linear regression (linear least squares problem)
  can be formulated as
  $$E_{LSS} = \sum{\lVert{J(x_i)p - \Delta{x_i}}\rVert^2}$$

Question:
In the last equation, what is the point of trying to minimize the difference between $J(x_i)p$ and $\Delta{x_i}$? What is a higher-level interpretation?


texts: What filter should I pass to these signals to make them constant on every piece

texts:
I'm analysing the frequencies of something I'm recording (whistling), which is resulting like this (yes, it's super mario bros' beginning song:

I'd like to filter it to make it remain like:

in order to convert them as MIDI notes after the processing.

How could I do it ?

I've tried with a simple low-pass filter but it doesn't work very well.

Thanks.

EDIT:

I'm already rounding it when passing to MIDI:

and sometimes it goes on + - 1 note.


texts:
What papers/articles/books are considered good for getting started with wavelets' application to cryptography? I'm primarily interested in irregular grid wavelets, but regular grid will do for starters. What I'm definitely not interested at is steganography.

I'm posting this question here instead of Computer Science or Cryptography because them people don't really talk about wavelets.

A (not nearly full) list of things I've taken a look at or stumbled upon:

Fekri, Delgosha "Finite-field Wavelets with Applications in Cryptography and Coding" - don't have the actual book. Should I obtain it or just google its table of contents apart?
Luo, "A novel symmetric cryptography based on the hybrid Haar wavelets encoder and chaotic masking scheme"
Chan, "A block cipher cryptosystem usig wavelet transforms over finite fields"
Kumar, Chokhandre, Mishra "Discrete wavelet transform based signal stegnography & encryption"
Manikandan, Kamarasan, Sairam, "A New Approach for Secure Data Transfer based on Wavelet Transform"

(Basically I was searching on google and google scholar for various combinations of "cryptography", "wavelets", "DWT", etc)


texts: I've a fundamental problem with understanding terminology used in DSP. What does it mean to tune a radio (for example, a software defined radio) to a certain carrier frequency $f$? The received signal is an arbitrary waveform and not a sine wave of frequency $f$. I understand AM modulation: you take a sine and manipulate its amplitude. The FM modulation I don't get: the modulated signal is not a sine, so why do we say that we tune a radio to a certain frequency in that case?


texts: How can I use Viterbi algorithm for a real time scenario where I cannot afford to have delay in the tracing back the best path to the initial state?


texts: What I don't understand is what exp(.) and ln(.) mean. For example y(t) and x(t) have exp(.) between them. What exactly does that mean? y(t)=?


texts: Can I create a transformation matrix from rotation/translation vectors?

texts:
I'm trying to deskew an image that contains an element of known size. Here's a test image:

I can use aruco::estimatePoseBoard which returns rotation and translation vectors. Is there a way to use that information to deskew everything that's in the same plane as the marker board? (Presumably by using the rotation and translation vectors to create a transformation matrix to pass to warpPerspective.)

I know how to deskew the marker board itself. What I want to be able to do is deskew the other things (in this case, the cloud-shaped object) that are in the same plane as the marker board. I'm trying to determine whether or not that's possible and, if so, how to do it.

I can already put four individual markers around the object I want to deskew and use the detected corners along with the known distance between them as input to getPerspectiveTransform. That works very well. But for our real-world application it may be difficult for the user to place markers exactly. It would be much easier if they could place a single marker board in the frame and have the software deskew the other objects.


texts:
I have a progam in matlab that generates a linear and quadratic chirp, and now I want to study the frequency components in wvtool. However, I am not able to decode the frquency domain scale "the normalized frequency". The usual process of deviding the normalized frequency with the sampling frequency doesnot provide the desired value. Please refer to the program and image for details.

Fs = 500;
tf = 1;
t = 0:1/Fs:1;
f1 = 10;
f2 = 90;
slope = (f2-f1)./t(end);

F = f1 + slope* t;
F1 = f1 + slope* t.* t;
% quadratic chirp
y = 1.33*cos(2*pi*F1.*t);
% linear chirp
y1 = 1.33*cos(2*pi*F.*t);


texts: DC to phase relationship with Low pass filtered sine and square wave multiplication and it's pitfalls. IQ Demodulation

texts:
From what I have read about signal (de)modulation I understand that multiplying two sine waves, both with the same frequency, gives a two frequency component sine wave. One at DC and one at $2\omega$. Using a low pass filter will let us remove the $2\omega$ component. Now DC amplitude is proportional to the phase difference between the two sine waves.

So:
$$
A \sin(\omega t) \sin(\omega t + \theta) = \frac{A}{2}\cos(\theta) + \frac{A}{2}\cos(2\omega t + \theta) \rightarrow {\rm LPF} \rightarrow \frac{A}{2}\cos(\theta)
$$
where $\omega$ is the frequency, LPF is Low Pass Filter, $A$ is the amplitude and $\theta$ is the phase difference between the sine waves.

I made a Matlab program to plot this, then I tried with a square wave multiplied with a sine wave. I can see that there is still a connection between DC and phase by doing a FFT as well as in the time domain. I would like to see the math for the relationship between DC and phase.

For sine $\times$ sine, I have read that sampling with a frequency four times the modulated signal frequency will make it possible to get the I and Q values by subtracting samples in the following order:

$$
I(t) = s(t) - s(t-2)
$$
$$
Q(t) = s(t-3) - s(t-1)
$$
where
$$
s(t) = A\sin(\omega t + \theta)
$$

This I do not quite understand yet and therefore leads me to be unable to determine if this also is valid for a square $\times$ sine. Can anyone try to explain this to me?

I will appreciate any feedback on how to effectively do IQ demodulation on a micro-controller using a square reference waveform.

Additional information:

I wish to use a micro-controller to sample the analog sine and square (reference) signal and do IQ demodulation. I almost only find information about sine $\times$ sine and therefore want to know if there are any pitfalls using a reference square wave that I am not seeing yet.


texts: piecewise-quadratic vs piecewise-cubic vs higher order polynomial interpolation?

texts:
There is a question available on DSP SE that mentions types of interpolation used for signal reconstruction but there isn't any mention about the difference between piecewise-quadratic,piecewise-cubic and higher order polynomial interpolation
So how we can differentiate between them ?
Link of question is given below:
Types of interpolation used for reconstruction in DSP?


texts: How to create 3D signed distance function?

texts:
I am trying to segment a 3D shape using levelset. I want to track shape movement in consecutive frames.

Now I want to create a signed distance function matrix for initialization of levelset algorithm using previous frame surface calculated as 3D points.

First, I have to create a logical 3D matrix in which all points inside previous frame surface points are '1' and '0' otherwise. Then I have to calculate 3D signed distance function matrix from it.

How can I do that?

Thank you for your help.


texts: Do I need equally paced values to do a Fourier Cosine Transform?

texts:
I am gathering data from a sensor, but the data gathering depends on a code running, so the timing is not precise to make it equally paced.

What I mean is this, the time it takes to do measurement #1 and #2 is not exactly the same between measurement #2 and #3 and so one.

I may have data like this:

value = 20 taken at t=0s
value = 21 taken at t=0.2s
value = 44 taken at t=0.44s
value = 22 taken at t=0.67s
value = 33 taken at t=0.9s
value = 32 taken at t=1.3s

As you can see the time between measurements is not exactly the same and can vary slightly.

The idea is to perform a Fourier Cosine Transform on the discreet values.

First question is:

will this not equally time between the measurements affect the DCT?
what can be done to "normalize" the data to have constant times?


texts: Purpose of using polyphase filter bank (PFB)

texts:
What is the advantage of using a polyphase filter bank (PFB) for spectral analysis over just using the FFT? In the standard "critically sampled" uniform DFT filterbank, the polyphase decimation/filtering is followed by an $M$-point DFT block, which implements the last step of the PFB in a computationally efficient manner using the FFT.

If you have to do an FFT anyways, why bother with the PFB? Is the reason that I can choose a custom prototype low-pass filter on the front-end? Are there some computational savings I'm missing out on?

EDIT: If comparing this to a bank of quadrature downconverters, what is the point of using a PFB if the FFT is the same mathematically? It can't be the delay of $N$ samples requried to fill up an FFT block because the decimated branches have $1/N$ the rate, which means you will be waiting the same amount of time on average with either approach. What am I missing?


texts:
I am working with HRIR filters, in particular I am trying to interpolate them.
One commod method in the literature to perform interpolation of HRIR is to use the minimum-phase decomposition and interpolate separately the minimum-phase part of the filter and then the all pass part.
You can find more here: https://www.researchgate.net/publication/277879431_On_the_Minimum-Phase_Nature_of_Head-Related_Transfer_Functions
What I am trying to do is to convert my arbitrary HRIR FIR into a minimum phase one. In particular, I am working in Python and I have been using this function.
However while performing the conversion from the original FIR into the minimum-phase one I get the following error:

RuntimeWarning: h does not appear to by symmetric, conversion may fail

With the following code:
min_phase_HRIR_0 = minimum_phase(hrtf[0], 'hilbert')

Where hrtf[0] is a 256 long FIR extracted from a HRIR database (in particular the HUTUBS database).
If I plot the magnitude  of my original FIR and the minimum-phase one I get the following plot:

Which is obviously wrong since I am expecting the min phase and the original FIR to have the same magnitude spectrum.
I guess there is something wrong with the Scipy function. Is there anything for Python that converts a FIR into a minimum-phase version?


texts: Can I use frequency hopping spread spectrum technique for audio steganography?

texts: I have been trying to use spread spectrum technique for audio steganography. I read a lot about it.But i didn't find any information about the steganography scheme using FHSS(frequency hopping spread spectrum). Isn't it possible to do steganography in .wav files using FHSS?


texts: How do I calculate correlated color temperature correctly?

texts:
How can I calculate the color temperature(CCT) of the light source illuminating a given raw image correctly?

The method I used is proposed by McCamy, and the algorithm was also described in the Wikipedia. The problem is that I don't know whether should I apply white balance process before calculating CCT.

If it should not, how do I get the conversion matrix that convert the current device-dependent RGB color space to CIE XYZ to calculate the algorithm correctly?


texts: Resample audio signal with a low factors

texts: Currently, we need to handle a piece of an audio signal. We want to resample it with different factor rate (p/q) starting with 1.0002 to 0.9998 with a decrement of 0.000005. But Matlab function cannot handle this because of the Integer Limit. Are there any ways to solve it?


texts:
I Would like an explanation of the parameters for opencv's HoughCircles function.

I'm new to image processing in general and I have recently started using opencv. I'm struggling to find circles. I obtained the image below by converting a source image to greyscale then performing a binary threshold.

To my eye, the leftmost images are almost perfect circles. I have seen demonstrations where, what I assume are very noisy and distorted circles have been identified by opencv's hough transform.

Assuming the image displayed above is saved as "binaryresult.png". If I run the following code I get circles that are poorly placed. I'd like to understand the HoughCircles function's parameters so that I can better detect circles.

import cv2
import numpy as np

image = cv2.imread("binaryresult.png")
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(image, cv2.cv.CV_HOUGH_GRADIENT,  2, 32, param1=200, param2=100)

# ensure at least some circles were found
if circles is not None:
    # convert the (x, y) coordinates and radius of the circles to integers
    circles = np.round(circles[0, :]).astype("int")

    # loop over the (x, y) coordinates and radius of the circles
    for (x, y, r) in circles:
        # draw the circle in the output image, then draw a rectangle
        # corresponding to the centre of the circle
        cv2.circle(output, (x, y), r, (0, 255, 0), 4)
        cv2.rectangle(output, (x - 5, y - 5), (x + 5, y + 5), (0, 128, 255), -1)

    # show the output image
    cv2.imshow("output", np.hstack([image]))
cv2.waitKey(0)


texts: DFT exercise in the book Understanding digital signal processing 3 Ed

texts:
I am trying to solve exercises from the book Understanding digital signal processing 3 Ed - Richard Lyons.
I will repeat the question as it is in the book:

3.3 We want to calculate an N-point DFT from a one-second compact disc (CD) audio signal of duration $x(n)$, whose sample rate is $f_s = 44.1 \text{kHz}$, with a sample spacing of $1 \text{Hz}$.
(a) What is the number of time samples $x(n)$ required, N?
(b) How long is the sequence time $x(n)$ measured in seconds? Tip: This part (b) of the problem is more complicated than it looks at first. Think carefully.

My answer to question (a) is $N = 44100$, since the DFT frequency resolution is $\frac{f_s}{N}$. So, for $1 \text{Hz}$ resolution, I think it's quite obvious.
But, in question (b), I'm little insecure. As the hint suggests, looks like a trickier question, but I don't know exactly why.
My first guess is that the duration of the sequence is 1 second.
Would anyone know why it wouldn't be?
Thanks!


texts: Differences observed on the complex wavelet transform applied on the same signal

texts:
I have applied a complex wavelet transform on two signals :

a first one
a second one that is a concatenation of the first signal and another one

For the 4th coefficient (as an example, i've got the same problem for all of them), i get the following graph for its module (1- is blue, 2- is green) :

What could explain the differences observed between the two signals ? Seems like the coefficients don't have the same spectral width ?

Thank you !

@Jazzmaniac

The two graphs are (almost) generated as follow in python (i've generalized to sinus signals, and plotted every coefficients).
In reality, not all the coefficients are different : only those in relation with signal frequencies.

import numpy
import pylab
import dtcwt

f1 = 10.
f2 = 15
w1 = numpy.pi * f1
w2 = numpy.pi * f2

time_interval = 100
samples = 50000
t = numpy.linspace(0, time_interval, samples)

x1 = numpy.sin(w1 * t)
x2 = numpy.sin(w2 * t)*1.5

x12 = numpy.array(list(x1)+list(x2))

y1 = numpy.abs(dtcwt.dtwavexfm(x1,8)[1])
y2 = numpy.abs(dtcwt.dtwavexfm(x12,8)[1])

for i in range(8):
    pylab.figure()
    pylab.plot(y1[i][50:150], '-x')
    pylab.plot(y2[i][50:150], '-x')
    pylab.grid()
    pylab.title('yh'+str(i))
    pylab.legend(('Coil alone','2 coils'))
pylab.show()

When i change x1 in :

x1 = numpy.array(list(x1)+list(x1))

I get exactly the same coefficients (ie. when x1 and x2 have the same length and x1 is "substantial" : filling the difference with zeros doesn't work).


texts: Upsample data using FFTs. How is this exactly done?

texts:
I am basing my question on this post here, because I would like additional details on it, as I have not had any success in re-creating it.

I would like to simply learn, in no uncertain terms, how to do upsampling via the FFT. There seem to be a lot of details regarding if the signal is even or odd, where exactly to zero-pad, how much exactly, etc, and I am not getting those correct numbers for some reason.

Question: So let us say I have an even or odd length signal, of length $N$. I would like to upsample it to, say, $2N$, using FFTs.

How is this done exactly?

What I tried:

I tried following the post and others on the web but there seems to be very little consistency. It basically amounts to "zero-padding the frequency domain and then IFFTing" but I do not get proper results. In my case, I have a signal of length $100$, and I would like to upsample it to length $200$. So I do the following command:

ifft(fftshift([zeros(1,50) fftshift(fft(signal, 100)) zeros(1,50)]));

This however gives me complex data back, and not a signal that is simply upsampled by a factor of $2$. I am not sure where the problem is.

Thank you.


texts: Can I use IIR or FIR to get a sliding mean?

texts:
My output signal shall be computed by (meta code):

o = 0  # or some arbitrary initial value
for i in input:
    o = (o * 99 + i) / 100
    print o

I call this a "sliding mean", but maybe another term is established for this.  (If so, mentioning this could help me researching this better ;-)

Is there a way to achieve this using the a / b coefficient arrays of IIRs or FIRs?  What would they look like?

I'm aiming at a solution in Python / scipy.signal.

Or is there another established way to achieve this which I can find in such libraries like numpy, scipy, pandas, etc.?


texts: Structuring Kalman filter for tracking problem where only position is known

texts:
I'm new to Kalman filters and my extensive web search about them has helped me understand the majority of it (or so I think). However I still need some light shed on my problem formulation.

I have a set of points $(x,y)$ provided by some other part of my program that correspond to the coordinates of a target whose position is being estimated. Let's assume the coordinates have have error with known variances $\sigma_x$ and $\sigma_y$, zero mean and are normally distributed. I have no other information (for example, regarding velocity or acceleration). The path of the target is completely random as it modeled by a walking person and it can remain long periods of time just standing still. The samples $(x,y)$ are obtained with a well defined and constant time interval $\Delta t$.

Is a Kalman filter the best approach to smooth the path in my case? It seems to me that, although the person can walk freely and apparently randomly, their movements still have a high correlation in a small scale, so a Kalman filter could be a choice.
There is an example in Wikipedia on Kalman filtering with a truck whose velocity is not known and where its unknown acceleration is modeled by the noise vector $\boldsymbol{w_k}$. Is this the best approach to solve my problem?
Also, how would the system be formulated in the case of two dimensions $(x,y)$?
Is there any harm in feeding the same coordinates $(x,y)$ to the filter for long periods of time? (Meaning the person is standing still)
How does the Kalman filter differ from, for example, the Savitzy-Golay approach to data smoothing?

Thank you in advance!


texts: Remove spurious peaks of Hilbert transform

texts:
I want to eliminate spurious peaks of Hilbert transform for finding glottal closure in the linear prediction (LP) residual. I have the following 4 steps:

Down-sample.
Hilbert Transform.
Identify Peaks in Hilbert Transform.
Consider this hypothesis that time gap between two successive glottal closure instance is not likely to vary in the adjacent pitch period.

Case 3 would help to find peaks such as candidate and spurious peaks. However case 4 improve our results for best peaks candidate for glottal closure.

I have written the following MATLAB code:

e_downsample = downsample(e,2);
DFT=fft(e);
hilbert_e=ifft(complex(imag(DFT(1:(length(DFT)/2))),real(DFT(1:(length(DFT)/2)))));
h_e=sqrt(e_downsample(:).^2-hilbert_e(:).^2);
[pks,locs] = findpeaks(abs(h_e));
figure,
plot(abs(h_e));

I will really appreciate, if anyone help me in cases 3 and 4.


texts: I am trying to calculate the mfcc of an audio sample of 5sec duration. How can I frame this audio sample. Is there any criterion for selecting the frame size and number of frames? What all change will be there if the audio file is 30sec long?


texts: Small Scale Fading time varying or position varying

texts:
I would like to ask how small scale fading can affect a transmission with time.
The particular system is an antenna transmitting an ASK modulated signal at 915MHz and with bandwidth between 200KHz to 500KHz.

The receiver is static (does not move) and is placed at a distance not greater than 12 meters.

The question is, if the communication consists of slots of time of milliseconds, does the fading change for each time-slot or only will change when the receiver moves?

Thank you for the help

Regards


texts: Soft question: seeking online course reference for CS

texts: Is there a good online course (with video) for Image/Signal Processing or Matrix Computations that includes a section on the principles of Compressed Sensing?


texts: 2-PAM or 4-PAM if I want to send data as fast as possible?

texts: I would like to ask if I should use 2-PAM modulation or 4-PAM modulationif I want to send data as fast as possible given that in each case I have the same frequency spectrum available.


texts:
Could someone explain to me why the computation speed for the fast Fourier transform increases by padding the series with zeros to the point that its length is close to a power of 2? This is common in the matlab environment, for example:

http://www.mathworks.co.uk/help/matlab/ref/fft.html


texts: Extracing IQ samples from a composite signal?

texts:
I'm writing a modulator in matlab to simulate IQ data that I would get from my radio to test my demodulator.

I've read that $I = x(t) cos(\omega t)$ and $Q = x(t)  sin(\omega t)$.  What is the $\omega$ term?  If it is $2 \pi f$ then what is the frequency value?

I have a modulated composite signal that I need to split into I and Q parts for my demodulator.  What should be the frequency value in the above equations?


texts: The effect of time increment $\Delta t$, frequency resolution $\Delta f$ and Gibbs phenomenon on the amplitude of the signal in the frequency domain?

texts:
Experiment: Vibration analysis (i.e.: major concern is on transfer function or frequency response).
The input is an impulse (imagine as a knocking effect or knocking force), defined as a half sine curve. The output is the vibration speed of the specimen (measured by laser vibrometer). The vibration is naturally damped, so within $0.6\ \rm s$, the vibration speed has greatly decreased - but it is most certainly removed after $1.2~1.3\ \rm $s. The results are then computed with FFT to convert into frequency domain (automatic process done by the computer) and then the transfer function would be investigated.
My questions are as followed:

Would having long measurement period (i.e.: one sample period) have any effect on the frequency spectrum? This is assuming the number of sampling points (in time domain) or the number of spectral/FFT lines is kept the same. The measurement time can be changed via the selected bandwidth (and thus, the sampling frequency)
Is there any proven work or mathematic, saying that for the same bandwidth and same sampling frequency, increasing the frequency resolution (i.e.: make the spectrum coarser) would decrease the height of the peak?
Would changing the time increment (time between 2 consecutive sampling points in time domain) change the frequency spectrum?

Though I think that these 3 questions are somewhat the same as each other, it is worth writing all of them down.
Reference graph: different bandwidths (and thus, different frequency resolutions, different measurement time, and different time increment) lead to different frequency response (or transfer function). The most "problematic" are the 2 peaks at 300 and 330 Hz. Normally, by increasing the frequency resolution, the common belief is that the amplitude would be lower.

And then, question 4:

Would the Gibbs phenomenon have any (visible) effect on the frequency spectrum?

Thanks for your help.


texts: What is the state-of-the-art method for dealing with illumination issues in background subtraction?

texts:
I have been struggling to find a well-cited approach to this.  Essentially, I am experimenting with different background subtraction algorithms, but none seem to perform well when there are significant lighting changes (say, from a window in the scene getting significant glare at specific times).

The question is simple (relatively): what are the state-of-the-art methods for background subtraction with sudden illumination changes?  My scenario is surveillance cameras.


texts: What does "two signals aliasing to each other" mean?

texts:
So I just read something that two signals are aliasing to each other. I know what a single signal is being aliased - that is when sampling rate is not higher than or equal to the Nyquist rate. But I am just confused of what two signals aliasing to each other mean.

Let's say that each signal only carries single frequency. Let $f_s$ be sampling frequency and $f_1$ be the first signal and $f_2$. $f_s$ is assumed to be lower than Nyquist rate for both signals. In such case, in what condition of $f_1$ and $f_2$ would aliasing occur, given $f_s$?


texts:
I have FFT data of x, y, z - axis, Now I'm trying to find the position through FFT data.

Step 1 :
For that, applied corresponds to an ordinary frequency i.e rad·s−1,

ν = 1/(2*π*f[i])

f shows real frequency by index upto N/2

Step 2 : Applied power factor 2 over ordinary frequency

p = (v*v) i.e v2

Step 3 : Multiplying p with fx & fy  resp.

But unable to get the position to draw Lissajous Figure Or complex harmonic motion.

Thanks in advance! I appreciate If someone pointing out my mistake or any provide me some idea.


texts: List of possible image features for content based image retrieval

texts: I am trying to find a list of possible image features like color, oriented edges and so on for measuring their usability in case of finding same/similar objects in images. Does anyone know such a list or at least some features?


texts:
I have been studying Proakis, and stumbled upon minimum/maximum/mixed phase concept.

He said that all zeros inside unit circle in Z-plane contributes zero phase change, and all zeros outside unit circle contribute $\pi$ phase change. That is if $\Omega(\omega)$ is phase of the Z-transform, then, $\Omega(\pi) - \Omega(0)=\pi$.

Geometrically this does not make sense to me. Take the following example (The circle in both the pictures is an unit circle). This example is based upon the following transform :

$$H(z) = z^{-1}(z+ 1/2)$$

In the above picture, it is a single Zero system. The Zero is denoted by $Z(=-1/2)$ above. Here the $\Omega$ is the phase angle of the transform. Now say we rotate by more than $\pi/2$. And we get to the following picture,

Here $L_2$ is at say $\omega=3\pi/2$ angle. Then the new phase angle as $\omega $ approaches $\pi$ is going to be $\pi$. So from first picture at $\omega=0, \Omega=0$, and $\omega=\pi, \Omega=\pi$. So how come the phase difference $\Omega(\pi)-\Omega(0) = 0$ as claimed by the book for this transform. It also said that all zeros inside the unit circle would lead to zero phase change. But as described above, it does not make sense to me geometrically.

Can someone please guide me on where I am going wrong!


texts: Why ignores constant when applying integral into differential-equation.?

texts:
I studied how to draw 'Direct-form I' and 'Direct-form II' from differential equation.

The book taught me like this:

$$\mbox{Give equation: }{a_0}{y(t)}+{a_1}{y'(t)}+{a_2}{y''(t)} = {b_0}{x(t)}+{b_1}{x'(t)}+{b_2}{x''(t)}$$

step 1. change from differentiator into integrator, because integrator is cheaper than differentiator.

\begin{array}{}
{a_0}{y^{(2)}(t)}+{a_1}{y^{(1)}(t)}+{a_2}{y(t)} = {b_0}{x^{(2)}(t)}+{b_1}{x^{(1)}(t)}+{b_2}{x(t)} &
\begin{cases}
x^{(i)} \mbox{ is i-times integral of x}\\
y^{(i)} \mbox{ is i-times integral of y}
\end{cases}
\end{array}

step 2. change form like this: $y(t)=...$

\begin{array}{}
\displaystyle y(t)=\frac{1}{a_2}\left( {b_0}{x^{(2)}(t)}+{b_1}{x^{(1)}(t)}+{b_2}{x(t)}-{a_0}{y^{(2)}(t)}-{a_1}{y^{(1)}(t)}\right)
\end{array}

step 3. draw

My question is why doesn't consider constant value in step 1?


texts:
I am given a channel impulse response:

$$h(t) = 0.8 \times \delta(t) + 0.6 \times \delta(t - T)$$

where $\delta(t)$ is the dirac function.

For signal equalization a MMSE equalizer with 5 coefficients and SNR = 12 dB will be used.

Well for this case, I am trying to set up the autocorrelation matrix. The impulse response consists of two diracs.

I have troubles computing the autocorrelation. When I remember correctly, to do that, I can simply shift the diracs to the right and then let them move to the left to the original diracs and then calculate the overlap. That would give me, again, two diracs at $t=0$ and $t=T$, but scaled: $(0.8 \times 0.8 + 0.6 \times 0.86) \times \delta(t) + (0.8 \times 0.6  + 0.6 \times 0.6 ) \times \delta(t-T)$

Am I correct?


texts:
I'm looking to implement the designing of a Butterworth filter based on the implementation in MATLAB/Scipy into C# but I've ran out of knowledge and can't quite seem how to compute the coefficients b and a  based on the order and the normalised cutoff frequency.

I think that I am calculating z, p and k correctly using:

var z = new double[0];
var m = new List<double>();

var start = -order + 1;
var step = 2;
while (start <= order)
{
    m.Add(start);
    start += step;
}

var complexP = new List<Complex>();

for (var i = 0; i < m.Count; i++)
{
    complexP.Add(-Complex.Exp(Math.PI*m[i]/(2*order)));
}

var k = 1;

I believe that to calculate b and a using z, p and k I have to find the coefficients of a polynomial based on the root provided by p. But I'm struggling to understand how you calculate a coefficient of a polynomial based on a root value.

I understand the result of this should always return 1 as the first value of the a vector but I can't find anything that describes how to calculate the coefficient, perhaps I've found the answer but I've brushed past it.

For the b value I believe that this is k * polynomialCoefficients(z).

Also to note is that I haven't taken into consideration the cutoff values in to how they relate to z, p and k but this doesn't look too difficult and I don't think it will affect the question.

I'm not looking for this is how you do it in C#, but a general run down of how to calculate the coefficient would help.


texts: Does the Shannon theorem not apply when the amplitude of a wave is changed faster than half the time period of the wave?

texts:
Shannon's version of the sampling theorem states that if a function contains frequencies all strictly less than $B$ hertz, then it is completely determined by giving its ordinates at a series of points spaced $\frac{1}{2B}$ seconds apart.
Now, let us suppose we are talking about just one frequency (say a laser with frequency $B-\varepsilon$ hertz, where $\epsilon$ is an arbitrarily small positive number) with an amplitude that is varied over time for relaying a signal. Let's assume that samples of this wave are taken at the following points of time, measured in seconds:
$ \{0, \frac{1}{2B}, \frac{2}{2B}, \frac{3}{2B}, \ldots \} $.
Suppose the laser amplitude is changed to half its value at $\frac{1.4}{2B}$ seconds and is then doubled back to its original amplitude at $\frac{1.6}{2B}$, wouldn't this information go undetected? It seems to me that the theorem assumes that amplitude does not change inside one wavelet.


texts: How to decompose a signal into exponentally decaying sinusoids?

texts:
I have a system of coupled oscillators. One is a pendulum acting as a tuned mass damper and the other is a wooden structure. When I loosen the screw that allows the pendulum to oscillate I get a signal of the acceleration of the system like the following:

I know for sure that the amplitude of the waves composing this signal decay exponentially, however, I would like to know what their decay rate is. If I perform FFT on the signal I can only get the frequencies of the waves composing the signal. Is there a procedure similar to FFT I can implement in Python/Matlab with which I can find the frequencies, decay constants and initial amplitude of the waves composing this signal?
I found the following library in github (https://github.com/NanoComp/harminv), which would exactly do what I want, but it only runs on Linux systems (I have a Windows PC). Do you know of any programme that I can use to do this?


texts:
The discrete function for correlation over 2 dimensions is

$$ C(x,y) = \sum\limits_{p=1}^{x_{res}} \sum\limits_{q=1}^{y_{res}} f(p,q)h(p+x, q+y)$$

where x,y is a coordinate in the image, f is the image, and h is the template. $x_{res}$ and $y_{res}$ are the dimensions of the images.

I do not understand how this works, because of adding x and y to p and q respectively. This will translate the template out of the bounds of the image.

If $h(p+x, q+y)$ is replaced with $h(p-x, q-y)$, then the template with be translated to the coordinate x,y in the image. However I'm told this is convolution not correlation.

I tried to implement it in code to try and understand: https://jsfiddle.net/ua5d1uo2/ as you can see, using + just gives a matrix of zeros. but using - the highest number in the matrix is where you'd expect it to be (where the template is matched in the image).


texts: Generating blue/violet noise without FFT

texts:
I need noise with a high frequency bias for a realtime audio application, so I'm interested in things like blue noise or violet noise.

Is there a way to generate such noise without using a FFT or an IIR filter? In other words, something a little less computationally expensive?


texts: How to fix audio clipping in Adobe Audition?

texts: I am editing audio from video that was captured from the sound board. The audio was recorded too loud since someone turned up the board and and the bass and vocals sound scratchy. I have brought the levels down a bit to normalize them but still have the scratchy sound with the vocals. Is there an effect in Adobe Audition to help this?


texts: how to reconstruct an phase information from the magnitude spectrogram

texts:
I need to recreate the phase of a spectogram of magnitude and when inverse fourier, that the sound is understandable and not pure noise

Observe these softwares

https://photosounder.com/

http://warmplace.ru/soft/ans/

they can partially recreate the audio from the magnitude spectrogram.

What algorithms do you use to create the phase information, so that it doesn't sound like noise?

try to randomize the containers with the -pi pi phase and then when inverse fourier you hear pure noise.
How do these programs rebuild phase information?


texts: Algorithm implemented in the timeseries\resample function of Matlab

texts:
Does anyone know what algorithm is implemented in the Matlab function resample for timeseries?

I had a look on the manual but it just gives the instruction to use it: http://it.mathworks.com/help/matlab/ref/resampletscollection.html

Since the syntax is different from the one used for the usual resample (http://it.mathworks.com/help/ident/ref/resample.html) I assumed is not the same algorithm. Am I right?


texts: What type of circuit is responsible for convolution in the classic analog telephone?

texts:
I'm interested in learning how telephones work, so I did a little bit of reading about signal processing. When I came up with the word convolution, I quickly realized the importance of this term.

To begin with, I want to know how classic analog telephones worked. The apparent simplicity of their design appeals to me.

What kind of circuit was responsible for convoluting the microphone impulses in a classic telephone receiver, so that this signal could be transmitted over wires?.


texts: Calculating RMS/Crest Factor for a Stereo Signal

texts:
I'm doing some MIR related work with stereo audio and am a little unsure on how to proceed with some basic tasks.  All my academic work prior to this has involved forcing audio to "mono" to perform analysis, and I'm trying to avoid that as much as possible here.

So, for example, I have a crest factor function in python that looks like this for an array of audio data (either mono, left, or right channel):

def get_cf(data, win_size):
    """
    data: audio array in mono, left, or right channel only
    win_size: size in samples for the block analysis (created in calc_crest_factor)

    calc_crest_factor passes mono style data to this function to get the crest factor.

    returns: the crest factor for each window"""
    # Buffer the signal matrix-style (input, block-size, hop-size)
    data_matrix = librosa.util.frame(data, win_size, win_size)

    peaks = np.amax(np.absolute(data_matrix), axis=0)

    # Get the mean-square over each window
    RMS = np.sqrt(np.mean(np.square(data_matrix), axis=0))

    # Get crest factor for each window
    return np.divide(peaks, RMS)

In another function, I call the function above like so for stereo audio:

 if len(data) == 2:
    crest_factor_l = get_cf(data[0,:], win_size)
    crest_factor_r = get_cf(data[1,:], win_size)

And here I now have a crest factor for the right channel and one for the left channel, but am unsure on how to proceed on getting a final "crest factor" value for the audio.  Do I just choose the greater of the two values for each window?  Or is it more correct to keep both values?

This same question goes for RMS too.  I know in my pro audio applications, stereo audio gets passed to some RMS calculator and a single value gets pumped out.  How do the two separate channels with two separate values for either Crest Factor or RMS become 1 value while honoring the "stereoness" of the data?


texts: IIR bandpass filter with very low corner frequencies

texts:
I'm trying to get in the MATLAB Signal Processing Toolbox a bandpass IIR filter having the following specifications: pass-band [0.1-0.5] Hz and stop-band attenuation 30 dB. I'm using the following command:
[fdata,DigFilt] = bandpass(data, [0.1,0.5], fs, 'ImpulseResponse', 'iir', 'StopbandAttenuation', 30);
The sampling frequency fs is 860 Hz. The command info(DigFilt) says that

IIR Digital Filter (real)
Number of Sections  : 5
Stable              : Yes
Linear Phase        : No
Design Method Information
Design Algorithm : Elliptic
Design Options
Match Exactly : both
Design Specifications
Sample Rate            : 860 Hz
Response               : Bandpass
Specification          : Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2
Passband Ripple        : 0.1 dB
First Stopband Edge    : 84.3 mHz
Second Stopband Atten. : 30 dB
Second Stopband Edge   : 67.9315 Hz
Second Passband Edge   : 500 mHz
First Passband Edge    : 100 mHz
First Stopband Atten.  : 30 dB

The very strange parameter is Second Stopband Edge = 67.9315 Hz that seems to me too high considering the high corner frequency of 0.5 Hz. In fact, when i plot the frequency response with fvtool(DigFilt) i get the following

where i see that at 67.9315 Hz the attenuation is far below 30 dB. A zoom of the pass-band is the following

With this image, the first stop-band edge seems to be 57 mHz (and not 84.3 mHz as indicated by the command info) and the second stop-band edge seems to be 577 mHz. Why is there such disagreement between the images and the output of the command info ? Is it caused by the very low corner frequencies? Thanks to all.


texts: Comparison of Linear Convolution and N Point DFT

texts:
I am studying Discrete Fourier Transform currently and I have a doubt in that.

Consider two sequences $$\left\{1,2,3,4\right\}$$ and $$\left\{0,1,0,0\right\}$$ When I convolve them linearly, I get this $$\left\{0,1,2,3,4,0,0\right\}$$

However, if I take the 4 point DFT of $\{1,2,3,4\}$ and $\{0,1,0,0\}$ and then multiply them, and after that if I take IDFT of the result, I get this $$\{4, 1, 2, 3\}$$

$$\mathrm{DFT}({1,2,3,4}) = \{10, -2+2j, -2, -2-2j\}$$
$$\mathrm{DFT}({0,1,0,0}) = \{1, -j, -1, j\}$$

Element wise product $$\{10, 2+2j, 2, 2-2j\}$$
$$\mathrm{IDFT}({10, 2+2j, 2, 2-2j}) = \{4, 1, 2, 3\}$$

I know that the output of linear convolution here would need at least 7 elements and I am calculating the 4 point DFT/IDFT which of course would not be enough.

But what inference should I take from this. The result of IDFT looks somewhat like circular convolution but it is not exactly the result that you would get even after circular convolution.


texts:
I have to develop an underwater positioning system which has to determine the position of a ROV.

Four buoys will be placed on each corner of a swimming pool. Each one of these buoys will be equipped with an hydrophone and a transducer (which emits acoustic signals). Both devices will be connected to a Raspi for performing DSP.

The ROV will also contain the same equipment (transducer, hydrophone, Raspi).

I was wondering which could be the best way to determine the distances between the ROV and the buoys for triangulating the position.

At first glance I have tought with the next ways to achieve it:

Signal Strength: Every buoy will emit a beacon signal with the same power, but at  different frequency for each one. The ROV could determine its position be means of comparing the power received.
Ping: The ROV emits a ping and inicialices a counter, when the buoys receive the ping they respond immediately. When the ROV receives the ping back stops the counter and calculates the distance.

I think that the second approach can be much more accurate. The first method that comes in my mind in order to achieve it is to use a certain frequency for emitting the ping (let's say 2khz). The buoys would be in recepcion mode, awaiting for receiving this ping. They would detect the ping by means of frequency analysis (Goertzel's algorithm). The same algorithm would be used in to ROV for receiving the ping.

The main drawback is that the system needs to be really precise. An error of 1ms means 1.4m of deviation. I don't really know if that is doable and if is the best way to achieve it.

Which method would you use?


texts:
I have a motor, that I want to analyse, using its sound, so I can  its 'character' I was using the the simple fft, and figured out, that it wouldn't help, so I tried the order analysis, at least I incremented the speed of the motor and I can say it in spectrogram like here:

My question isn't about codes but about theory, what are the methods that I can use to analyse the sound of motor?
Thanks for any help !
link : related question


texts:
I have some problem with understanding the phase noise definition formula.
please see this image:

I can't understand the paragraph that I show ? near it. How is it possible to get phase noise > 0 dB when the power is less than carrier signal?

In this image. what is difference between A.11 and A.12 formula? and how does A.12 cause "This redefinition is intended to avoid difficulties in the use" ?

This definition breaks down when the mean squared phase deviation, How is it possible?


texts: Estimation of occupied frequency bins (location of non-zero fourier coefficients)

texts:
I'm working in circuits fields and I am not very familiar with spectrum sensing techniques.

Is there a method to identify location of non-zero Fourier coefficients of a signal (just locations, not values) with minimum computational cost (less that computations of FFT)?

Suppose my signal is a vector of length $N$ associated with some white noise.Suppose the demanded frequency accuracy is
$$\frac{f_\text{sample}}{10N}$$

and imagine my signal is a 1000 samples of a signal  and we have quantized this signal through a low resolution ADC. And signal is sparse in frequency domain, meaning that and only a fraction of its DFT coefficients are non-zero (like less than 10% of coefficents). Currently I am using a method called Periodogram which is based on FFT.

Other than FFT, do you think using multiple band-pass filters work? I was thinking to Band-pass filter, but it seems to be more computationally costly.
I mean I can pass the signal through multiple band-pass (like 100) filters which altogether cover the whole spectrum and then measure the energy of the each frequency portion of the signal?


texts: How can I oversample OFDM received signal in MATLAB

texts:
I need to oversample a received signal in OFDM by MATLAB, according to the below diagram, but when I oversample, I finally get the same number of samples however that should be double. !!  The oversampling should be done after receiving the signal, .. as below

Could you please explain how can I do that resampling in MATLAB? I mean after receiving the signal, which is y = conv(x,h) + n; where x is the transmitted signal and h is the channel, and n is white noise.   so. how can I perform the resampling for y ?

here is what I tried to do :

Y_r = resample(R,2,1);   %% R is the received signal
ty = (0:(length(Y_r)-1))*1*Ts/2;
Y_r_new=exp(-1i*2*pi*Fc*ty).*Y_r;   %the oversampled signal.

OK, till now is ok,  but when I run this command, in the first time I put Y_r_new is the oversampled signal, and then change it into Y_r_old which is the original signal, I get an output with same length !!:

for isij=1:Numsymbol     %%Numsymbol      is the number of symbols

    R_D_fil_be=Y_r_new(1,(isij-1)*L_perOFDM+1:isij*L_perOFDM);  %%L_perOFDM is number of carrier multiplied my symbol.
end


texts: The mean value of phase noise as a stochastic process

texts:
What is the mean value of phase noise as a stochastic process?
Where can I get a theoretical analysis of this topic?

PS: PLL produces cos(2*πfct+φ(t)). The phase noise refers to φ(t). The mean value of the phase noise what I say refers to the mathematic expectation of phase noise stochastic process φ(t), namely E{ φ(t) }.


texts: Fourier transform of ${\Pi}_{a}(t)\cos(2{\pi}f_{0}t)$

texts:
I want to find the following: $\mathfrak{F}[{\Pi}_{a}(t)\cos(2{\pi}f_{0}t)]$

I first did: $\mathfrak{F}[{\Pi}_{a}(t)] = 2a\text{ sinc}(2af)$
then: $\mathfrak{F}[\cos(2{\pi}f_{0}t)] = \frac{1}{2}[\delta(f-f_{0})+\delta(f+f_{0})]$

So: $$\begin{align}\mathfrak{F}[{\Pi}_{a}(t)\cos(2{\pi}f_{0}t)] &= \mathfrak{F}[{\Pi}_{a}(t)]\ast \mathfrak{F}[\cos(2{\pi}f_{0}t)]\\&=2a\text{ sinc}(2af)\ast\frac{1}{2}[\delta(f-f_{0})+\delta(f+f_{0})]\\&=a\text{ sinc}(2af)\ast\delta(f-f_{0})+a\text{ sinc}(2af)\ast\delta(f+f_{0})\\&=a\text{ sinc}(2af)+a\text{ sinc}(2af)=2a\text{ sinc}(2af)\end{align}$$

I would like to know if it is correct and if there is an alternative way to find the result easier.


texts:
Is my understanding about carrier and timing offset right?

Suppose my transmit  frequency is 100 MHz and if my reference is 1ppm; then the transmit frequency has +/-100Hz offset.

Similarly, if my receive frequency is 100 MHz and if my reference is 2 ppm; the receive frequency  has +/-200Hz offset.

So the carrier frequency offset is +/- 300 Hz, i.e 600 Hz; does this have to be recovered in receiver carrier frequency recovery?

Similarly, if the symbol rate is 100KHz with reference 1 ppm then the transmitter has +/- 0.1 Hz symbol offset and the receive symbol rate is 100kHz with reference 2 ppm it has +/- 0.2 Hz symbol offset.

So the symbol frequency offset is +/-0.3 Hz, i.e 0.6 Hz. Is this symbol recovery? What is symbol phase recovery? Is there any effect of sampling frequency offset also?


texts:
In reading Rafael Gonzalez Digital Image Processing, second edition, section 4.10.2,
the author writes:

  Notch filters are the most useful of the selective filters. A notch filter rejects (or passes) frequencies in a predefined neighborhood about the center of the frequency rectangle. Zero-phase-shift filters must be symmetric about the origin, so a notch with center at $(u_o, v_o)$ must have a notch at location $-(u_o, v_o)$.

Two questions:

1) Why does a zero phase shift filter have to be symmetric about the origin (with real coefficients I am assuming)?

2) What does the author mean here when he says a "notch"

Any insights appreciated.


texts: Fourier Series representation of a signal

texts:
Use the defining equation for the Fourier Series coefficients to evaluate the Fourier Series representation of the following signal:
  $$x(t)=\sum_{m=-\infty}^{+\infty}=(\delta(t-m/3)+\delta(t-2m/3))$$

I calculated $T=2/3$ and $w_0=3\pi$, however, I'm not sure whether $X[k]$ will be $$X[k]=3/2 * \int_{0}^{2/3}(2\delta(t)+\delta(t-1/3)+2\delta(t-2/3))*e^{-jk3\pi t}dt$$or$$X[k]=3/2 * \int_{0}^{2/3}(\delta(t)+\delta(t-1/3)+\delta(t-2/3))*e^{-jk3\pi t}dt$$
And if $X[k]=3/2 * \int_{0}^{2/3}(2\delta(t)+\delta(t-1/3)+2\delta(t-2/3))*e^{-jk3\pi t}dt$, is this following calculation correct (since I never did integral with $\delta$ before)?
$$X[k]=3/2*(2e^{-jk3\pi 0} + e^{-jk3\pi 1/3} + 2e^{-jk3\pi 2/3})=3+3/2*e^{-jk\pi} + 3e^{-jk2\pi}$$


texts: There seems to be a number of different ways for telecommunication. What is the most recent (and maybe standard) technique used today? It seems the simple AM/FM modulations are definitely somewhere in the past, then there are these spread spectrum systems... All hints welcome :)


texts:
I need to create 4 different pass-band filters. What remains the same throughout is the following:

Sampling Frequency = $3000Hz$

Pass-band Frequency = $900Hz-1200Hz$

Now, these are the filters I am supposed to create:

$24^{th}$ order FIR using windowing method with Hamming window.
$24^{th}$ order FIR  using frequency sampling.
$8^{th}$ order IIR using bilinear transform with Butterworth prototype analogue filter
$8^{th}$ order IIR using impulse invariance with Butterworth prototype analogue filter.

My Attempts:

Normalised frequencies are $0.6$ and $0.8$ and the filter is 24th order  hence

b = fir1(24,[0.6 0.8]);

The Desired frequency response is
$$H(\Omega)=\exp^{-12j\Omega}$$ for $$\frac{3\pi}{5}\leq\Omega<\frac{4\pi}{5}$$
and
$$\frac{6\pi}{5}<\Omega\leq\frac{7\pi}{5}$$
With $$\Omega=\frac{2\pi k}{25}$$
Hence I have that $H(\Omega)\neq0$ when $k=8,9,16,17$

The function in Matlab that creates this filter is

B=fir2(N,f,m)

Where $f$ is the vector with sampled frequencies and $m$ is the magnitude at those frequencies. But for my case I have frequencies higher than $1$ at it says that $f$ starts with $0$ and ends with $1$. I kind of guessed the outcome and produced this:

f=[0 0.64 0.72 1];
m=[1 exp(-12*j*0.64) exp(-12*j*0.72) exp(-12*j)];
b=fir2(24,f,m)

I have a feeling that this is not correct.

For the bilinear IIR I went to matlab's "butter" function.

[b,a] = butter(4,[0.6 0.8],'stop');

For this part I know I need to use both 'butter' and 'impinvar' together but I don't know how.

EDIT / ATTEMPT:

[b1,a1] = butter(4,[2*pi*900 2*pi*1200],'s');
[bz,az] = impinvar(b1,a1,3000);

Could someone tell me if my attempts 1-3 are correct and help me out a little with 4? Thank You.


texts:
the question is as it is in the topic: What is the best spline to interpolate freq analiser graph?

I am looking something simply and fast to implement. I read about catmull-rom it looks it could be good, but as I understand it needs 4 points to be defined. But I think in my case the best would be something that requires only 3 points defined (3 points for each freq bin). Is that possible at all?


texts:
In the audio domain, I am currently attempting to use MATLAB to distil:

$\textrm{signal}$ from $\textrm{noise + signal}$
$\textrm{noise}$ from $\textrm{noise + signal}$
using two adaptive filters $\rightarrow$ two results.

I get the first answer quite effectively using:

hFDAF1 = adaptfilt.fdaf(AdaptFiltLength,StepSize,Leakage,Delta,Lambda)

[Errors1, Adapt_Out_Audio] = filter(hFDAF1, NoisePlusAudio, Audio)

where NoisePlusAudio is a microphone in the room, and Audio is music playing through speakers in the room.

How do I get the adaptive filter to remove the Audio from NoisePlusAudio, just leaving the background noise of the room, much like an echo canceller?
The following does not work, it just lets all the sound through.

[Errors2, Adapt_Out_Noise] = filter(hFDAF2, Audio, NoisePlusAudio)

I'd love to know the answer ....


texts: Numerical Fourier transform for exact frequency

texts: Mathematically, suppose I have a function $f(t)=\sum_k c_k e^{-i \omega_kt}$, where $\omega_k$ may not fall in $[0,2\pi]$. With an analytical Fourier transform, I can get a sum of delta functions centered at those frequencies. Now, I only have $N$ evenly-spaced points of $f(t_j)$ in the time domain $[0,T]$, albeit $N$ and $T$ can be freely chosen. How do I use a numerical Fourier transform to get the frequencies $\omega_k$ (e.g. for $\omega_1=1,\omega_2=10,\omega_3=-30$), not confined in $[0,2\pi]$ and with no prior knowledge of the frequency upper/lower limit?


texts:
i want to know more about brief descriptor algorithm and matlab code for this.
the points copmare with another what choice them. e.g. 128 point at patch how are choose.?
thanks


texts: What is the name of this color transformation?

texts:
This is a question regarding color transformation in images. I have this color transformation matrix I am using to convert an RGB image to a color space whose name I do not know:

T = [(1/3) (1/3) (1/3); (1/2) 0 (-1/2); (-1/2) 1 (-1/2)]

What is the name of this color transform? I think I once saw somewhere that it is called KL transform because it was close to a KLT computed over a large collection of images, but I am not sure...


texts: What is an octave? It is said to be eight, but I cannot see the eight anywhere

texts:
When I searched for octave, I listened to the fact that if you take an octave band the lower cutoff is double the upper cutoff.

Where is this name octave coming from, that is, where does the figure eight show its significance in the above statement?

In the same way, if the above is clarified, I have some doubts on 1:2 and 1:3 octaves.


texts: Pixel Wise Write into a Video File in MATLAB

texts:
A video file (in .ptw  format) is read in MATLAB in the form of a 3 dimensional matrix (a structured format). My aim is to process the video in time domain on each coordinate pixel individually and eventually write the processed time domain output in a video file. I am looking for a technique for the same.

Please see - The processing are of type cross-correlation, filter in fourier domain, that requires the data to be transformed to 1-d matrix.


texts: Applying FIR filter to data with different sample rates

texts:
I have a filter design, and it filters over a 1-2 kHz range.
What should I do if I want to apply it to data with a different sample rate than the one for which it was designed?

Let's say it consists of Bessel and Chebyshev filters. How do I find a function that defines each filter's coefficients at an arbitrary sample rate? Or should I do this by hand?


texts: How to do Frequency Scaling on an Audio File

texts:
Please excuse me if my terminology is wrong. I'm from a music production background and have no experience in signal processing.
I was wondering if it was possible to stretch out the overtones (partial tones) of sound through digital signal processing.
In the natural harmonic series  or the overtone series, there is the fundamental frequency. Then you have overtones at integer multiples of the fundamental frequency.
Is there a software which would let me alter the ratio between the different overtones of the sound?
For example, If I have an audio file of 0-20,000 hertz. How can I take the first 10,000 hertz of the audio spectrum and stretch it out to 20,000 hertz so that all the overtones are spaced wider and the ratio is doubled.
It's called Frequency Scaling or Pitch Scaling I believe. I do understand the difference between Frequency shifting and Frequency Shifting and I'm curious to experiment with Frequency Scaling and not Frequency shifting.
I'm looking to do something like this.
Thank you.


texts: Difference Between Dirac delta and unit impulse function

texts:
The definition of Dirac delta function states that it gives a value of $\infty$ at t=0 and 0 elsewhere.

But, the definition of unit impulse function states that it gives a value of 1 at t=0 and 0 elsewhere.

Many textbooks state that Dirac delta and unit impulse are the same function.

So What is the difference between Dirac delta and unit impulse function?


texts: What are the pros and cons of wavelet for filtering compared to conventional filters?

texts: Wavelets have been widely used in denoising or extracting one specific frequency band of a signal nowadays. However, these can also be done through conventional filters (e.g. butterworth, Chebyshev). So what are the pros and cons for these two methods for filtering?


texts:
I am providing 2 d grey scale images to the anisotropic diffusion function in MATLAB but not getting desired outputs. How many iterations are ideal and how should i approach this problem?I am keeping kappa values between 20 to 100. I am carrying out the operations on the standard lena image by adding salt and pepper noise.

Input Image:

Expected Output:

The output of 80 iterations of anisotropic diffusion with k=10


texts: Energy per bit ($E_b$) in BPSK with non-unity channel gain

texts:
I would like to know what is exact and correct definition of $E_b$ (energy per bit) in digital communication. Consider I have a model such as      r=a*x+n where a is the channel gain, x is a (+1 or -1) BPSK symbol and n is zero mean AWGN noise. I am defining $E_b$ to be (assuming a=10 and x given:

a=10;
Eb= sum((a*x).^2)/length(x);

However this method seems to be failing since $\sigma$ can be related to $E_b$ using $\sigma=\sqrt(E_b/(2*\text{SNR}))$. So if a is increased the noise power is increased as well and this should not be the case. Therefore should the definition of $E_b$ be like following:

   a=10;
   Eb= sum((x).^2)/length(x);

Meaning that is $E_b$ normalized to the a (channel gain). In this case then $E_b$ is 1 and as a increases the noise power won't be increasing. Can anyone elaborate on this? Should the noise power increases as the amplitude of signal increases? Then in this case performance gets worse and worse as signal amplitude is increased. Is this a correct statement?


texts: I want to design a sequence of numbers, which must include only -1, +1 and 0, to have a specific PSD. What is the best way to do that?


texts:
How can bass/low end be added to a signal?

With a low-pass filtered sub-oscillator running at an octave or two below the signal, there still doesnt seem to be enough bass.

Is there a mathematical function to easily add some warmth or boom to the sub oscillator? Or possibly adding two in unison, slightly detuned?


texts: Inverse Discrete Time Fourier Transform of $1$

texts:
$\textrm{DTFT}(\delta[n]) =1$,
but $\textrm{IDTFT(1)} = \frac{\sin(\pi n)}{\pi n}$.
Why it is not equal to the unit impulse $\delta[n]$?


texts:
David I.Shuman in "vertex-frequency analysis on graph" claims that,"we generalize one of the most important signal processing tools – windowed Fourier analysis – to the graph setting and When we apply this transform to a signal with frequency components that vary along a path graph, the resulting spectrogram matches our intuition from classical discrete-time signal processing. Yet, our construction is fully generalized and can be applied to analyze signals on any undirected, connected, weighted graph."

In this paper generalized translation operator that allows us to shift a window around the vertex domain so that it is localized around any given vertex, just as we shift a window along the real line to any center point in the classical windowed Fourier transform for signals on the real line.

generalized translation operator:

$$(T_{i}f)(n) := \sqrt{N}(f*\delta_{i})(n) = \sqrt{N}\sum_{\ell=0}^{N-1}\hat{f}(\lambda_{\ell}) \chi^{*}_{\ell}(i)\chi_{\ell}(n) .$$

See the picture

Question

How do I understand translation on the graph?
How to label irregular graphs with high dimensional data?

Thanks.


texts: What the difference between the family of Discrete Wavelet Transform？

texts:
When I useed Mathematica,If found many Transforms in the list of Discrete Wavelet Transforms.

For example:

discrete wavelet transform (DWT)
stationary wavelet transform (SWT)
lifting wavelet transform (LWT)
discrete wavelet packet transform (DWPT)
stationary wavelet packet transform (SWPT)

I always use DWT,and found it can be used in many cases such as de-noising,filtering data,embedding watermarking,detecting the discontinuity and so on.

Is it different cases use different transforms?So how to know it?


texts:
I need to detect the PSK modulation posted on my previous post(phase difference detection) with 8 to 16 phase constellations (depending on selected baud rate) over a max 60 degree PSK phase range.For communication start and end the Tx generates carrier with delta(ph)=0 or -180 deg to enable Rx to synchronize or detect end of communication.as speed of converging to the result is important to my application (theoretically real-time application) I was wondering if there is a fast algorithm with non- or low-iterative mechanism that can converge fast to the instantaneous and differential phase value (implementation with verilog HDL).

I think the sin(delta(ph)) value can be filtered out of I/Q component multiplication relatively fast, but it needs an LUT to save the sin(delta(ph)) values for all phase constellations. new ideas are always welcomed!


texts:
I have been building a convolution library for multichannel audio and am using FFTW as the main FFT transform library. There are 4 channels of audio in play at any one time and they are interleaved, so one "frame" contains 4 separate samples - one from each channel.

I have been using the Real to Complex 2D functions up until now, but I am starting to be concerned that multichannel audio is perhaps not the right application for this - even though it fits with the documented data structure.

Should I be using 4 separate 1D transforms instead of a single 2D FFT pass?