texts: Given an output from a filter how do you find the input?

texts:
I have the output from a narrow bandpass filter. I know the details of the filter completely. The filter removes noise but also adds some contamination to the output. How can I find the input corresponding to the output? I know that as a result of the filtering that information is lost. I know that low frequencies and high frequencies cannot be recovered. That's fine I just want the frequencies in the input corresponding to those within the bandpass filter.  Here is a simple example (my actual case is a more complicated waveform with noise).

In the above (a) is the original time history and the output from the filter is (b). Then I have taken (b) and filtered it again to make (c) and then finally taken (c) and filtered it again to make (d).  I feel I ought to be able to work out (c) from (d), and (b) from (c). I don't think I can completely work out (a) from (b) because the sharp start and end imply high frequencies which I will have lost in the filtering but I ought to be able to get close.  It is interesting to note that there is a progressive change with each filtering as may be seen by examining the start and end in detail.

This question is similar and suggests that working in the frequency domain and dividing by the filter frequency response function is the way to go. However that would get the noise on the original signal back so it is more complicated. So how do I work out the input to the filter that corresponds most closely to the output I have?


texts: Stochastic Methods for Image Deconvolution Problem

texts: If we convolve an image with a point spread function and from the resulting image to find the input image, can we use any stochastic approaches? I feel like we will not be able to. A single image seems to me a deterministic quantity and I cannot think of any way to approach this deconvolution problem in a stochastic way. However, I am not sure and I want to know if there is a way. Any help is appreciated


texts: Removing noise from audio using Fourier transform in Matlab

texts:
I'm trying to remove noise from an audio file. This audio file contains speech as well as constant pink noise. I know that I have to use the Fourier transform to convert to the frequency domain then use a filter to filter out the frequencies of the pink noise, but I really don't know where to start with that. It also seems that the noise covers many more frequencies than the speech file (I have the speech and noise files separately) by looking at the plots in the frequency domain.

Doesn't that mean that if I filter out the frequencies of the noise it'll remove all the speech as well?

The plot of the speech audio in the frequency domain displays that the frequencies are mostly between -450 and 450.

The plot of the noise alone in the frequency domain displays that the frequencies are between -2000 and 2000. This clearly covers a much wider range of frequencies than the speech audio.

Does this mean I can't remove it from the noisy speech audio without removing the speech too? Or can I remove the frequencies outside of -450 and 450 and that would remove much of the noise? If so, how do I compute the range of frequencies instead of looking at plots myself to see the range?


texts: How to detect impulse like peaks - Matlab

texts:
I have a signal which is a matched filter output.

whose values are given here:

Amplitude values

Input to this matched filter is radar return signals mixed with additive gaussian random noise.

Its impulse like peaks are at indices 2201,3005,4443,4444,6524(by manual inspection).

How can I detect these peaks programmatically.
I have tried findpeaks function in matlab.
Not got the result I wanted.

Can you help me out.


texts:
I've written an application that estimates pitch based on autocorrelation function. I did peak picking by comparing vector values to determine whether the central one is a peak or not, but this method is not working well.

Can someone indicate a reliable peak picking algorithm?


texts: Orthogonal basis of signal space and the projection of white noise

texts:
I am trying to make the relation between linear modulation and nonlinear one by using orthonormal expansion. The purpose is to understand what is orthonormal set in each case and to understand the operation of projection.

Linear modulation

In digital linear modulation, the baseband signal can be written as

$$x(t) =  \sum_n a_n p(t-nT)$$
where $a_n$ is data, $\lbrace p_n(t) = p(t-nT)\textrm{, }n\in \mathbb{Z}\rbrace$ is orthonormal set, i.e. $<p_n(t),p_m(t)> = \delta_{m-n}$ with $<x(t),y(t)> = \int x(t)y^*(t)dt$ is inner product defined for the signal space we are working on. To get $a_n$ back, we need project $x(t)$ to $p_n(t)$.

Use matched filter $q(t) = p^*(-t)$ thus $q(t-\tau) = p^*(\tau - t)$.

by defining $g(t) = p(t) \star p^*(-t)$ where $\star$ is convolution. $g(t=0) = 1$ and $g(t=nT) = 0$ because $\delta_{m-n} = <p_n(t),p_m(t)> = g((m-n)T)$.

\begin{align}
y(t) &= x(t) \star p^*(-t)\\
&= \sum_n a_n p(t-nT)\star p^*(-t)\\
&= \sum_n a_ng(t-nT)\\
\implies y(t=mT) &= \sum_n a_ng((m-n)T) = a_m
\end{align}

If we have white noise $n(t)$ : $y(t) = x(t) + n(t)$. The noise is processed as

\begin{align}
z(t) &= n(t) \star q(t)\\
&= \int n(\tau)q(t-\tau) d\tau\\
&= \int n(\tau) p^*(\tau -t) d\tau\\
\implies z(t=mT) &= \int n(\tau) p^*(\tau - mT) d\tau\\
&= <n(t), p(t-mT)>
\end{align}

Then we can say that for a given $y(t)$, each processing $m$ at the receiver which ends with sampling at $t=mT$, the noise process is projected to the vector $p_m(t)$ creating $z_m$ and the data part is projected to the same vector creating $a_m$. $\lbrace p_m(t) = p(t-mT)\textrm{, }m\in \mathbb{Z}\rbrace$ is orthonormal set, thus $z_m$ are uncorrelated, with Gaussian assumption, $z_m$ are independent.

This is famous process in classical technical books. Two conclusions I get

The set of orthonormal vectors $\lbrace p_m(t) = p(t-mT)\textrm{,
    }m\in \mathbb{Z}\rbrace$ has infinite number of elements as $m \in
    \mathbb{Z}$.
The orthonormal vectors $p_m(t)$ can be no-time-limited and the orthogonal property holds on the entier time support.

Non-linear modulation

Let's take a binary FSK modulation as example.
$M$ basis functions, $k \in \mathbb{S} = \lbrace 1, ..., M \rbrace$:

$$\phi_k(t) = \begin{cases}\sqrt{\frac 2T}\sin\left(\frac{k\pi t}{T}\right)& \text{for}\quad 0 \leq t \leq T\\0 &\text{otherwise}\end{cases}$$

I write the waveform as $x(t) = \sum_n \gamma_n(t-nT)$ where $\gamma_n(t) = \phi_k(t) \textrm{ if } a_n = k$.

Questions

Question 1 : At the receiver, for the $n^\rm{th}$ symbol, we try projecting to $M$ functions $\phi_k(t-nT)$. If $k=k_0$ gives the largest power, we decode $a_n = k_0$. Is $\lbrace \phi_k(t-nT) \textrm{, } n \in \mathbb{Z}\textrm{, }  k \in \mathbb{S}\rbrace$ the orthonormal set as $<\phi_k(t-nT),\phi_l(t-mT)> = \delta_{(m-n)\times(k-l)}$ ?

I mean I expect something equivalent to the two properties (infinite number of element and basis functions are not time-limited) of orthonormal set in the linear modulation case.
Question 2 : is it correct if I say the noise samples are uncorrelated because the projection are $<n(t),\phi_k(t-nT)>$ and $<n(t),\phi_l(t-mT)>$ and $<\phi_k(t-nT),\phi_l(t-mT)> = \delta_{(m-n)\times(k-l)}$ ?
Question 3 : The $M$ basis functions are interpreted as constellation of $M$ points. Is there any analogy with the linear modulation case ? If we consider M-QAM, we have also a constellation of $M$ complex points but if I write $a_n = a_{rn} + ja_{in}$, the two functions $p(t-nT)$ and $jp(t-nT) = e^{j\pi/2}p(t-nT)$ are not orthogonal.


texts: Reconstruction of a signal using 1D discrete wavelet

texts:
There is a signal of $50\textrm{ Hz}$ and $120\textrm{ Hz}$ corrupted with noise. The sampling rate is $1000\textrm{ Hz}$. Here I used a 3-level DWT to extract this two components of the signal respectively. The figure is the power density spectrum of signal reconstructed from the detailed coefficient. My question is, why there is a unknown frequency component ($129.9\textrm{ Hz}$) in it?

clear all
Fs = 1000;            % Sampling frequency
T = 1/Fs;             % Sampling period
L = 1024;             % Length of signal
t = (0:L-1)*T;        % Time vector
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
X = S + 2*randn(size(t));
plot(1000*t(1:50),X(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('t (milliseconds)')
ylabel('X(t)')
f = Fs*(0:(L/2))/L;
h=boxcar(L);
P1=psd(X,L,Fs,h);
plot(f,P1)
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')
ylim([0 300])

[c,l]=wavedec(X,3,'bior4.4');
for i=1:3
d{i}=wrcoef('d',c,l,'bior4.4',i);
a{i}=wrcoef('a',c,l,'bior4.4',i);
Pa{i}=psd(a{i},L,Fs,h);
Pd{i}=psd(d{i},L,Fs,h);
end

figure
plot(f,Pa{3})
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P(f)|')

figure
plot(f,Pd{3})
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P(f)|')


texts: Question about zeroes of simple 2nd order FIR filter

texts:
I have a question about the zeroes in a simple second order FIR filter.  I'll list out the major beat points of calculating where the zeroes are before asking the question (I'm following "Designing Audio Effect Plug-Ins in C++", section 5.17).

Starting with a simple second order FIR filter difference function:

$y(n)=a_0x(n)+a_1x(n-1)+a_2x(n-2)$

We can z transform it to:

$Y(z) = X(z)(a_0+a_1z^{-1}+a_2z^{-2})$

Which gives us the transfer function:

$H(z) = a_0+a_1z^{-1}+a_2z^{-2}$

We can factor out $a_0$ to make it a gain parameter, and replace $a_1$ with $\alpha_1$, and $a_2$ with $\alpha_2$, where $\alpha_1 = \frac{a_1}{a_0}$ and $\alpha_2 = \frac{a_2}{a_0}$:

$H(z) = a_0(1+\alpha_1z^{-1}+\alpha_2z^{-2})$

To find the zeros, we can ignore $a_0$ and just look at the part inside the parentheses.

$0=1+\alpha_1z^{-1}+\alpha_2z^{-2}$

We know that the zeroes need to be complex conjugates, so can change it to this:

$0=(1-Z_1z^{-1})(1-Z_2z^{-1})$

where $Z_1=Re^{j\theta}$ and $Z_2=Re^{-j\theta}$

Using Euler's equation, we can expand and do algebra to get this:

$0=1-2R\cos(\theta)z^{-1}+R^2z^{-2}$

Comparing that to the earlier equation:

$0=1+\alpha_1z^{-1}+\alpha_2z^{-2}$

We can see that this equation has a zero where:

$R=\sqrt{\alpha_2}$

$\theta=cos^{-1}(\frac{\alpha_1}{-2R})$

The other zero has the same radius $R$, but has a negative theta ($-\theta$).

Ok so my question is this. Using values $a_0=1$, $a_1=-1.27$, $a_2=0.81$, we get $R=0.9$ and $\theta=\frac{\pi}{4}$.

That seems to be correct and works well, but let's say that $a_1=-3.6$. We get the same radius $R$, but to calculate $\theta$ we have:

$\theta=cos^{-1}(2.0)$

... which is not a valid thing.  cosine never has a value of 2, so acos(2.0) is not defined.

Where did i go wrong or how is this situation handled?


texts: Where to get an image dataset for sports?

texts:
I am doing a project on classification of sports images,for which I have not found a proper dataset on the net. I am working on sports namely cricket, basketball, soccer, hockey, baseball and tennis.

Any suggestions from where I could get the same are welcome. In case I don't get the dataset, if I collect the images from google, is there any constraint on image features like size of image, dimensions, pixels, etc for generating a dataset for image processing.


texts:
In  a digital communication receiver, matched filter(SRRC filter) is used. In different literatures, the location of the matched filter is mentioned in two different places. One is just after the ADC followed by the resampler of a timing recovery system, and the other one is after the resampler of timing recovery process followed by a timing error detector (TED).

To my understanding, practically it should be after the resampler. Lets say, the interpolation factor is $4$ at the transmitter side, that means $4$ samples per symbol. So, if the Symbol rate is $2\textrm{ MHz}$, the sample rate is $8\textrm{ MHz}$.

Now, in the receiver side, let's say the ADC I am using is sampling at $40\textrm{ MSps}$ i.e the sample rate is $40\textrm{ MHz}$, which is $20$ times the symbol rate, or $5$ times the transmitter sample rate. It is only after resampling that we will get back our original transmitter sampling rate, so that SRRC filter (with oversampling rate $4$) can be employed. Otherwise, if we use before the resampler, we have to use a SRRC filter (with oversampling rate $20$), which will increase the number of filter coefficients and hence the hardware cost.

Is my understanding correct?


texts: How to change the start point of resampling process?

texts:
I'm trying to resample a digital communication signal in SciPy or Matlab. Suppose the signal was sampled at 3 samples per second, and I want to resample it to 2 samples per second, the thing is I also want to be able to change the new sampling point so the new samples doesn't necessarily start at the same point as the orignal samples.

I'm using the Scipy resample function, but it doesn't have the flexibility to change the sample point, it only allows

The resampled signal starts at the same value as x ...

The Matlab resample function can't do that either.

Is there a way to shift the start point by a small amount, say $\alpha T$ where $T$ is the symbol duration and $0 \le \alpha < 1$ ? I guess what I need is the generic resampling algorithm underneath these resample functions so I can see if there's anything I can tweak.


texts: Audio RMS normalization prior to a DNN classification

texts:
I want to normalize my data prior to a deep neural network model (DNN). It was recommended to me to use real mean square (RMS) normalization for audio, though I am not sure this is the best for a DNN. I am using MFCC features to represent the data.
Is RMS a good method? If so, how do I choose a good RMS value to normalize with respect to that value? Is there a rule of thumb?


texts: Implication of Cramer Rao Lower bound and relation with SNR : non-technical overview

texts:
I need some clarifications on  CRLB which has been bugging me for quite some time.

Clarification: When computing the Fisher Information(FI), the mathematical expression contains $\theta$ and not $\hat{\theta}$ wnere $\theta$ is the true known parameter that we wish to estimate and $\hat{\theta}$ is its estimate. This means that FI is calculated based on the true, known value of the estimate. So, when implementing the expression of FI for any model, we plug in the true known value of theta and then compare it to the variance (MSE) of the estimate. Am I correct?
Confusion: The Mean Square error (MSE) between the true and the estimated volume may decrease with increasing Signal to Noise Ratio. CRLB is a lower bound for MSE. In that case, would CRLB decrease with increasing SNR?


texts: Finding defects in wall paint (finding difference in textures)

texts: I have been experimenting with computer vision techniques to find defects in paintings, more specifically defective brush strokes. I have tried a handful of techniques such as different filters, One class ML classifiers. image subtraction etc. The problem seems to be the orange-peel kind of textural noise in the image (present even in perfectly painted ones). Any idea how to go about finding the defected brush strokes and highlighting them? Pictures attached for reference


texts: Control design: under what conditions can closed-loop poles be placed arbitrarily?

texts:
Say we have a single-input linear system $\dot{\mathbf{x}} = A\mathbf{x}+Bu$. With full-state feedback ($u=-G\mathbf{x}$), it is straightforward to arbitrarily place the $n$ closed-loop poles (i.e., the eigenvalues of $A-BG$, or the roots of $sI-(A-BG))^{-1}=0$) by selecting the values of $G$.

I'll give a brief example:  $\dot{\mathbf{x}}= \begin{bmatrix}0&1\\-a&-b\end{bmatrix}\mathbf{x} + \begin{bmatrix}0\\1\end{bmatrix}u$.

Say we want the poles of the closed-loop system to be at $-1$, i.e., we want the characteristic equation to be $s^2 + 2s + 1 = 0$. We can achieve this by choosing $u = \begin{bmatrix}a+1&b+2\end{bmatrix}\mathbf{x}$.

As long as the system is controllable, the plant dynamics don't matter -- with full state feedback, we can always cancel them and place the closed-loop poles arbitrarily.

However, I don't fully understand why we aren't able to arbitrarily place the closed-loop poles in the classical transfer function/block diagram approach. Consider a unity feedback system with control transfer function $G_c(s)$ and plant transfer function $G_p(s)$.

The closed-loop transfer function from reference to output is

$$\frac{Y(s)}{R(s)} = T(s) = \frac{G_c(s)G_p(s)}{1+G_c(s)G_p(s)}$$

It seems like I can always pick a $G_c(s)$ to give me the desired closed-loop transfer function $T_d(s)$, i.e., by rearranging the above equation to solve for $G_c$:

$$G_c(s) \stackrel{?}{=} \frac{T_d(s)}{1-T_d(s)}\cdot\frac{1}{G_p(s)}$$

This seems like the Laplace domain analog of the state-space approach I described above. So why don't we do this? I can imagine several reasons this might go wrong:

Perhaps this approach always gives the desired response from reference to output, but gives undesirable disturbance or noise responses due to pole-zero cancellations between the controller and plant.
Perhaps the resulting control transfer function can't be implemented physically? Say the resulting $G_c(s)$ is improper - does that mean it is "unrealizable"? Would this imply that it can't be implemented?

Are there other reasons we don't use this approach?

--

Update. I've applied the proposed transfer function approach to the state-space system I described above. The plant transfer function is
$$G_p(s)= \frac{1}{s^2+bs+a}$$
My desired closed-loop transfer function is $T(s) = 1/(s+1)^2$ to place the poles at $-1$. So my required controller transfer function would be

$$G_c(s) = \frac{T_d(s)}{1-T_d(s)}\cdot\frac{1}{G_p(s)} = \frac{s^2+bs+a}{s(s+2)}$$

so I'm effectively just using the controller to cancel the plant poles in $GcGp(s)$. This makes me think that perhaps disturbance response or noise rejection would be a limitation with this design. However, I am still missing an insight into why this is a problem using the transfer function approach but not the state-space approach.

edit: added bounty.


texts: Relation between two k-spaces phase-frequency and spatial frequencies in

texts:
When I see MRI explained, two types of 2D k-space images seem to be described as if they were the same.

Axes are the two spatial frequencies. This images is directly fourier-transformed into the final image.
Axes are phase and frequency (temporal, I assume). The data read through the RF coil is put directly into this matrix.

What is the relation between 1 and 2? Are they the same?

Example with spatial frequencies:

Example with phase and frequency, which seems to be the "raw data":

"k-phase" and "k-readout", which I think is identical to phase and frequency.


texts: Application of the spherical Radon transform property in tomography

texts:
Let function $f$ be even and continuous on the unit sphere $S^n$. Let $R$-be a spherical Radon transform.
There is a known property:
$R(f^n)=f$ whenever $f$=constant.
What would this property mean in the tomograph?


texts: Help in analytical expression of BER for M-QAM

texts:
I am new in learning deriving BER expression. I am familiar for the case of BPSK in AWGN but cannot understand how the BER expression in Eq(12) in this paper, An Enhanced Spectral Efficiency Chaos-Based Symbolic Dynamics Transceiver Design
download link

comes. http://www.raymaps.com/index.php/theoretical-ber-of-m-qam-in-rayleigh-fading/

tutorial presents the BER expression for M-QAM in AWGN.

Do you have any reference on how to analytically derive the BER for QAM and Rayleigh in AWGN for this case? How can I derive?


texts:
I am trying to program this function: $ g(t)= \operatorname{rect}(t/T) \,f(t)$

I take: $t=0:1:20$ and I know how to program $f(t)$.

But I have a problem with the rectangular function. How to program this function in matlab?


texts: Confusion regarding model order and lags

texts:
I have similar questions as the one asked in these posts: https://stackoverflow.com/questions/47083890/fir-filter-length-is-the-intercept-included-as-a-coefficient-matlab/47085339?noredirect=1#comment81124362_47085339
and Terminologies - lags, order in time series model

But the answer is quite different from the one in books and other online resources such as this tutorial: https://onlinecourses.science.psu.edu/stat510/node/47

If the time series model is of order 2, then according to the answers to the earlier question, there should be 3 coefficients. But, the tutorial link says differently. In the link an AR(1) model has 1 coefficient.

In a research article titled, "X. Xu and J. Guo, "A Fast System Identification Method Based on Minimum Phase Space Volume," 2012 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery, Sanya, 2012, pp. 523-526." the Authors have doen system identification of AR(2) model. There they have used 2 coefficients to express the model.

Based on my understanding, the number of coefficients that a system has is known as the length, $L$ and the order is $q=L-1$.

I want help to confirm what is the correct representation and terminology. In general for AR and MA models,

Confusion 1) For an AR(1) system of order $q=1$, should there be 2 coefficients or 1 coefficient? Same thing for MA(1)

According to the online course link for AR(1), there is only 1 coefficient.

Confusion 2) What is correct? Considering an AR(2) model having coefficients [a1,a2,a3] then can I express the model as: x[t] = a1*x[t] + a2*x[t-1] + a3*x[t-2]+ e[t] and for MA(2) of order 2 as x[t] = a1*e[t] + a2*e[t-1] + a3*e[t-2]

where e[t] is the excitation input driving signal.

What is the correct method? Please help, I am extremely confused.


texts:
I'm trying to merge 2 identical audio files. The Audio file is nothing more than white noise generated using MATLAB commands

block_len = 4096;
Y = wgn(block_len, 1, 5, 120, 'dBm', 'real');

Rather than generating a longer block of data, i would like to make a longer file by concatenating the block of 4096 samples.

Therefore I tried a simple,

datat = [Y;Y;Y;Y;Y];
soundsc(datat)

The output file is not smooth enough. There is an audible periodic pattern that indicates the multiple 'Y' segments. I believed this could be due to the imperfect combination at the beginning and End of each Y segment.

Therefore I added the lines

Y(1) = 0;
Y(end) = 0;

Concatenating after these still does not have a smoothness to it. I searched on stackoverflow and found this link.

I tried the code based on the link above. I still can't get a smoothness to the white noise. What other methods can i try to make the sound as smooth as possible?


texts: Derive chernoff bound for $\mathrm{erfc}(x)$

texts:
I'm trying to derive the Chernoff bound $\mathrm{erfc}(x) \le \exp(-x^2)$, by first showing:

$$\mathrm{erfc}(x) = \frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\exp\left(-\frac{x^2}{\cos^2\theta}\right)d\theta$$

This equality should be derived by considering 2 independent, standard gaussian random variables $x_1, x_2$ and the region in the $x_1x_2$-plane where $|x_1|\le x$.

What I have so far, is come up with a diagram like this:

where I consider the the probability where $x_1, x_2$ falls in the square (4 $\times$ "blue square"). Then

\begin{align}
P(x_1<x,x_2<x) &= P(x_1<x)P(x_2<x)\\
&=\frac{1}{2\pi}\int_{0}^{x}\int_{0}^{x}e^{-\frac{x_1^2+x_2^2}{2}}dx_1dx_2\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{x}{\cos\theta}}e^{-\frac{r^2}{2}}rdrd\theta\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{x^2}{2\cos^2\theta}}e^{-v}dvd\theta\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}-e^{-v}\Big|_0^{\frac{x^2}{2\cos^2\theta}}d\theta\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}1-e^{-\frac{x^2}{2\cos^2\theta}}d\theta\\
&=\frac{1}{4} - \frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{x^2}{2\cos^2\theta}}d\theta
\end{align}
This is the probability for the blue square, so for the entire square, I have:
\begin{align}
4P(x_1<x,x_2<x)&=1-\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{x^2}{2\cos^2\theta}}d\theta
\end{align}
The probability of falling outside the square is:
$$1-\Big[1-\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{x^2}{2\cos^2\theta}}d\theta\Big] = \frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{x^2}{2\cos^2\theta}}d\theta$$

I'm kind of stuck here. I think this is my $[Q(x)]^2$, but according to this paper (Eq 9), my $Q(x)$ is incorrect. How can I derive the $Q$-function in the paper using this gaussian RV derivation method?

ETA: As per Dilip Sarwate's suggestion, I considered the circle that circumscribes the squares, and I got the following by considering just 1 (upper-right) quadrant.

\begin{align}
P(\text{in the circle quadrant}) &= \frac{1}{2\pi}\int_{0}^{\sqrt{2}x}\int_{0}^{\sqrt{2x^2-x_2^2}}e^{-\frac{x_1^2+x_2^2}{2}}dx_1dx_2\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}\int_{0}^{\sqrt{2}x}e^{-\frac{r^2}{2}}rdrd\theta\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}\int_{0}^{x^2}e^{-v}dvd\theta\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}-e^{-v}\Big|_0^{x^2}d\theta\\
&=\frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}1-e^{-x^2}d\theta\\
&=\frac{1}{4}-\frac{1}{4}e^{-x^2}
\end{align}

\begin{align}
\text{P(in the blue square)} &< \text{P(in the circle quadrant)}\\
\frac{1}{4} - \frac{1}{2\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{x^2}{2\cos^2\theta}}d\theta &< \frac{1}{4}-\frac{1}{4}e^{-x^2}\\
\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{x^2}{2\cos^2\theta}}d\theta &> e^{-x^2}
\end{align}
Let $v = \frac{x}{\sqrt{2}}$

\begin{align}
\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}e^{-\frac{v^2}{cos^2\theta}}d\theta &> e^{-2v^2}
\end{align}
I still don't quite understand how my lefthand expression became erfc(v), since it was calculated from $P(x_1<x,x_2<x)$, and how to eventually get $\mathrm{erfc}(x) \le \exp(-x^2)$.


texts:
This was a question on one of my past year paper questions.

  Question:  Prove

  $$f(m,n)*g(m-r,n-s) = f(m-r,n-s) *g(m,n)$$

  where $f(m,n)$ and $g(m,n)$ are 2-D discrete functions, $r$ and $s$
  are integers and $*$ is the 2-D convolution operator.

Not sure how to start on this and need some guidance on it.


texts:
How can I test if $y[n] = n x[n]$ is an LTI system? And any other system for that matter?

For example, how come $y[n] = \left( \frac{1}{2} \right)^n u[n]$, where $u[n]$ is the unit step, is an LTI system?


texts:
As a part of a math essay, I am writing a program that detects intersections of a line that is drawn with a shape that is inputted.

For example, in the shape below, The polygon is the input image of a given size. The ray has been drawn onto the polygon starting from within the polygon. How can I detect the number of times the ray crosses the boundary of the polygon.

Also, the polygon is always a closed polygon.

A thought that originally came to my mind was to fill the polygon with the same colour as the border (black). And then count the number of times a ray would meet black followed by white.

My problem with this method is that I don't really know how to trace along a line and check each point and I'm guessing that it would be an extremely expensive process to continuously check along the line.

I'm using Processing 3 right now but I'm okay to use any other software/platform except MatLab because I don't have access to it right now.


texts: Multiply a measured quantity of a control-system in the frequency domain during continious operation

texts:
Currently I am working on a feed-forward control system to actively control vibrations. For that purpose I need to measure accelerations on a vibrating structure and use a transfer function in the frequency domain to calculate a force which should be applied back to the structure.
As the measured acceleration trace is in the time domain I need to perform a fourier transformation, multiply my signal in the frequency domain and do an inverse fourier transform to get back to the time domain to apply the force on the structure using a shaker device.

The whole process looks somewhat like this:

As this whole signal chain should work continously I am unsure how to handle the FFTs? I need a certain signal length in order to perform a fft. So I need to cut my continious signal into chunks and do the ffts of them. Is it usefull to use overlaps with those chunks and how do I determine a suitable FFT length?

Of course I want to get a continious signal at the output. So I need to somehow smooth the cutting points between the chunks after the idft.

So basicaly I know about the individual parts of this process chain, but I have never done such a chain in total and so I am somewhat lost on how to deal with the delay and the stepping I get due to the fft.

Edit:

I think the solution has something to do with the overlap-add method that is talked about in this question:
https://stackoverflow.com/questions/5117839/understanding-overlap-and-add-for-filtering?noredirect=1&lq=1
https://en.wikipedia.org/wiki/Overlap%E2%80%93add_method


texts: Upsampling and Downsampling using IFFT and FFT (DFT Based Resampling)

texts: Assume in OFDM , there are N=64 subcarriers. I would like to upsample my signal by Factor 8 after IFFT and pass it through channel then downsample it by factor 8 before FFT. I can use upsample, downsample and interpolating functions. However I was told that there is an alternate to use (8*64) point IFFT and (8*64) points FFT. I used to think that since my symbol size is originally N then I can zeros at the end of my signal (64*8-64) that its length is 512 then I can apply IFFT and FFT correctly and take the first 64 samples and discard the rest. However after reading different post here (like this) enter link description here about adding zeros between samples or re-scaling the signal to get the correct result. I am wondering if anyone can explain to me about right way of upsampling and downsamping my signal using IFFT and FFT and also the reason for that. In different posts here people mention to add zeros between samples but they never said why.


texts: removing noise using Scipy.signal.butter:

texts:
I am going to remove the noise from a brain recorded signal. It was a continuous recording and with sample rate=30kHz, it was digitized. So now it is a digital signal.
I have written the code here for denoising this signal and I put two figures (the red one is the denoised one) including one big picture figure and the second one is by using zoom in. Below is the code.

  wn=0.01
  n=4 #order
  b, a= signal.butter(n, wn, btype='low', analog=False, output='ba')
  filtered = signal.lfilter(b, a, data_raw)
  plt.plot(data_raw, 'b', filtered,'r')
  plt.show()

Now I have several questions please (sorry if they are easy as I am a beginner):

1) Here we only determined the normalized frequency (wn). So if I want to know the low frequency of the filter, what is the default amount of sampling frequency for the Signal.butter function, please?

2) If I want to determine the sampling frequency of the butter filter by my self, is it the same sampling frequency as the data was digitized with? I mean the 30 kHz? If not what is the amount for this frequency, please? How should I determine it?

3) Do you have any other recommendations to filter this signal better and with less noise? Thanks a lot


texts: "Noise Spectral Density" a.k.a "Power Spectral Density" in datasheets

texts:
In the case of statistics, there are two terms: "Variance" and "Standard Deviation" to - for in the latter case - have one to note the case in which the units are without squares.

Am I correct to understand, that there is no such differentiation in signal processing, and in both cases - taken root or not - it's always termed "Power Spectral Density"?

I am asking as on page 3 of Analog Devices AD8307 there's the unit of $\frac{nV}{\sqrt{Hz}}$ for the "Input Noise Spectral Density".

Is there a specific reason as to why manufacturers are taking the square-root?


texts: Can I construct a linear system so that it results in a moving average?

texts:
I've just learned about linear systems and impulse response functions. I know that in a linear system consisting of $h_1[k]$ and $h_2[k]$, the impulse response of the system is $h_1[k] \ast h_2[k]$.

In an exercise I was given the following system responses:

\begin{align*}
h_1(0) &= a \\
h_1(1) &= b \\
h_2(0) &= c \\
h_2(1) &= d \\
h_1(n) = h_2(n) &= 0 \; \text{otherwise} \\
\end{align*}

The question was whether it would be possible to construct the parameters $a$, $b$, $c$, and $d$ in such a way that the linear system $h_1 \ast h_2$ would result in a moving average of the order 3 being applied to the input.

Well, I started with the convolution $h[k] = h_1[k] \ast h_2[k]$ for $k = 0, 1$:

\begin{equation}
h[k] = [ac, bc + ad, bd]
\end{equation}

I understand that for a moving average of order 3, the required convolution kernel would look like this:

\begin{equation}
[1/3, 1/3, 1/3]
\end{equation}

But that means I have to solve the following equation:

\begin{align*}
ac &= 1/3 \\
bc + ad &= 1/3 \\
bd &= 1/3 \\
\end{align*}

And that's where I'm stuck. From my guts I'd say it's not possible to get to an answer here, because even if $a = 1$ and $b = 1$, $c$ and $d$ would have to be $1/3$ and $c + d$ would have to be $1/3$ as well. Which isn't solvable.


texts: Inverse $\mathcal Z$-transform of system with an 8th order pole

texts:
Can I find the inverse $\mathcal Z$-transform of this transfer function: $$H(z)=\frac{1}{1-\alpha z^{-8}}$$
in a way other than contour integration and finding the residues of the 8 poles?
If so, how?


texts: variance of the product of two samples with awgn

texts: problem solved itself, sorry for your inconvenience. I'll try to post better questions next time.


texts:
What is the difference between frame error rate (FER) and symbol error rate (SER)?
I know the difference between frame error rate (FER) and bit error rate (BER) from the website below

https://www.quora.com/What-is-the-difference-between-frame-error-rate-FER-and-bit-error-rate-BER-in-LDPC-codes

In this website,it said

Bit is the unit that data transmit in the physical line. Frame is consist of many bits.
A unit frame has more information than a unit bit.

However,the symbol consist of many bits too. e.g.symbol "0" = 000,symbol "7"=111,they all consist of three bits,so what is the difference between frame error rate (FER) and symbol error rate (SER)?


texts: When and why do we need to perform Fourier transform before calculating the phase of the image?


texts: Determine proper coefficients for the transfer function

texts:
The problem says that we have the information (actually a .mat file that contains the data) of 1 pixel from an IR camera from an object with 26° of temperature. Because of the noise, the output is given by

$$
y[n]=26+N[n]
$$
where $N[n]$ represents the noise. For that, I'm supposed to implement the following filter:
$$
H[z]=\frac{b}{1-az^{-1}}
$$
where $ a\in (0,1)$ and $b\in \mathbb{R}$. The directions say "fix a value for $a$ then find a proper value for $b$ such that you get the known value of temperature". I'm working on Matlab and it seems the best values are $a=b=0.5$ (just by inspection by looking the graphs after the filter). How can I exactly determine a good value for $b$?


texts: BER performance of a space-time code over Rayleigh channel model

texts:
For a given space-time code, and in general terms, how would one proceed in the evaluation of the BER performance of this code ?

In order to be more clear, say i have 16 code matrices(who's elements belong to QPSK modulation) of size 2x2 that could be sent over a Rayleigh flat fading channel by a  MIMO system with 2 transmit antennas and 2 receive antennas.
How would one proceed in the evaluation of the BER of such system ?

Thank you!


texts: How are signal bandwidth and MSPS related?

texts:
In various software defined radios, there are three important parameters to set when receiving: frequency, bandwidth and MSPS (million samples per second?). What does it mean to receive with a triple of parameters $(freq, b, s)$ (freq-frequency, b-bandwidth, s-MSPS)? Radio listens to frequencies in $[f-b/2,f+b/2]$ range, divides this range into $s$ chunks and transmits the sampled data to the PC?

How to calculate $s$ for a given $b$, to avoid aliasing?

Am I right that MSPS has nothing to do with the Nyquist theorem?


texts: What is the cross-correlation of a WSS signal and the LTI filtered signal?

texts:
I remember a result about the cross-correlation function of a stationary signal and that same signal, filtered through a linear time-invariant filter. There might have been an assumption that the signal was Gaussian. What is the cross-correlation function?

$$E\left\{ x(t) y(t) \right\} = \,\,\,?$$

where $y(t)$ is the output of an LTI filter with the input $x(t)$.


texts: $x[n]$ after sampling of $cos(16\pi t+\phi)$ at 12kHz

texts:
I'm not sure what the question really means, so this is just guesswork.

I think options 1 and 4 can be ruled out as $w_0<\pi$.

The CTFT of $cos(16\pi t+\phi)$ has two spikes at $16\pi$ and $-16\pi$. I guess that the question means that we sampled this spectrum at $12Hz$, (because 12kHz doesn't make sense to me, might be a typo in the question), i.e. at $24\pi$.

So we get one copy of $-16\pi$ at $-16\pi+24\pi=8\pi$. Similarly we get a copy of $16\pi$ at $-8\pi$.

Now we normalize to the $w$ by diving by $12$. Only the frequencies $-8\pi$ and $8\pi$ get mapped in the range $-\pi$ yo $\pi$ as required by the question. These frequencies get mapped at $-\frac{2}{3}\pi$ and $\frac{2}{3}\pi$. But the problem is that they also get scaled by $12Hz$ during sampling (and I'm ignoring that to get to one of the options). So the $x[n]$ corresponding to $\frac{2}{3}\pi$ and $frac{2}{3}\pi$ is $cos(\frac{2}{3}\pi n+\phi)$

Is this correct?


texts:
I'm wanting to do an inverse Fourier transform.
Can I use the Welch method to generate this inverse, by replacing the FT used within with an IFT?


texts:
I know the two properties of convolution that are related to my question

$\quad x(t)*\delta(t)=x(t) $
$\quad x(t)*\delta(t-t_0)=x(t-t_0)$

But my question is, how can I use those two to calculate $$ y(t)=x(5t)*\delta(t-5) $$


texts: How can I graph a simulation of a FM 16 bits codification?

texts:
I have to develop a software where the user inputs a 16 bits binary sequence, which is supposed to be the codification of a FM (or even AM) signal, then I should graph it according to Frequence / Time ....

What procedure I should take to treat such input?


texts: Generating a time domain signal using the fundamental frequencies

texts: I currently have the power spectrum (in dB) of a signal through which I obtained the fundamental frequencies and amplitudes. My question is: how to generate a time domain signal using these amplitudes and frequencies (using C++ for example)?


texts: Determining signal using Optimal receiver(Matched filter)

texts:
I'm given a signal that has been passed through a noisy channel using binary polar signaling with a pulse value of p(t) = 1. The receiver is coherent and the length of each pulse (in samples) is 10 samples. I'm given:

the pulse signal used to represent the symbol/bit '1' = [3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623]
the number of samples taken from each symbol = 10
the number of symbols, i.e., bits, sent in the signal (there are 8-bits per character) = 248
the variance of the noise in the AWGN channel = 28
the mean of the noise in the AWGN channel = 0
the energy of the p_sampled signal = 100

Using this information I need to find the values of the received symbols using an optimal receiver or a matched filter.

I implemented the correlation receiver realization of this in MATLAB:

So for my example, I've chosen T0 = 10 and since polar signalizing is used, I threshold the sampled signal as m = 1 if y(T0) > 0 else m = 0

This is my code:

 p_of_t = [3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623]

for idx = 1:numSymbols % for each symbol transmitted

    r_of_t = x_of_t(tmp+1 : idx*samplesPerSymbol); % 10 samples of the received noise + message
    y_of_t_at_tm(idx) = sum(r_of_t .* p_of_t);

    if(y_of_t_at_tm(idx) > 0)
        decision(idx) = 1;
    else
        decision(idx) = 0;
    end

    tmp = idx*samplesPerSymbol;
end

I have two questions:

Will the Optimal filter decode ALL the bits from the received signal, correctly?
Is my implementation of the filter correct?

The reason I ask is that when I try to verify my implementation by generating my own polar signal for a message and using the above implementation as a receiver and decode the sampled bits, I do not get the original message back. There is an error of one bit.

I will appreciate any leads. Thank you.


texts: azimuth extent for range migration algorithm

texts:
Is it true that in the Range Migration Algorithm for synthetic aperture radar, the azimuth extent can be said to span the length of the flight path?

This makes sense but also does not make sense. Because what if the scene being imaged is 1 km, then won't the flight have to travel a ridiculously long extent?

Illustration:

So in the final step of the RMA, an inverse FFT is taken on a phase that has the form (after stolt interpolation):
$ \phi(K_X, K_R) = -K_XX_t + K_Y(R_B-R_S)$

Where:

$K_X = azimuth\ spatial\ frequency\  \epsilon\ [\frac{-\pi}{\Delta X}, \frac{\pi}{\Delta X}] $

$K_Y = ground\ range\ direction\ frequency\ $

$X_t = scatterer\ azimuth\ location$

$R_B - R_S = scatterer\ ground\ range\ displacement$

After this step, my question is what the span of $X_t$ would be. i.e. how to calculate the azimuth axes.


texts: Phase difference betwen 2 signals, 1 signal with unknown function

texts:
I understand this question may have been addressed however I have a major difference.

I started out with a sinusoid of form A*sin(2 pi freq t + phase) and I know all the components, this represents a force a system and produces a response that has a delay and that is periodic in a way, no fully sinusoidal though (I can post pics and any relevant material).

Thus for the response signal I know the frequency and the time vector, I need to find the amplitude and the phase. I have been using FFT but I am not sure if that is the best way.
Can someone please help me out here, this seems fairly simple, however I am struggling,
Thank you

PS: I can post/email anything that is relevant, please do ask.


texts:
I am watching a lecture on mean shift clustering. In the video, the mean shift vector is first defined and then it's relation to the gradient of a kernel density estimate is shown. The mean shift vector is defined as $$M_h(y) = [\frac{1}{n_x}\sum_{i=1}^{n_x}x_i] - y_0$$ where $n_x$ are the points around the region of interest and $x_i$ are the datapoints. $y_0$ is the initial estimate of the mean and $M_h(y)$ is the shift vector that moves $y_0$ in the direction of higher probability density.
The mean shift vector that is derived from taking the gradient of density estimate is $$M_h(y) = [\frac{\sum_{i=1}^n x_ig_i}{\sum_{i=1}^ng_i} - x]$$ where $g_i$ is the gradient of the kernel function for data point $x_i$
In this case, $n$ represents the total number of points in the data, but $n_x$ represents the number of points in the region of interest. How do we reconcile this difference ?


texts: I am still a not how PCA can be used in image analysis and where is it is mostly used.  For example how can PCA be used in order to differentiate between different faces? Can you please mention other uses it has?


texts: Finding number of alternations in parks mcclellan

texts:
I'm given this question and asked to find number of alternations for filter 1 and 2, using parks mcclellan algorithm.

I search for solution and find this answer :

My question is why the number of filter taps are 9 in the solution, and how exactly to use parks mcclellan to resolve number of alternations for filter 1 and 2 ?


texts: How to efficiently calculate points of intersection of a straight line and a contour?

texts:
Ex.
I have an image, let's say 100x100 pixels with some shape on it. And a set of straight lines that are passing through origin located at some point of image, for example origin located at point (50, 50). Number of lines determined by step - angle. If step = 15 degrees, then we have 180 / 15 lines. I want to determine points of interesection in efficient way, but all that I came up for now is printing a line on matrix and check for non-zero elements if they overlap non-zero elements of a shape(and check for diagonal connectivity).


texts: Struggling to implement this simple algorithm for ECG wave delineation

texts:
I'm trying my best but my maths isn't good enough to implement the algorithm as outlined in this paper in python. It for detecting the onset and offset of a wave on an ECG, and it's using a well validated method.

My data is in a numpy array.

The steps it uses are:

A. Computation of the envelope of the ECG

B. Computation of the auxiliary signal

C. Windowing

I think I've got step A. done:

def calculate_qrs_envelope(self):
    self.hilbert = np.imag(hilbert(self.lead_data['y']))
    self.envelope = np.sqrt(np.add(self.lead_data['y'],self.hilbert))
    self.plot(x=self.lead_data['x'], y=self.envelope, pen='b')

Where my data is stored in lead_data['y'].

If I plot it, it looks correct (I can't show the picture here as I don't have enough karma).

And I'm confident that I won't struggle with C.

However, B is difficult. It says in the paper:

I can calculate AS using a simple derivative, as so:

def calculate_auxiliary_signal(self):
    self.aux_sig = np.append([0],np.multiply(2,pow(np.diff(self.envelope),2)))
    self.plot(x=self.lead_data['x'], y=self.aux_sig, pen='g')

But I don't understand how to do it with regards to what it says about the parabolic fit.

My sampling frequency is 100 Hz.

Would anyone be able to give me a hand with this maths? It would be a great help.


texts:
I am having a LM35 sensor which gives $10\textrm{ mV}$ signal per degree rise of temperature. Now I have one question, which digital filter will be the best for this ?

This sensor will be use in very noisy industrial environment. Also digital filter have some cutoff frequency what should be the cutoff frequency set for this filter ? As signal coming from sensor is an analog signal but not a periodic frequency signal.

One I know is FIR Moving average filer. This takes the mean of previous samples. This I do not want to use as I have used it before,
$$
\frac 1N\sum_{n=0}^{N-1}x[k-n]
$$

If I am right then DFT is not required as I am not interested in the spectrum analysis of the signal coming from LM35 sensor.

Is there any other DSP digital filter which I can use ?


texts: Convolution and Cross Correlation Blackbox

texts:
Suppose I was handed a blackbox that I know is either a Convolution filter or Cross-Correlation filter, and my job is to find out which it is.
My idea is to pretend that it's Cross-Correlation and attempt to do Template Matching using an image and a crop of the same image. If the output has a peak where a successful template match would be, it's Cross-Correlation. Otherwise, it's Convolution.
Is this a reliable test? Is it possible to also arrive at the same expected output if the blackbox was actually Convolution?


texts: Very simple question about signal periodicity

texts:
$$x[n] = u[n]+u[-n]$$

Is it periodic or not? My answer is

$$u[n] = {1       , n\geqslant0}$$
$$u[-n] = {1      , n\leqslant0}$$

which means that the signal $x[n]$ is always equal to $1$ from $-\infty$ to $+\infty$, but it equals $2$ at $n=0$. Am I right?


texts: Obtaining an IR from a sine sweep without the dry sweep

texts:
I have a test vinyl record that includes an exponential sine sweep as one of the tracks. I have a recording of the sweep through my turntable/mixer, and now I want to calculate the system IR. The problem is I don't have a copy of the clean sweep signal. What's the best way to approach this?
My first thought is to take a best guess at the sweep start and end frequencies and the $\Delta t$ between them, then use that to figure out the sweep rate and manually reconstruct the original sweep. But this seems kind of clumsy, is there a better way?


texts:
I'm studying a mathematical behaviour of a servo motor and I need some help to understand it.

The output signal is $\beta(t)$, representing the angle rotated by the axis at instant t, in relation to the equilibrium position.
On the servomotor there are two torques:

the first torque is produced by the electric current $i(t)$ that does through the motor. It is proportional to the electric current being given by $Ki(t)$.
the other torque is given by friction and is given by $-2 \beta'(t)$ where $\beta'(t)$ is the derivative of $\beta(t)$, meaning it represents the angular velocity.

The feedback control system is given by:

Where Motor represents the differential equation
$ 4\beta''(t)=100i(t) - 2 \beta'(t) $

And $\alpha(t)$ is the input angle that give the desired position (angle) for the servomotor.

$B$ is unknown but we will assume $A = -1$ so that if the input is constant we'll have the output equal to the input (unitary static gain).

The transfer function of the system is:

$$H(s)= \frac{100}{4s^2+(2-100B)s-100A}$$

By this expression we conclude that our system is a second order system with no zeros.
By controlling the value of $B$ we will control where the poles are in our system and by that the type of system we get. More specifically:

If $B<-0.38$ we have two real poles (and an overdamped system)
If $B=-0.38$ we have o double pole (critically damped system)
If $-0.38<B<0.02$ we have two complex conjugated poles (underdamped system).

So until this I don't have questions and everything makes sense to me.
The next affirmation is what leaves me doubtful:

By controlling the value of $B$ we are controlling the friction of the system.

No more explanation is given to this and I'm kinda worried if my interpretation of this fact is correct or not. Here it goes:

We have a 2nd order system without zeros. By controlling $B$ we will control the type of poles our system will have. For low values (in module) of $B$ we have an underdamped system. For $B=-0.38$ the system is critically damped. For $B<-0.38$ (meaning, large absolute values of $B$) the system will be overdamped. The system damping is related to the existence of friction in the motor. For low absolute values we will have little friction and so the system will oscillate a lot until it reaches its final value. As we increase $B$, we will increase friction which will oppose to the natural oscillatory tendency of the system, making it monotonous until it reaches its final values. We have to be careful however because as we increase the friction the system will also take more time to reach the value (it has to "beat" the friction).

Is this interpretation correct? I'm not sure if this is the correct relationship between friction and the type of system I get? I'm also curious if there is any more implication or consequence of this relationship. Can anyone clarify me please?

Thanks!


texts: Trying to compare two speech samples that have been recorded by smartphones in pockets

texts:
I'm trying to compare two audio samples of speech from two different Android smartphones to determine if the people are co-located. I'm doing this using the frequency bins of an FFT between 300 Hz - 3400 Hz. When the two devices are sitting on a table, I have good results.

However, when the devices are placed within pockets, the audio is recorded differently than when they are placed on a table.

Does anyone know exactly what happens to the audio frequencies/signal when the microphones are covered by a pocket or a bag? Are certain frequencies filtered?


texts: Is there an algorithm for finding a frequency without DFT or FFT?

texts:
I was looking in the Android app store for a guitar tuner. I found a tuner app that claimed it was faster than other apps. It claimed it could find the frequency without using the DFT (I wish I still had the URL to this specification).

I have never heard of this. Can you acquire an audio signal and compute the frequency without using the DFT or FFT algorithm?


texts: Indices in 2D Convolution Operations - Handle Out of Bounds Indices


texts: Orthogonal signals in frequency and time domains

texts:
I have 3 orthogonal signals obtained by Fourier transformation. But when I do the inverse Fourier transform in Matlab, my signals are no longer orthogonal in the time domain.

Here is my question:

How to keep the orthogonality of signals in the time domain?


texts: Correction of signal after High-pass RC-filter

texts:
I have one question about digital correction of signal after RC filter which is high-pass.

Let me explain detail.

I have one simple signal conditioner. It has RC filter on the signal input with cut-off frequency equals 1.3 Hz. It means that after this RC filter my signal has lower amplitude from 1.3 Hz to approximately 15 Hz. After ADC I get this signal on my computer in digital form. After that I use Fourier transform.

Unfortunately, I need correct amplitude information in range 2-20Hz. So I need correct amplitude of signal in that range by digital transformations.

Can I do this? Is it normal practice?


texts: Obtaining camera matrix for estimating shape of moving object

texts:
I have an object that is moving parallel to a stationary camera. I would like to use Structure from Motion or Shape from Silhouette to obtain the 3D points of the object.

For that, I need to obtain the camera matrix P = K [R | t]. I know that I can calculate the intrinsic matrix K using the checkerboard technique. But how do I know the rotation and translation of the camera?

I know that the object is moving in a constant speed. Exactly 10cm per second. And I am taking one frame per second. Does that relate to the camera moving 10cm? That would mean that the x value of the translation vector t is incremented by 10 for each image. The second image would therefore have the translation vector (10 0 0)
As the camera is stationary and the object moves parallel to the camera I am guessing that the rotation matrix is the identity I for each image.

Is my thinking correct?


texts: Cross-correlation of filtered random processes

texts:
I have a wide-sense-stationary (WSS) process $\{x(t)\}$ and two linear filters with impulse functions $h_1$ and $h_2$.

Let $\delta(\omega)$ be the power spectrum of $\{x(t)\}$ and $$H_1:\omega\mapsto H_1(\omega)$$ and $$H_2:\omega\mapsto H_2(\omega)$$ the transfer functions of the filters.
The outputs of the filters are denoted $$y_1(t)=(x \star h_1)(t)$$ and $$y_2(t)=(x \star h_2)(t),$$ where $\star$ denotes the convolution.

How can we compute the correlation of $\{y_1(t)\}$ and $\{y_2(t)\}$ and when are these two random variable uncorrelated?


texts: Mathematical description of the ACF using fft2

texts:
I computed the acf of an image with the following code:

%# read in image
Img = imread('myImage.tif');

% get size of image
[N, M] = size(Img);

%# convert to double
I = double(Img);

%# subtract mean
I = I-mean(I(:));

%# normalize magnitude
I = I/sqrt(sum(I(:).^2));

%# compute acf
fft_I = fft2(I);
Acf = real(fftshift(ifft2(fft_I.*conj(fft_I))));

Now, i have to mathematically describe the procedure, and I am thinking that the FFT equation given in https://uk.mathworks.com/help/matlab/ref/fft2.html (scroll to the bottom) isn't enough?

Can someone please help me out here. Many thanks.

EDIT:
Please find the added mathematical description i have come up with and kindly help me verify its correctness.


texts: How to Fourier Transform (basic understanding)

texts:
I need to fourier transform my light curve (2nd image) into something which looks like the first graph of the first image. I have very little idea about how to actually do this and I only understand the very basics about fourier transforms (the idea, not the mathematics).

T = 1460 #days
z = fft(y)
f = 1/T
plot(f,y)

This is my code attempt so far, but I just get a graph with straight lines or nothing at all. If you could help me with this, it would be fantastic :)

The x axis of my light curve is measured in Julian days and the y axis in flux. When I fourier, I want the x axis to be in micro hertz.

Thank you :)


texts:
Hi guys, I've been reading some papers on - how to remove ghosting artefacts from the Fourier Slice theorem applied to a 3D discrete image volume. The papers mention that in order to remove ghosting artefacts "employ a better(and typically wider) interpolation filter".

Currently, in Matlab I fft a 3D image space volume to Fourier space. I then extract a 2D plane at an arbitrary angle from this 3D frequency domain volume, making sure that my 2D plane passes through the centre of the volume. Since, this 2D plane is at an angle (not all points on the plane correspond to the uniform discrete values in the volume), I the use interpolation on the 3D volume in Fourier space, which I believe uses weighted linear interpolation (8 nearest point average).

What do these papers mean when they say - apply an interpolation filter, is this any different from what I am doing? If it is different, should I be multiplying this interpolation filter with the frequency spectrum and if so what does this filter look like?


texts: Recovering an image using IDCT through DCT coefficients

texts: I have computed the discrete cosine transform (DCT) of an image in MATLAB. I got a matrix of discrete cosine transform coefficients in the workspace. How can I recover the original image from its discrete cosine transform coefficients in MATLAB?


texts: What happens to the standard deviation of a white Gaussian noise after low pass filter?

texts:
If I apply an ideal box-car low pass filter on a random signal with white Gaussian noise, what happens to the Gaussian distribution's $\sigma$?
I know that the auto-correlation function becomes a sinc(), but not sure where to go from here...
Thanks!


texts: I need to manage several line level signals (physically, not in software), and need to know what to expect. I was expecting AC signals, but am not quite sure. Are line level audio signals AC or DC? What Vpp can I expect?


texts:
Let's say I have a sound file, I then compute the Spectrogram and segment each part of it. Assume that it is a recording of someone saying the word "Hello" and therefore, each piece is given like so:

0 -> H
1 -> E
2 -> L
3 -> L
4 -> O

Now I want to calculate the duration of each of the parts/phonemes. Is there a way to do this? I was thinking, because I have the data, is it possible to just count the total number of elements and therefore calculate the time it takes?

Could anyone suggest any reading material that could potentially help me.


texts: Signals Cross Correlation from Their Power Spectral Densities?

texts:
For two real valued signals $f$ and $g$ with their corresponding power spectral densities $|F(k)|^2$ and $|G(k)|^2$ Is there a way to get an intuition of how correlated $f$ and $g$ are just by looking at the power spectral densities (PSDs)?

For example does the fact that the PSDs of these two signals are so similar imply that they are cross correlated?

So far I have considered that $$|F(k)|^2 = F(k) \overline{F(k)}$$  $$|G(k)|^2 = G(k) \overline{G(k)}$$

and the cross correlation we want to find is

$$ F[f \star g] = F(k)\overline{G(k)} = G(-k)\overline{F(-k)}$$

and so it seems that there could be a way to get an exact result for the cross correlation from the PSDs, however I would also be happy just to get a hand wavy  idea of if these two signals are cross correlated


texts: Hilbert Transform of a sine Function with Quadratic Argument $\sin(At^2 + Bt + \pi/4)$

texts:
I am looking for the Hilbert transform of the following function:

\begin{equation}
\mathcal{H}\bigg\{ \sin\Big(At^2 + Bt + \frac{\pi}{4}\Big) \bigg\}
\end{equation}

where $A$ and $B$ are constants with $A<0$ and $B>0$.

It is well known that $\mathcal{H}\{ \sin(Bt) \} = -\cos(Bt)$, which can easily be shown by rewriting the Hilbert transform as a convolution with $1/{\pi t}$ and using the spectral representation as shown hereinafter:

\begin{equation}
\mathcal{H}\{ \sin(Bt) \} = \sin(Bt) *\frac{1}{\pi t}
\end{equation}

where $*$ denotes the convolution operator. Consider the following Fourier pair:

\begin{equation}
\mathcal{F}\left\{\frac{1}{\pi t}\right\} = -\mathrm{j}\,\mathrm{sgn}(\omega)
\end{equation}

With this the problem can be solved in the spectrum as follows:

\begin{equation}
\mathcal{F}\big\{\sin(Bt) *\frac{1}{\pi t}\big\}
= \frac{\pi}{\mathrm{j}} \big(\delta(\omega-B) - \delta(\omega+B)\big) \; \big(-\mathrm{j}\,\mathrm{sgn}(\omega)\big)\\
%
= -\pi\, \big(\delta(\omega-B) + \delta(\omega+B)\big)
\end{equation}

Here, the two Dirac delta pulses are located at $+B$ and $-B$ angular frequency and hence the sign function is directly applied. Therefore, we get

\begin{equation}
\mathcal{H}\{ \sin(Bt) \} = \mathcal{F}^{-1}\Big\{ -\pi\, \big(\delta(\omega-B) + \delta(\omega+B)\big) \Big\} = -\cos(Bt)
\end{equation}

However, the same principle cannot be applied to $x(t) = \sin(At^2 + Bt + \pi/4)$, since its spectral function are two superimposed complex Gaussian functions also shifted to $+B$ and $-B$ angular frequency:

\begin{equation}
\mathcal{F}\{x(t)\} = \frac{\sqrt{-\frac{\pi}{A}}}{2 \mathrm{j}} \bigg(
\exp\Big(-\mathrm{j}\frac{1}{4A}(\omega-B)^2\Big) - \exp\Big(+\mathrm{j}\frac{1}{4A}(\omega+B)^2\Big)
\bigg) \quad \text{if} \quad A<0
\end{equation}

Each complex Gaussian function is defined for all frequencies and hence the application of the sign function does not simplify or solve the problem. I have also tried to directly solve the Hilbert transform integral with no success. I appreciate any help.


texts: Is it interesting to look at two conditions and compare their power spectral density at frequencies?

texts:
so I am doing my thesis in Neuroscience and trying to prove the alpha blockade, i.e. the reduction in power of the alpha frequency band when the eyes are open compared to when they are closed.
I used Matlabs Spectopo (https://sccn.ucsd.edu/~arno/eeglab/auto/spectopo.html) function which is returning a dB value for each frequency, giving me a 257 (1-257 Hz) x 1 (dB) matrix. I then only took 1-30 Hz and compared both conditions using a statistical method called threshold-free cluster enhancement.
The prooooblem is that I do not have much knowledge about signal processing, therefore my question is: Did it even make sense to look at the PSD? Does it make sense to calculate for all Hz and then only look at 1-30 Hz? And does it make sense to use dB instead of microvolts square? Any help is appreciated much.


texts: Two-View 3D reconstruction using the sparse Levenberg–Marquardt algorithm

texts:
I have trouble implementing the Levenberg-Marguardt algorithm as described in the book Multi View Geometry in Computer Vision. To be more specific I have trouble calculating the partial derivatives that are needed in order to pursue with the main algorithm implementation.

Consider having the projection vector in two views $\mathbf{X}=[\mathbf{x},\mathbf{y},\mathbf{x}',\mathbf{y}']$ where the $x,y$ are the projected coordinates in the first view and $\mathbf{x}′,\mathbf{y}′$ are the coordinates in the second view respectively. Also lets say we are given an initial estimated $\mathbf{A}$ Matrix with 12 parameters describing the rotation and the translation of the second view with the respect to the first view and an initial estimation for the point in the 3D coordinates $\mathbf{b}=[\mathbf{X},\mathbf{Y},\mathbf{Z}]$.

How can the matrices $\partial\mathbf{X}/\partial{A}$ and $\partial\mathbf{X}/\partial{b}$ can be calculated ?

PS: I tried searching for numerical differentiation methods but I had hard time understanding them i.e finite difference.


texts: Timing recovery in GNU Radio : Variable rate vs Fixed rate operation

texts:
I have been wondering about the implementation of timing recovery blocks in gnuradio. In literature, for asynchronous sampling, all that is needed are error detector (MM, ML, Gardner etc), a loop filter (2nd order), interpolation control (modulo-1 counter etc) and an interpolator. An example of a timing recovery scheme with ML error detector is shown below.
I have two questions regarding the implementation in GNU Radio

All blocks I have seen (MM, Andy Walls Symbol Sync )seem to be approximating the number of samples per symbol and use it to update the rate of the block in the forecast function. My question is why do we need to use variable rate? Can't a scheme like the one below with fixed rate work? Isn't this supposed to be asynchronous sampling?
Out of curiosity: Can one use a third-order PLL instead? Or will this just be an overkill?

Regards,
M.

EDIT

Interpolation control:

Matlab code


texts: Baseband representation of a LFM chirp signal

texts:
I need to generate a chirp signal between $f_{start} = -f_{limit}$ and $f_{stop} = f_{limit}$, to compare it to a FrFT generated signal.

The FrFT signal of order $\alpha = 0$ is PAM modulated data signal, so is in baseband. Therefore, the FrFT of that same signal, with $\alpha \neq 0$, sweeps between $f_{start} = -f_{limit}$ and $f_{stop} = f_{limit}$.

I was wondering, how do I generate a chirp between those two frequencies, $-f_{limit}$ and $f_{limit}$? And, is there any documentation for this?


texts: Finding audio signal time delay: cross-correlation vs. impulse response?

texts:
I need to find a time delay between the two audio signals, one comming from one set of speakers, and the other being the source signal that is initialy sent to speakers. I send some noise through those speakers and they come to microphone with a time delay compared to a source signal.

Cross-correlation method
As I understand, there is a cross-correlation method where I send both recorded signals to frequency domain via Discrete Fourier Transform (DFT), then multiply the frequencies, and finaly go back to time domain via Inverse DFT. There should be a peak in time domain telling me what the delay is (let's disregard the accuracy for now.)

IR method
There is also an Impulse Response method, where I also take two signals to freq domain via DFT, then divide the two to get a system transfer function, and finaly do an Inverse DFT of the Transfer function; this will give me the Impulse Response, which should also have a strong peak at the delay point.

My question is:
Am I right in the short descriptions above? The main difference between the two methods seems to be that frequencies are multiplied in the cross-correletion method, and dividied in the IR method? Have I missed something important?


texts: discrete cosine transformation (dct-II) own implementation with loops

texts:
I want to implement the DCT-2, the dctmtx:

$$X[k] = \sum_\limits{n=0}^{N-1} x[n] \,\cos \left(\frac{\pi}{N} \left(n+\tfrac12 \right)k \right) ~~~,~~ \;k=0,1, \dots N-1$$

function [ C ] = dct_mtx( N )
for k = 0:N-1
    for n = 0:N-1
       tmp(k+1,n+1) = cos((0.5+N)*k*pi/N);
    end
end

tmp(1,:) = tmp(1,:) / sqrt(2);
C = tmp;
end

If I call the function C = dct_mtx(3); and check the matrix C'*C = I and is not the identity but almost.

What I have to change in the code to get the Identity in the end?

the identity looks like that:

1.50000000000000         -1.66533453693773e-16    -1.11022302462516e-16
-1.66533453693773e-16    1.50000000000000         -2.77555756156289e-16
-1.11022302462516e-16    -2.77555756156289e-16    1.50000000000000


texts:
I'm applying an ideal filter on the frequency domain. My code below:

N=512;
fs=100;
t=0:1/fs:(N-1)/fs;
s1=sin(2*pi*2*t);
s2=0.2*sin(2*pi*20*t);
s=s1+s2;
subplot(321), plot(t,s)

S=fft(s);
w=linspace(0,fs,N);
subplot(322), plot(w,log(abs(S)))

fc=12;
H=zeros(1,N);
H( w<=fc ) = 1;
H( w>=fs-fc ) = 1;
subplot(323), plot(w,abs(H))

SF=H.*S;
subplot(324), plot(w,log(abs(SF)))

ss = ifft(SF);
subplot(325), plot(t,ss); title('Filtered on freq domain')

h=ifft(H);
ss2=conv(s,h);
subplot(326), plot(t,ss2(N:end)); title('Filtered on time domain')

The results are not the same.

And so my questions are:

What am I doing wrong?
Is it better to filter on frequency domain or time-domain or it's
the same?
Sometimes applying a filter on frequency domain results on a "strange" signal after IFFT. Why?


texts: Audio - TDOA and $\tt xcorr$, find the 'best' peak

texts:
I try to locate a mobile device using multilateration. The mobile device acts as the receiver and in the room I have three speakers. To calculate the position I need the time difference of arrival (TDOA) values for each speaker signal. I am using MATLAB and xcorr for this. The (simplified) code looks like this:

[signal1, fs] = audioread('speaker1_signal.wav');
[rx_signal, fs] = audioread('received_signal.wav');
[R, lags] = xcorr(signal1, rx_signal);
[v, i] = max(R);
lag = lags(i);
% for each speaker signal

Calculating the time difference is not difficult. I calculate the lag value for each speaker, set one as 'fixed' and substract the other values from the fixed one. So far, so good.

My problem: it seems that the maximum value of the xcorr is not always the best value. Looking at the following plot (real data) we can see the problem:

The max values for Signal1 and Signal2 are placed around 18k; However, the value for Signal3 (yellow) is placed around 15k. This results in huge time differences (that results to wrong positions). I would like to know if there are any solutions for detecting the ''best'' peak value or how I can solve my problem?

HINT:

My signal is linear frequency modulated (each speaker has a bandwith of $1\textrm{ kHz}$) and I am using FDMA and the ultrasonic range (17-21k) due to hardware limitations.
The receiver is a Smartphone; on a measurement microphone this problem doesn't occur very often. But the final product should run on a smartphone as well.


texts:
What tool/filter/mathematic operation would you use to detect the red points marked in this signal?

As you can see there are several differentiated groups and I want to detect those moments in which changes occurs. I cannot use a fixed value for amplitude, because it might change.

I'm using MATLAB if someone wants to use some code for it.


texts: Sampling and Reconstruction of digital signal in Matlab

texts:
I'm trying to write a program in Matlab that samples (using Nyquist theorem) and recovers signal. However, I cannot write sampling part for sum of 2 signal.

f1 = 30;
T1 = 1/f1;
amplitude1 = 1;
f2 = 60;
T2 = 1/f2;
amplitude2 = 1;
signal1 = amplitude1 * sin(2*pi*t/T1);
signal2 = amplitude2 * sin(2*pi*t/T2);
signal = signal1 + signal2;
plot(t, signal);
grid on;

I write this code.I want to draw Undersampling, sampling at Nyquist
rate and oversampling. When make researching, I find code like that, but i cannot use it for my signal.

fm=input('Enter the Msg frequency(fm):\n');
xa1=amplitude*sin(2*pi*fm*t);
subplot(2,2,1);
plot(t,xa1);

What is fm in my signal ? How can i find it ?

fs1=2*fm + 10
n=0:1/fs1:1;
xa2=amplitude*sin(2*pi*n*fm);
subplot(2,2,2);
stem(n,xa2);
title('Above niquist rate');

I want to write a code like above for all 3 cases. And how can I find the Nyquist sampling rate for signal empirically ? Thank you all.

I know signals are not same. But I just want to do same thing on my signal.


texts:
I've already wrote about that trouble (link here), but I don't understand where I've made a mistake.

Full description of the task is as follows:

Z-transform of sequence {x(k)} describe by the equation.
$$
X(z) = \frac{2.5 - 3.15z^{-1} + 1.2z^{-2}}{1 - 2.3z^{-1} + 1.2z^{-2}}
$$

Calculate of samples x(-2), x(-1), x(0), x(1) and x(2) double-side of sequence {x(k)}, which correspond to this z-transform.
Note -
Double-side sequence is sequence to consist samples before zero and after zero.

Step 1

I calculate of the integer part of the expression (just divided the numerator by denominator),

$$
X(z) = \frac{2.5 - 3.15z^{-1} + 1.2z^{-2}}{1 - 2.3z^{-1} + 1.2z^{-2}}\qquad(1.1)
$$
transform to,
$$
X(z) = 2.5 + \frac{2.6z^{-1} - 1.8z^{-2}}{1 - 2.3z^{-1} + 1.2z^{-2}}\qquad(1.2)
$$

Step 2

I transformed denominator like $$\frac{(z – p1)(z – p2)}{z^{-2}}\qquad(2.1)$$.
$$
1 - 2.3z^{-1} + 1.2z^{-2} = (1 - 1.5z^{-1})(1 - 0.8z^{-1})\qquad(2.2)
$$

Step 3

I transformed of the expression from:
$$
X(z) = 2.5 + \frac{2.6z^{-1} - 1.8z^{-2}}{1 - 2.3z^{-1} + 1.2z^{-2}}\qquad(3.1)
$$
to
$$
X(z) = 2.5 + X{_1}(z)\qquad(3.2)
$$
and then $$X{_1}(z)\qquad(3.3)$$ transform to
$$
X{_1}(z) = \frac{A}{1 - 1.5z^{-1}} + \frac{B}{1 - 0.8z^{-1}}\qquad(3.4)
$$

Step 4

Calculate of coefficient A and B

Calculate of A

$$
(1 - 1.5z^{-1})X{_1}(z) = A + \frac{B(1 - 1.5z^{-1})}{1 - 0.8z^{-1}},\qquad(4.1)\qquad if\qquad z=1.5
$$
hence
$$
A = \frac{2.6z^{-1} - 1.8z^{-2}}{1 - 0.8z^{-1}},\qquad(4.2)\qquad if\qquad z = 1.5
$$
so
$$
A = 2
$$

Calculate B

$$
(1 - 0.8z^{-1})X{_1}(z) = \frac{A(1 - 0.8z^{-1})}{1 - 1.5z^{-1}},\qquad(4.3)\qquad if\qquad z=0.8
$$
hence
$$
B = \frac{2.6z^{-1} - 1.8z^{-2}}{1 - 1.5z^{-1}},\qquad(4.4)\qquad if\qquad z = 0.8
$$
so
$$
B = -0.5
$$

Step 5

$$
X{_1}(z) = \frac{2}{1 - 1.5z^{-1}} + \frac{-0.5}{1 - 0.8z^{-1}}\qquad(5.1)
$$
and
$$
X(z) = 2.5 + \frac{2}{1 - 1.5z^{-1}} + \frac{-0.5}{1 - 0.8z^{-1}}\qquad(5.2)
$$
Sequence of {x(k)} has the following representation
$$
x(k) = 2(1.5)^{k}, if k<0;
x(k) = 2.5, if k=0;
x(k) = -0.5(0.8)^{k}, if k>0;
$$
And after that we can calculate Sequence of {x(k)} - x(-2), x( 1), x(0), x(1) и x(2)
 x(-2) = -0.88889;
 x(-1) = -1.33333;
 x(0) = 2.50;
 x(1) = -0.40;
 x(2) = -0.32.

Could you check my solve and say where I made mistake.
Thank you very much!


texts:
I am wondering if it is possible to realize an analog square root raised cosine filter.
Any idea about how to do that with Matlab?


texts: Purpose of multiplying fft output by Hann window?

texts:
I'm working with some acoustic propagation models at the moment.
A feature I've noticed in 2 of these models is that the output of the model is often multiplied by a Hann window in the frequency domain immediately before reporting the results in the time-domain.

I've been struggling to understand the idea behind this, as I'm only familiar with window functions applied in the time-domain.

To give some background... these models operate by (to my understanding):

Simulating a theoretical rectangular spectra (with equal phase values for all frequencies).
The models then calculate the loss per frequency as sound propagates through the environment.
Frequency domain and time domain plots are typically returned to view the results in an intuitive fashion (dB loss per frequency).

I am assuming that to convert this back into the time domain (to show the effects of spectral dispersion), the Hann window somehow makes this signal viewable, as otherwise the flat phase values would result in non-sensical time domain signals.

Can anyone briefly describe the DSP theory behind multiplying a flat (rectangle) spectra with a Hann window of the same size?

Below I have shown some relevant matlab code.
This piece of code (as I understand) frequency shifts the signal (phs), multiplies the frequency domain by a hann window (hanwin), then converts back into the time domain fft.
The resulting tlpressd is used to plot the dB propagation loss per time in the resulting plot.
The looping term just runs through all the output ranges of the environment.

hanwin=hanning(nf+1);
hanwin=fftshift(hanwin(1:nf)/sum(hanwin(1:nf)));
phs=2*pi*cfreq*time;
if optout == 1
  for irng=1:nrout,
    pressd(irng,:)=fftshift(fft(pressd(irng,:).*hanwin')).*exp(-j*phs);
    timeout(irng,:)=time+rngout(1,irng)/(c0/1000.);
  end
% pressd = complex pressure field, row = range; col = time
tlpressd=-20*log10(max(abs(pressd),1.e-20));

Notes

FYI, the code above is from Kevin Smith's "Monterey-Miami Parabolic Equation" propagation model.  It converts the resulting green's function solutionsof the model into a one of several visual representations (time vs Frequency, or Frequency vs Depth ,etc)

To give more context (and possibly more confusion).  If I replace the variable hanwin with any time-domain signal of my choice, the end of the code block provides be with the convolution of that signal with the propagation effects the model calculated (i.e. it simulates the effects of propagation on the provided signal).  Its clear that I'm convolving the Hann window with my model output... but I have no idea what the signal theory behind this is.


texts:
I want to clarify my understanding of OFDM training fields. Please correct me if I am wrong as I am getting 2 different information from online resources.

For 802.11a standard the preamble contains 10 short training Field (STF) and 2 Long Traning Field (LTF). Each of the STF (A1,...A10) contains 52 subcarriers that contain symbols as shown in the picture.

And In some other document, I am seeing that there is 2 short training field instead of 10, the 2 LTF is there as same. Which one is true, or both are true in a different perspective? I have also seen in many implementation 2 STF are used.

In addition:

a) Is the same packet detection method used for both 802.11a and 802.11n? (i.e with STF)?

b) The standard says each of the STF symbols has 16 samples. Can anyone explain this? How this 16 sample is achieved or comes from?


texts: What happens when we Fast Forward the Video

texts:
I've been involved in Image Processing kind of project for the last couple of month, before which i had no experience in Image processing.
While filtering the image today i had a thought what exactly happens when we fast forward any movie or a video clip ?

For example,
If I have a video whose Frame rate is 30 , this means that 30 frames will be process in a second.
and each frame will take 1/30 = 0.03sec to process , If we increase the frame rate or FPS of the video we will get more smooth view of it.

So what exactly happens when we fast forward the video, what i think is (not sure) the audio and the video of any clip must be synchronized so that we can control both accordingly.

So when we forward the video does it skip certain Frames ? if yes, then what about the Audio ?
What exactly happens ?


texts: Calculating PSD, Cross PSD by using FFT outputs

texts:
I am having the FFT results of two distinct voice signals. Let's say the FFT results of these two signals are of the form (a+ib) and (c+id). Now, I want to calculate the PSD of each signal and also the Cross PSD between them. I'm calculating PSD and Cross PSD as follows.

PSD of signal 1 = a * a + b * b;

PSD of signal 2 = c * c + d * d;

Cross PSD between signal1 and signal2 = (ac - bd) + (ad + bc). I also want to know whether this equation represents cross-correlation or cross PSD?

And also, I have ambiguity about the importance of cross PSD. I know that cross PSD is obtained by taking the Fourier transform of the cross-correlation results. I know that from PSD, we can get an idea of the power for different frequencies present in the signal. How does cross PSD differ from PSD? I found out that by using cross PSD, we can find the power shared by a given frequency for the two signals. How do we know how much power is shared between the two signals from a single constant power value per frequency? Please help me out in understanding what the cross PSD means and what is its importance?


texts: Very fundamental question: by what number do you divide your ADC counts?

texts:
What number is it correct to divide by your ADC counts as a first step in converting counts to voltage? For example, in a 10 bit ADC, is it correct to divide by 1024 or 1023?

I have always divided by 1024, which means that a full count would yield less than full scale voltage reading. I think this is a more accurate representation of the hardware, though, since there is usually an LSB of error. This is also what I've read in every datasheet, as well as various DSP literature and white papers from ADI and TI. Please prove me right (or wrong) with the detailed reasoning why!

Links to lit:
http://www.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=slyw038b

http://www.analog.com/en/education/education-library/data-conversion-handbook.html

http://www.analog.com/en/education/education-library/scientist_engineers_guide.html


texts: YV12 to RGB - What is wrong with my algorithm?

texts:
I am attempting to convert YV12 to RGB using the following fragment shader:

precision mediump float;
uniform sampler2D tex0, tex1, tex2;
varying vec2 v_texCoord;

void main(void) {
    float r, g, b, y, u, v;
    y = texture2D(tex0, v_texCoord).x;
    u = texture2D(tex1, v_texCoord).x;
    v = texture2D(tex2, v_texCoord).x;

    y = 1.1643 * (y - 0.0625);
    u = u - 0.5;
    v = v - 0.5;

    r = y + 1.5958 * v;
    g = y - 0.39173 * u - 0.81290 * v;
    b = y + 2.017 * u;

    gl_FragColor = vec4(r, g, b, 1.0);
}

Below is the original image followed by the converted image.  Based on the output, can you determine where I might look to determine what is causing the improper decoding?


texts: Correct method for up-sampling cross-power spectrum for sub-pixel motion estimation

texts:
Let's say I have two images, one reference($g$) and another shifted($f$). I tried to get subpixel accuracy of the motion. Here are my steps:

Firstly I would calculate the normalized cross-power spectrum $C(u,v)$, where $F$ and $G$ are fft2-ed.

$$C(u,v)=\dfrac{F(u,v)G^*(u,v)}{\lvert F(u,v)G^*(u,v) \rvert} $$

Next I would like to get $1/k$ subpixel accuracy, by padarray the $C(u,v)$ by $k$ factor, resulting in $C_k(u,v)$
ifft2 $C_k(u,v)$, resulting in $c_k(x,y)$
Find the arg max of the $c_k(x,y)$

Here's my code in Matlab:

reference = fft2(reference);
shifted = fft2(shifted);
C=shifted.*conj(reference)./abs(shifted.*conj(reference));
[m, n]=size(reference);
ck=ifft2(padarray(C,[k*m k*n],'both'));
[~,w] = max(real(ck(:)));
[dxk,dyk] = ind2sub(size(ck),w);

After run the code I can't get the accurate result. I hope I explained it clear enough(from what I understood from the attached paper). I really need help on this and much appreciate any help!

Referred paper: Here (start from section 3)


texts:
I am studying the mel-frequency cepstral coefficient
 (MFCC) and have downloaded a pdf which is related to MFCC from this link. It is about the "ETSI ES 201 108"

  ETSI ES 201 108 - Speech Processing, Transmission and Quality
  aspects (STQ); Distributed speech recognition; Front-end feature
  extraction algorithm; Compression
  algorithms

I am curious about the 4.2.5 Energy Measure

How can they calculate a floor that makes sure that the result is not less than -50? I don't know the reason why the result is not less than -50. Would you know why and explain for me?


texts: Additive Synthesis - clean playback of a spectrum frame

texts:
First of all - I have only a limited of Fourier transforms and the mathematics involved, so please pardon any potentially bad terminology or huge gaps in conceptual knowledge.

I'm experimenting with creating an additive audio synth and want it to be able to achieve the following:

capture a FFT window from some audio source
feed the resulting spectrum from its bins into the synth
have the synth cleanly play back that spectrum. By that I mean that the sound should be "smooth", eliminating artefacts from the phase/frequency relations of the individual oscillators. I kind of expect to get a "smudgy" sound if the captured FFT frame contains transient material, and a "smooth" sound if the input is a simpler harmonic sound.

my synth implementation has free-running sine oscillators where I can set the frequency / amplitude / initial phase.

first question:
is it sufficient to set the oscillator freq/amp/phase to certain initial values from a FFT frame and just play them in free-running mode to achieve smooth playback?

From some limited experimentation I've noticed the following:
If I take a 1024-sample windowed FFT, I get 512 frequency bins. So I use 512 oscillators, and set their frequencies linearly from 0-22050Hz (samplerate/2), so evenly 21.533203Hz apart. I then set the oscillators' amplitude and phase to the values I get from the FFT frame.

Now when playing back this configuration, one thing that is immediately (audibly) noticeable is that the ~21.53Hz frequency defined by the frequency bins is the dominant component in the output. The oscillators are "beating" against each other because (from my intuitive understanding) there are strong phase correlations between the bins. These are not part of the sampled input signal, and should be eliminated from the desired output signal.

Now the question is, what do I have to do to get rid of that? Is it actually possible to just use the raw frequency bin magnitudes and phases to get a continuous signal?

Or, do I need to calculate some other frequencies for the oscillators? I'm aware that the FFT frequency bins do not represent actual frequency peaks in the signal accurately. Is it necessary to calculate/guess actual peaks?

Or, do I need to modulate the oscillator phases over time in a way such that the beating is eliminated..? (the synth can do modulation, but just blindly guessing here)

audio example

440Hz saw wave original

440Hz saw wave taken as FFT frame and played by additive synth


texts: Get I and Q components from a signal (multple frequency signal)?

texts:
Is there anyway to get the I and Q components from a signal in the time domain? The signal has multiple frequencies.

So far I have been doing this in a SIMPLE situation:

Fast fourier transform to get each frequency and each frequencies amplitude and phase
Then use $\cos(\textrm{phase}) \cos(2 \pi f \times \textrm{time_vector}) -
   \sin(\textrm{phase}) \sin(2 \pi f \times \textrm{time_vector})$ for each frequency.
This gives me I and Q data for each frequency, then I just need to
sum them to getback the original signal.

Problem is, I am trying to do something more complex and need to get the I and Q data straight from the time domain signal without following the above steps. Where I is In phase component & Q is Quadrature phase component of the signal.


texts: Discrete time Final Value Theorem applied to feedback system

texts:
I wish to calculate the Final Value of systems in which a high pass filter of the output feeds back into the input.
A simple example would be:

where  is a 1st order high pass filter with transfer function:

I was expecting the y in the above example to have an infinite final value to a step in x, because  keeps feeding
However, the workings below give a different answer:

Re-writing hp1(z) in terms of its inputs only:

Add  to both sides of the system's equation:

Write the system's transfer function:

Re-write the infinite sum in the denominator:

Apply the Final Value Theorem to the response of this system to a step in x:

Taking the limit:

The above suggests that the system  has a well defined terminal value to a step in x. However I don't think that can be the case.
Where am I going wrong?
Help much appreciated


texts:
I'm working on a project of applying Active Shape Model  to locate tooth in dental radiograph. For those familiar with the technique, I'm currently trying to sample along normal vectors for each landmark. The paper recommends to take derivatives of sampled pixels: "To reduce effects of global intensity changes we sample the derivative along the profile, rather than the absolute grey-level values."

So my problem is how to filter dental radiographs in the best way to prepare them for applying derivative operator. I'm currently using combination of median filter to remove most of what I think is quantum noise (mottle). It is followed by bilateral filter. Then I apply Scharr operator to compute the actual gradient which should be sampled.

The results are presented below:

The first image shows original data. In the second and third image, filtered data are presented, first as a magnitude of spectrum after FFT and then as a filtered image data. Fourth image show result of applying Scharr operator to third image.

My questions are:

Are there a well known approaches for reducing noise in dental radiograph that would differ from my approach?
What is causing the "smoky" appearance of the edges and "flat"(non-edge) areas? Is it some kind of leftover noise in the filtered image or is it inherent to the gradient operator? If it is indeed a noise, which filter would be most suitable to use? Median filter was good at removing small noisy blobs but large kernel causes the edges to blur out too much. So bilateral filter is used to filter out larger blobs and equalize color over area without harming edges, but it is not able to filter this smoky structure.
Is there a better option than Scharr operator to create gradient in this case?
Bonus: Would this be considered a good input for Active Shape Model? I'm not yet aware how robust they are.


texts: calculate root mean square, ratio of power, constant false alarm, ... of a signal

texts:
I am new to Digital Signal Processing, and am reading a paper. I don't know how they can extract some features from signal, like root mean square (RMS), Constant False Alarm Rate - CFAR, Mean Value Dispersion Statistic – MVD, Ratio of Power – ROP, and Autocorrelation from a signal, as shown in the following figure:

Could anyone please help explain to me how, and, if it is possible, could you please show me some code to get them?

I've tried to write some codes to calculate these parameters. Could you please take a look:

RMS:

for i= 1:floor(time(end)/tPeriod)
    tBegin = (i-1)*tPeriod;
    tEnd = i*tPeriod;
    index = find((time>=tBegin)&(time<tEnd));
    RMS(i) = sqrt(mean(data(index).^2));    %equation 1
    tPlot = [tPlot tEnd];
end

CFRA:

for i= 1:floor(time(end)/tPeriod)
    tBegin = (i-1)*tPeriod;
    tEnd = i*tPeriod;
    indexTime = find((time>=tBegin)&(time<tEnd));
    y = fft(data(indexTime),M)/M;   % M is the number of fft points
    y = 2*abs(y);
    df = fMax/M;
    f = [0:M-1]*df;
    indexF = find((f>=n1)&(f<n2));
    CFAR(i) = sum(y(1:M/2)).^v;
    tPlot = [tPlot tEnd];
end

ROP:

for i= 1:floor(time(end)/tPeriod)
    tBegin = (i-1)*tPeriod;
    tEnd = i*tPeriod;
    indexTime = find((time>=tBegin)&(time<tEnd));
    y = fft(data(indexTime),M)/M;
    y = 2*abs(y);
    df = fMax/M;
    f = [0:M-1]*df;
    indexF = find((f>=n1)&(f<n2));
    ROP(i) = sum(y(indexF).^2)/sum(y.^2);
   tPlot = [tPlot tEnd];
end


texts: Forward/reverse median filter. Reference needed

texts:
I am using the double median filtering of my data. For this, I perform median filtering of the signal in forward direction, then in reverse direction (from end to start). Results are averaged. Example of the MATLAB code:

Signal=rnd(1,100);
Mfw=medfilt1(Signal,10);
Mrev=medfilt1(Signal(end:-1:1),10);
M=mean(Mfw,Mrev(end:-1:1));

I am happy with this approach, but now it is time to write a report...
I understand that I am not the first who use this kind of filtering.

Could you help me to find some references to this filter?

The problem is I even don't know the official name for this approach. "bidirectional median filter" shows me something else.


texts: Why is my bode plot showing periodic behavior?

texts:
I found something very interersting when I was trying to simulate a discrete time system. So first I discretized the continuous system $G(s)$ using "c2d" function and "dbode". The resulting bode plot for the discretized system is displaying some sort of periodic behaviour after reaching about 3 hz. So is the phase plot.

Can someone explain why this maybe happening?


texts: Efficient calculation of exact frequency from a broad frequency range (1 Hz - 1000 Hz)

texts:
I have some input signal sampled at 1-10 MS/s. Let's assume that it contains one strong frequency component (with frequency anywhere in the range from 1 Hz to 1000 Hz or even higher, changing over time) plus a number of higher harmonics (with quite a bit lower amplitude than the main frequency) and some noise.

The frequency may rise from zero to 1 kHz in a few seconds. The idea is to calculate the result approximately every 10-20 periods of the signal.

I need an algorithm which is as fast as possible to calculate the precise main frequency in real time.

I'm currently testing a couple of methods (like this or this) which can already give a pretty accurate result (under 0.01% when there are not too many higher harmonics) if I know an approximate frequency upfront and feed the FFT with cca. 10 periods (if the signal is around 100 Hz, I would use 100 ms slices; in case of 1 Hz, I'm ok with a lower accuracy, so taking just 1 - 2 periods is fine in that case). All these algorithms use just two or three bins from the FFT (around the highest amplitude) to calculate the exact frequency.

The problem is that in order to cover a wide frequency range without any idea what the base frequency is, I would first need to calculate FFT a lot of times. For example, first calculate all chunks of 10 ms just in case there is some 1 kHz component present. If it's not, maybe switch to 20 ms, then 40 ms ... and so on until we find the first signal length which adequately covers cca. 10 periods of the signal. That might slow down the algorithm 10-fold compared to the situation when frequency is approximately known upfront.

My question is: is there any way to first calculate 10 ms FFTs for each chunk of the signal, and if the frequency turns out to be too low, somehow combine results from two neighbouring 10 ms + 10 ms FFTs with a method that would require less computation resources than calculating FFT of the full 20 ms from scratch (given that I probably only need one or two FFT bins for a 20 ms signal anyway, and in this case I should know which ones).

Or any other idea of the fastest way to determine an approximate frequency quickly? (Some even use zero-crossing to do that which works fine as long as you are looking at nearly perfect sine curve, but that's not useful when higher frequencies and noise are present.)


texts: What is the best pitch (frequency detector) for a Voice Activity Detection Algorithim?

texts: I am programming a Voice Activity Detection algorithm. After researching several methods, I implemented a simple method that determines whether or not the person is speaking based off the RMS of the signal. However, I want to improve the algorithm to determine whether the sound coming into the microphone is actually a human voice and I thought the best way to do that would be to calculate the frequency of the signal. I used an FFT to do so, but upon further research others have suggested that other methods may be more effective. As such, which would be the best method to use? EG: Auto-correlation, zero crossing, etc...? Or is examining the frequency not even a good method of VAD? If it isn't, what is the best method by which to determine whether or not someone is talking?


texts: Degrees rotation based on frequency offset?

texts: What is the relationship to calculate degrees of rotation in the constellation given a baud rate and frequency offset?


texts: Transfer function from experimental time domain data

texts: I have two sets of time domain data.  One is the input to a system and the other is its corresponding output, both measured at the same sampling frequency.  How to calculate the system's transfer function from this experimental data?


texts: Signification of alternating signs of imaginary and real part of an FFT

texts:
Let me start by saying that this question is motivated by data analysis that I am doing. It's part of a much larger set of signal processing operations, but in order to keep the question contained I'll ask a general question and hope, someone will be able to help me:

Is there any physical or mathematical characteristic that is known for a signal (containing only the odd Harmonics) whose FFT-imaginary and FFT-real parts have alternating signs ?

As a matter of fact, this alternation happens when I shifted my signal in the time domain. This signal is measured and contains many periods. As I don't know the phase shift between the excitation signal and the measured signal, I am not really sure where the correct signal begins because I don't have the real phase shift. So when I shifted the time signal with (3/4)*Number_of_bins_per_Period, I got a plausible time signal (that suits other operations I am doing on its basis). So I wanted to know if I can find the reason why this shift : (3/4)*Number_of_bins_per_Period, is the correct shift by analyzing its effect on the real and imaginary part of the signal. Before the shifting, the FFT of the signal has these real and imaginary part:
EDIT Please note that I am not asking about the fourier Transformation or why I am getting this behavior. This is clear. As I said, the shift I am doing (3 *Tr/4) I did it intuitively and it gave me afterwards the results I was looking for. I was hoping to find the answer, as WHY exactly this shift is the right one. And I thought maybe the hint would be the alternating signs. So why should be the sogns of the real and imaginary part alternating so that my shift is right . Is this a sort of finger-printing for a specific physical phenomena ?


texts: Basic question: Why is the output of a system the convolution between the impulse response and the input?

texts:
I forgot a very simple fact and I am now struggling to find reference that proves this basic property?

How would you prove that for a single in single out system, the system output is the impulse response convoluted with the input?


texts: Decoding a video signal, how to get frame output to matrix for calculations?

texts:
I'd like to use python to take a video (eventually a stream) and map each frame to an RGB array of pixels.

My first thought was to use ffmpeg bindings, and in memory (if possible) convert it to png to read each pixel. However, I think that this is redundant to the purpose of the decoder.

It seems like this may be the most basic entry into video processing, if someone could point me to the library or approach that would accomplish this I would be grateful.


texts: Explicit a succession using z inverse transform

texts:
Is it possible to explicit $y(n)$ of this mathematical succession in recursive form using z inverse transform?:

$ y(0) = 1 \\ y(n+1) = 2y(n) + 3 $

I can't write this as a linear system in z (linear difference equation) because there is the $3$ that doesn't depends on input or output.

I know some methods to solve this but I'm trying to use z inverse transform with no success.