texts: What is the spectrogram of an impulse response used for?

texts:
I saw that in acoustics an estimated impulse response of a room can be transformed using STFT/wavelets to a spectrogram as an analysis tool. However, I did not understand how the spectrogram is interpreted (in contrast to the spectrum of the impulse response which gives us the frequency response for example).

Also, are there other cases in which the spectrogram of impulse responses is used, and what are the intrepretations in those cases?

Thanks!


texts:
How fast samplerate 1 bit PWM needs to equal 16 bit 48khz PCM?

1 second signal = 48000 samples,each sample can be anywhere from -32767 to +32768,therefore 1 second of 16bit 48khz PCM contains 65536^48000 possible combinations,thats very big number!

I was thinking about this,correct me if I am wrong,for 1 bit PWM signal to equal acuracy of 16bit 48khz PCM,it would need to run at 3145728000hz samplerate,that is 3 GHZ.

Now I would like to mention music format known as DSD,its 1 bit,running at 64x sampling rate of RedBook,that is 44100 x 64 = 2822400hz... thats 3 MHZ not GHZ,that is orders of magnitude bellow what I calculated to be minimum for 1bit signal to equal acuracy of PCM.

DSD is using noiseshaping,it helps to push the noisefloor down in the audible range,but that doesnt make up for fact that the samplerate is far too low to be able to reproduce all the possible combinations of sound in given lenght of signal equal to PCM ( right? )

PWM in audio is widely used in Class D amplifiers,doing a research I found out that they run even slower,some of them bellow the MHZ range,250khz for example,I am thinking,PWM freqency that slow must have much lower accuracy than PCM

It must be throwing away information because the 1bit PWM even when running at high speeds just doesn't equal the data bandwidth of PCM if it's not in the gigahertz range. Is what I have written true or false?


texts: can any one explain how actually IFFT generating sub carriers in OFDM.... when we are simulating OFDM transmitter in matlab, we are taking input data stream, encoding it and modulating the encoded data. then we are converting this modulated serial data stream to parallel data and giving it to the IFFT block. my problem is how sub carriers are generating in IFFT??


texts: Is it possible to convert from 2D to 3D form?

texts:
I have captured car positions at different frames from the video.
Suppose car's(e.g.left side car which is coming towards us in the images) centroid  at video frame1 is P(x1,y1) and Q(x2,y2) at video frame4.

Is it possible to represent P and Q points into 3D? so that i can calculate correct pixel distance d(PQ) and finally compute actual distance

Note:u can assume that camera is stationary, placed at height 10 m from ground level .u can also assume any suitable data if u want
also u can refer the next figure also.


texts:
I make Kramers Kroing relation(KK relation) with scipy.integrate.quad to change $\kappa(w)$ into $n(w)$.
Their KK relation is $n(w) = 1 + \frac{1}{\pi}\int_{-\infty}^{\infty}  \frac{\kappa(w^{\prime})}{w^{\prime}-w}dw$
But I met some probloms while runnig my code.
My result is worse than when i use scipy.fftpack.hilbert
Could anyone check it and tell me what's the problem?
Thank you for your kindness! :)
import numpy as np
import matplotlib.pyplot as plt
import scipy.fftpack as ft
from scipy.integrate import quad
g=10
w0=100.0
wp=100.0
def k(x):
   e=1+((wp**2)/((np.power(w0,2)-np.power(x,2))-(1j*g*x)))
   k=np.imag(np.sqrt(e))
   return k
def kk_n(w): #kk rel k(w) to n(w)
   pi=np.pi
   f=lambda w,x: (k(x)/(pi*(x - w)))
   kk_n=1+quad(f,-np.inf,np.inf,args=(w))[0]
   return kk_n
vector_n = np.vectorize(kk_n)
w=np.linspace(0,1000,2001)
n=vector_n(w)
plt.plot(w,n,lw=2, label='KK rel')
plt.plot(w,1+ft.hilbert(k(w)),lw=2,label="fft.hilbert")
plt.xlabel("$\omega$",fontsize=18)
plt.ylabel("${\\rm Re}[n(\omega)]$",fontsize=18)
plt.ylim(0,5)
plt.legend()
plt.show()


texts: Noisy Frequency Estimation using Hilbert Transform

texts:
I'm looking for a way to estimate instantenous frequency with low time-variation. The following MATLAB function (save as test_fest.m) does this using the Hilbert transform on a single 10 Hz sine tone. Sample rate f_s is 1000 Hz.

function test_fest()
%TEST_FEST()  Test Frequency Estimation using Various Techniques.

fS = 1000;
f = [10]';                                  % Sine Wave Frequency
nFFT = fS;
x = sin(linspace(zeros(length(f),1), f*2*pi, fS));
X = hilbert(x,nFFT);

fE = diff(unwrap(angle(X))) * fS / (2*pi); % Frequency Estimate
eE = mean((fE/f-1).^2); % MSQ Error

plot(fE,'.');
title(sprintf('Hilbert Transform Instantaneous Frequency Estimation of Sine Wave f=%.2f Hz, f_S=%g Hz, Mean-Square Error:%.2g', f, fS, eE))

Output is shown here:

I, however, get a greater error, 2.3e-5, than I expected. Is there something wrong with my approach?


texts: tx and rx model supporting all data rates

texts:
i am trying to build complete tx and rx path which can support varies data rates. for example if my data rate have to support from 10 kbps to 1000 kbps.
Can i keep the baseband processing fixed for all the data rates same. what i mean is using a CIC filter in tx and rx which always results in processing
4 samples/symbol. or should i use a resampler in the timing recovery which will result in the desired rate?


texts: I want to ask about MultiScale Object Detection. For the multiscale, if we have an original image do I need to zoom-in at different scales in the image at a particular point or zoom-out at different scales in the image at a particular point?


texts: Measuring noise floor in an impulse response

texts:
Say I have an impulse response...

(an envelope of the actual IR obtained using the Hilbert transform)

... question: how do I calculate the surrounding noise level?
Visually this looks to be ~ -54 dB w.r.t. the peak.

But before you say something like "just average the surrounding parts" (ok maybe with better technical terminology), I would actually like to determine the noise level programmatically, in order to deal with wider peaks, like...

Just arbitrarily taking some noise samples could accidentally include part of the peak and obviously invalidate the result.

My hunch: set a threshold as the minimum number of samples above some level  X such that this level can be considered to be noisy. This could work well in the first case - as you increase X to above ~ -54 dB the number of samples above suddenly drops by a significant amount.

This approach may not work so well in the second case as the decay range consists of more samples (the increase may not be so significant). I could extend the sampling time... but I can only hold my breath for so long when recording.


texts: How can I obtain the response signal for this question?

texts:
In particular I am having trouble with 6b).

From what I understand, we can split a difference LTI equation into two sums, the sum of the previous responses, and the sum of the previous inputs.
Something like this:

Now to get a zero-state response, I have to zero out the first part of the formula. This I understand.

So to get the zero-state step response, I must use x[n] = u[n] and zero out all past outputs of the system.

The problem I'm having is deriving y[n] in the first place.

I have had a couple ideas, however am not confident in their correctness:

Since H(z) = Y(z)/X(z) I could compare the given H(z) to Y(z)(1 - 1/z) because that's the z-transform of 1/u[n]. Correct me if I'm wrong. Then I could make Y subject of the formula and figure out
the    inverse transform from there.
I thought about using convolution with the inverse transform of
H(z) and input signal u[n].

However I'm not convinced these are correct because nowhere am I "enforcing" the definition of zero-ing out the previous outputs.

Any guidelines would be appreciated!


texts: Differences between OpenCV Canny and MatLab Canny?

texts:
does anyone know why the MatLab Canny (MLC) is so different compared to the OpenCV Canny (OCC)?
ML-C delivers precise and more connected edges than the OCC, but how is that possible?
The reason why I ask is, that I need to implement my protoype of ML code into C++ and I wanted to use OpenCV.
Exporting code of ML isn't really possible as far as I have tried.

Kind regards,


texts:
This is the problem from Shaum Otlines Analog and Digital Communications, Hwei Hsu Problem 5.13.

It asks for number of binary digits in each sample if each sample at the receiving end of the system has to be 0.5 per cent of the peak-to-peak full scale value. First of all, how can i understand term "peak-to-peak full-scale" value? What is that supposed to mean?

Now, in the solution to this problem, it says that the peak error is $0.005*2m_p$ where $2m_p$ is distance from lower to upper peak of the signal.

However, i am not familiar with term "peak error", what is "peak error"?

And then, PEAK TO PEAK ERROR turns out to be $2*0.005*m_p$. What is peak to peak error and what is the difference between peak error and ppeak to peak error? Any help appreciated!


texts: Interpreting the FFT results of a structural vibration problem

texts:
System: Cantilever beam type models, with an accelerometer on the end. The beam base is excited at various frequencies in harmonic fashion on a shake table. This results in vibration in the beam. The accelerometer is ICP type, and details here. This accelerometer connects to a compatible FFT analyzer, make OROS-34, details here.

Results:
Graph of response - acceleration v/s time

Graph of FFT of above signal - acceleration v/s frequency

Problem:  I want to understand what the FFT of the original signal means. For example, I have heard that the FFT of the acceleration-time signal would give the natural frequency of the system, as the natural frequency would have the greatest contribution. So the spike in the graph of FFT should correspond to natural frequency.

Can anyone suggest some reference for the theory above ?

If this is true, then whatever be the base excitation, the natural frequency of the structure should not change, the spikes in the acc-freq curve for other frequencies should match this one. This also doesnt happen.

Better images:

Graph of acceleration vs time for excitation freq of 15Hz with displacement amplitude of 50mm.

Graph of FFT of previous curve, i.e. acceleration vs freq

The vertical red line in the image FFT image is a marker for reading X and Y coordinates at peak.

As per the suggested methods and theory, the frequency of oscillation of the structure should be same as forcing freq, however the FFT peak is far from that.

Promise: No more edits. :)


texts:
I have two signals $x$ (see below) and $k$ (obtained by giving circular shift of 106.5849 in $x$). Before I take FFT of both ($x$ and $k$) I want to do window analysis on them.

Kindly can some one please help, How I can choose the window?

After applying FFT I will find Cross power spectrum of both $f$ domain signals.

t=0*10^-9:4*10^-9:150*10^-9;
fc=5*10^6;
xi=sin(2*pi*fc*t);
yi=154*10^-9:4*10^-9:2000*10^-9;
y=yi*0;
x=[xi y];
k=fshift(x,106.5849);

My eventual aim is to implement the following diagram.


texts: What distance metric can I use for comparing images?

texts: I usually use the mean squared error (MSE) or peak signal-to-noise ratio (PSNR) to compare two images, but this isn't good enough. I need to find a formula that returns a very big distance between an image A and its pixellated (or blurred) version B, but I don't know how to proceed. What would be a good metric for my needs?


texts: On the Measurement Matrix Used for Compressing Sensing

texts:
Assume we have a matrix $x$ of size $(8,8)$ where each column is considered to be sparse with degree of sparsity equals to $4$. it means that every column can have $4$ zeros and $4$ non-zeros values distributed randomly. The matrix $x$ can be written as follows:

Inverse Fourier transformation $(iFFT)$ is performed for every column in the matrix $x$. It means  the matrix $F$ representing the $FFT$ matrix of size $(8,8)$ is multiplied with every column in matrix $x$, So $X = F^Hx$, where $X$ is the $iFFT$ column-wise of matrix $x$. The resulted matrix $X$ is read in row-wise leading to have a new row $X'$ of size $(1,64)$.(I mean the matrix $X$-transposed is reshaped to have one column).

The vector $X'$ is convoluted with such channel $h$ resulting $y$, so $y = HX'$, where $H$ is the toeplitz matrix gotten based on the channel $h$.

My question is to recover the spare vectors in matric $x$ based on the resulted vector $y$ and matrix $H$, I'm using compressive sensing, i.e OMP algorithm.  My question is how to build the measurement matrix in that way.

$NP$: The measurement matrix can't be built straightforward since we reshaped the matrix $X$ in row-wise way. If not, I think we can build it to be $HF^H$ as used in the paper Beyond Nyquist: Efficient Sampling of Sparse Bandlimited Signals.

Thank you in advance.


texts: Can Reassigned-STFT be an invertible transform? Algorithm for "Signal => Reassigned-STFT => masking => Reassigned-ISTFT => Output signal"

texts:
It is well known in DSP that this is a successful method to modify audio signals:

Signal => STFT => masking => ISTFT => Output signal

For example, given a signal x[n], one can compute abs(S[t, k]) the magnitude at time-frame t and frequency bin k, modify this magnitude, then perform an inverse STFT (using IFFT with Overlapp Add method), and get a modified signal. Remark: If the FFT size is 4096, then S is just a matrix of format T x 4096, where T is the number of timeframes.

Now I've read about Reassignment method using phase information, and seen in various audio programs how it helps to have a much sharper spectrogram. Example here and here:

Question:

Is there a similar practical algorithm for STFT with reassignment?

Is STFT-with-reassignement an invertible transform?

Signal => STFT-with-reassignment => masking => ISTFT-with-reassignment  => Output signal

In particular, if FFT size is 4096, what's the size of the STFT-with-reassignment matrix S2?

Still T x 4096? Or another format? Can I do masking on this matrix? (to remove or attenuate certain frequency bins in some time frames)
Can I perform a standard "inverse STFT" on this S2?

Would you have such an algorithm?


texts: Ricean Multipath channel model implementation

texts:
I'm trying to implement a multipath ricean channel model. I had found several resources but I'm kind of lost with too much information. What I have from now is the following step:

1- Generate the signal without noise/channel
2- convolve with the channel response
3- add white gaussian noise

My problem is how to generate the channel response? As far as I understand I have to generate a ricean distributed filter with ntaps, where each tap represent one path.

The transmitted data is a series of OFDM symbols for a BERxSNR plot.

The channel model is Ricean with multipath and doppler shift. From my references I have all the parameters but I didn't understand how to transform this into an algorithm.

update

def generate_rician(self,K,data):
    self.__rician_mu  = sqrt(K/(K+1))
    self.__rician_s   = sqrt(1/(2*(K+1)))
    self.__rician_chn = self.__rician_s*(random.standard_normal((data_size,)) + random.standard_normal((data_size,))*1j) + self.__rician_mu
    return self.__rician_chn*data + wgn

Where wgn is the white gaussian noise, omitted here. I have to improve this code adding doppler spread and multipath

[edited]
The above code try to reflect the following equations:
$$
C = \sqrt{\frac{1}{2*(K+1)}}*(X+j*Y) + \sqrt{\frac{K}{K+1}}$$

$$
R = TxC + N
$$

Where $T$ is the transmited signal(QPSK-OFDM), $N$ is the white gaussian noise, $X$ and $Y$ are two pseudo random variables with normal distrubution. $K$ is the ricean factor.

As a reference the equation used as theoretical reference is:

$$
Pb = \frac{1}{2} {\rm erfc} \left (\sqrt{\frac{K*EbN0}{K + EbN0}}  \right)
$$

An output of my system simulation:

As you can see my results are divergent from the theoretical. The simulation was done using scipy fftpack and the code above.

In green you see the theoretical AWGN BER curve, in blue theoretical rician fadin K=5 and in red the results from my simulated system.


texts:
I have 2 images A and B, and a set of point correspondences S which indicate the position of the same point in the 2 images. The goal is to fit a grid on the image A and warp the grid such that the points get close to the points in image B.

This warping should be modeled by something called bicubic B-spline interpolation, which is implemented in this Matlab toolbox: http://www.brnt.eu/downloads.php#bbs

I am somewhat familiar with 1D B-Splines. What is the mathematical process of modelling the warp using B-Splines?


texts:
What are the poles and zeros of this transfer function (in $z$):

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

and how would you approach the resolution of such problem?

Personally, I would write
$$H(z)=\displaystyle\frac{z^2+2z+1}{z}=\frac{(z+1)^2}{z}$$ then I would say that there is a zero (double) at $z=-1$ (numerator $= 0$) and a pole at $z=0$ (denominator $= 0$).

But wouldn't we also have a pole at $z=\infty$ since it makes $H(z)\to \infty$ which corresponds to the definition of a pole?
And in that case wouldn't that be contradictory since we know that $H(z)$ can be seen as a transfer function of a FIR filter which we know is always stable, so how can the filter be stable if it has a pole at $z=\infty$ (outside unit circle)?

I'm sure I have a basic misunderstanding about poles and zeros otherwise there shouldn't be any contradiction and hopefully someone can help me clarify this :-)


texts: Difference between Nyquist rate and Nyquist frequency?

texts:
So I've been searched online and can't seem to find a clear cut answer to this question.

From my understanding, the Nyquist rate is double of the maximum frequency of a signal which Nyquist frequency is half of the Nyquist rate.

Which would conclude that Nyquist rate is the lower bound of sampling and Nyquist frequency would be the upper bound where Nyquist rate is where you can preserve the original signal and anything in between the Nyquist rate to Nyquist frequency would cause some aliasing.

Is this correct?


texts: The condition in order to not lose information after upsampling and downsampling

texts: If you have a signal x[n] and it is interpolated by N and then decimated by M, how do you ensure minimum distortion in x[n] from the resampling process?


texts: One can achieve better resolution results by taking FFT of different sizes of the input signal. FFT size decreases as frequency increases, i.e. longer FFT length for lower frequencies and shorter FFT length for higher frequencies. I have tried to find papers on this topic but did not find any so far. Rational Acoustics has few brochures where it mentions MTW - Multi-Time Window FFT, but there is no mathematics behind it. Anyone can help me with the answer about underlying mathematics or some code implementation (C++, C, or Java)? In other words, how I can apply longer FFT, in my software, for lower frequencies and shorter FFT for higher frequencies to get uniform resolution as a result?


texts: Log-Polar DFT Based Scale-Invariant Image Registration

texts:
I'm trying to do image registration using phase correlation as described in the Reddy Chatterji paper. In my case, the images may be scaled and translated relative to each other.

The algorithm for finding the relative scale, as I understand it, is (see: the flowchart from the paper):

F1 = DFT(I1)
F2 = DFT(I2)
H1 = Highpass(F1)
H2 = Highpass(F2)
L1 = LogPolar(Magnitude(H1))
L2 = LogPolar(Magnitude(H2))
PC = PhaseCorrelate(L1,L2)
PM = norm(PC)
R = IDFT(PhaseCorr/PM)
P = Peak(R)
Scale = LogBase^P[1]

Scale gives me seemingly nonsensical values (wildly different from image to image and never correct).

But ignoring scale, the same phase correlation approach works fine for translation; and so I suspect I have a problem with my log-polar transform. Here's an example, where I've solved for translation--the left image is the original and the right has been cropped and translated--the solution is shown on top of the orignal:

For the log-polar transform, I first transform into polar space:
$$
\hat{I}(\rho,\theta) = I\left(r+\rho\cos\left(\frac{2\pi\theta}{N_{\theta}}\right),r-\rho\sin\left(\frac{2\pi\theta}{N_{\theta}}\right) \right)
$$
where $I$ is the original image, $r$ is the image radius (half-width) and $N_{\theta}$ is the number of samples in the $\theta$ direction. I then sample from this to transform into log polar space:
$$
\hat{I}_{log}(\rho,\theta) = \hat{I}\left(\log_{b}(\rho),\theta\right)
$$
where $b = (2r)^{-N_{\rho}}$ as described in 1 so that it spans the whole polar space.

Here're the example images in log-polar space with $\rho=\theta=256$ (in case there's something glaringly wrong):

Lastly, this shows the actual transformation the images go through before the phase correlation step (top is DFT magnitude post highpass filter, bottom is that in log polar space):

I'm using OpenCV, which has LogPolar and PhaseCorrelate methods. While the PhaseCorrelate, like my manual implementation, gives me the correct answer for translation, it's incorrect on scale. Since using the OpenCV LogPolar or my own doesn't affect the correctness, I must be missing something.

Any help would be appreciated.


texts: Evaluating auto correlation strength (Gamma)

texts: I'm working on Cognitive Radio in TV Band Spectrum.  I need to sense the presence of signal in a particular spectrum. I have to sample the incoming signal (say 1000 samples) and I have to find the auto correlation strength for a smoothing factor L(means my sample will be 0 to L-1 samples delayed). I have assumed a smoothing factor of 10. How to find the autocorrelation strength. Gamma L.


texts:
I am working in image cryptography using an ICA algorithm like JADE. To evaluate my work, I am used the SDR and PSNR.

I would like to know what the acceptable values of the SDR and PSNR in image blind separation are.


texts: Graph Fourier transform: the adjoint notation for the eigenbasis matrix

texts:
I already asked this question here but there is no response. I'd like to ask this question in signal processing domain.

  It is well-known that for a real symmetric matrix $L$ (here, graph
  Laplacian) one can write the eigenvalue decomposition as

  $$ L = U \Lambda U^{\mathsf T}, $$ where $U$ is a real eigenvector
  matrix. Moreover, in graph signal processing papers, including the
  great paper by Shuman et al. (cf. page 4), the adjoint (complex
  conjugate) of $U$ is used to define the graph Fourier transform
  $\mathcal{F}_{G}$ as  $$ \hat{x} = \mathcal{F}_{G} x = U^{*}x, $$
  where $x$ is the signal in vector form and $U^{*}$ is the complex
  conjugate of $U$.

I am curious to know is there any specific reason for using the notation of complex conjugate since $U$ is real?


texts: DFT for signals of different length and sampling rate

texts:
I would like to compare oscillations of biological object. I have multiple datasets which are taken with different sampling rate and have different length.

My current workflow:

Take derivative, because oscillations are overlapped over intense DC component.
Do zero padding to deal with different sample lengths and achieve the same bin size and, consequently, the same "digital" resolution in frequency. For this, I calculate the pad size: $$ pad = N - signalLength$$ ($N$ is padded signal length, $N=f_{sampling}/{\delta}f$, ${\delta}f$ is desired resolution in FFT frequency, $f_{sampling}$ is sampling frequency). Then I add vector of zeros of pad size to the end of signal: $$oneSample = [oneSample;zeros(pad,1)];$$
Take FFT: $$FFT = fft(oneSample,N);$$
Calculate PSD spectrum: $$PSD = (abs(FFT)^2)*normalizationCoefficient;$$ Output for a single sample looks like this:

Lastly, I look for maximum PSD value and corresponding FFT frequency for each sample and plot distributions.

Zero padding seems to give a reasonable results for frequencies, however I am still struggling with finding proper normalization coefficient $normalizationCoefficient$ for PDS spectrum. I started by simply dividing by sample length before zero padding: $$normalizationCoefficient = 1/signalLength$$ but PSD distributions are nonsense (sample, for which I am sure it has to have higher energy, has lower average maximum PSD, purple curve).

Then I tried $$normalizationCoefficient = f_{sampling}/signalLength$$ and results seem to make sense but I cannot find anywhere the justification for this.

So, my question is: what normalization coefficient for PSD should I use in my case?

Wikipedia suggests $$normalizationCoefficient = 1/(f_{sampling}^2*signalLength)$$

but the distributions do not make sense again:

Could anyone point me to the right direction, please?

UPD: on use of zero padding. It does not help to improve the actual resolution in frequency domain, however I find it benificial for the latest stage where I use Matlab's findpeaks function to determine the peak with max amplitude.


texts: need help cleaning a sound sample from a constant (stationary) background noise

texts:
I have been recording sound sample from mouse vocalisations and noticed that a background noise appeared in the recording room. the noise is clearly visible in the spectrograms of the recordings as horizontal lines at frequencies 20, 40, 60, 80, and 100 kHz (ultrasonic range).
I have tried to record in an acoustically isolated box, lined with sound absorbing material, and it helps, however, the box retains unwanted odours which effect the behaviour of the mice, rendering it unusable.

My question is if there is a method to isolate and remove the noise without effecting the rest of the sounds. i want to study the vocalisations, with an emphasis on the frequency in which the mice communicate under different social encounters, and having that constant noise in the background may effect the results of the study.

Vocal communications were recorded using a 1/4 inch microphone, connected to a preamplifier and an amplifier (Bruel & Kjaer) from mice. Vocalisations were sampled at 250 kHz with a CED Micro 1401-3 (Cambridge Electronic Design Limited, Sunnyvale, CA).

The samples were recorded using spike2, a "DC removal" filter was added to the recording.
the files were then transferred to Matlab for splicing further analyses.

I know that there is a strict policy here against attaching files to questions, therefor I'm adding a link to the audio sample and the spectrogram

link to an audio sample and a spectrogram via google drive.


texts: Spatial receive diversity: a different view

texts:
It is well known that spatial diversity can combat multipath small scale Rayleigh  fading in a SIMO system by offering the receiver multiple options of independent receptions using more than one antenna ( this is called selection combining, which is one of several spatial diversity schemes). The basic idea is that the probability of several antennas all simultaneously seeing destructive fading is much lower than the same probability in case of only one antenna
Since by adding more and more antennas we get closer and closer to an AWGN channel, this means that the channel becomes more and more independent from multipath fading, and this is also called channel hardening (channel converges more and more to a deterministic value)
The question is the following: Is there a mathematical derivation that shows how can a random Rayleigh PDF (probability distribution function)  in case of one antenna converge more and more to a deterministic value in case of a large number of receiver antennas


texts: Inverse wavelet transform on wavelet coefficients

texts:
I have a data set which consists of Morlet coefficients for 7 channels in 18 bands. When I try to use inverse DWT in Matlab to get the raw data in time, using this code:

X = idwt(Data(:(#band),:(#time),1(#channel)),[],'morl');

I get this error :

***********************************************
ERROR ...
-----------------------------------------------
 wfilters ---> The wavelet morl is not valid!
***********************************************

any Idea what should I do ? I'm pretty noob so any explanation is great help for me


texts: FFT of sine wave not coming as expected i.e single point

texts:
The cyan plot is a spectrum of 50 Hz, and the magenta one is a 50.1 Hz sine wave (having amplitude 0.7). Both are sampled at 1024 samples/s. I performed a 1024 point FFT to get this spectrum.

Why is only the 50Hz spectrum a single value? Why does the  50.1 Hz sine consist of other frequencies apart from 50.1 Hz; where do these new frequencies come from?

I did not do any non-linear processing on the 50.1 Hz signal! Also the 50.1 Hz appears to have smaller maximum amplitude, i.e. it's not 0.7, when in fact the sine wave I generated has an amplitude of 0.7.

Why is this?

Obtained by MATALB command fft();


texts: Can you use Fourier transformations (or other) to read multiple superimposed barcodes?

texts:
If you printed bar codes on tracing paper/acetate etc. and then positioned several in front of one another, could you extract the individual codes from the aggregate overlaid image? I feel intuitively like there would be a limit on this, as given enough bar codes, the aggregate image would be plain black. It would be good to understand if this is possible in any circumstances and if so, what are the mathematical limits.

It looks as though I wouldn't be able to tell the difference between black on white and white on black. However, if all the items are at slightly different positions, unlike the picture, i.e. different x,y positions and different angles, then can I distinguish each one, from a single "Scan"?

Thanks.


texts: Difference between these two integrators

texts:
I am an electrical engineering student but new to digital signal processing. However while searching references for my senior project I came across following two different discrete integrator blocks in a MATLAB - Simulink simulation and I can't identify what these blocks do. I am familiar with continuous time integrators but this is quite new thing for me.

The above block -  Ts(z+1)/2(z-1)  is discrete time integrator with upper and lower saturation limits defined and that's all I got to know about upon clicking on it, however I want to know what does exactly that (z+1) and (z-1) means and how is it different from one shown below (KTs/(z-1)):

To the best of my knowledge above integrator is one which is direct discrete counterpart of continuous time integrator (correct me if I'm wrong), essentially Ts means it multiplies sampling time as essential in integration and 1/z-1 is inverse z-transform of a[k] = -u[-k] , right? But even if that's right, I don't understand what that term is doing here.
If my that understanding is right, what does the integrator in first block wants to tell me?
Also, the integrator in first picture is a PI torque controller, it produces reference torque command based on speed error and so that integrator is "I" block of "PI", I think but why is it different from the one in last pic. The one in last pic just... 'integrates'...much like it's continuous time counter part.
Thanks in advance and bear with my, I'm very new to this stuff.


texts: How can I better extract the hidden images in FEZ's soundtrack?

texts:
I believe I have found a (new?) secret in FEZ's soundtrack, but my visualizer isn't clear enough to capture it 100%.
In FEZ's soundtrack (by Disasterpeace), there are "secrets"- stuff like encoded images. These exist in almost all of the songs, even some of the more atmospheric ones. The game is about a shift in dimensional perspective, like from 2D to 3D and back, and the soundtrack represents that same shift beautifully when you pull up a spectrogram.
Every note is deliberate, in either creating an emotion or image, or even just setting up the rest of the song. White/blurry noise is used to create a sense of space, while mirrored sounds (high-low frequency, like a guitar playing the opposite notes, ascending instead of descending) give a sense of either spookiness or The Ancient Ones (the space squids that mastered the fourth dimension or whatever). Every. Single. Track... has either a secret, is atmospheric for the hell of it, every note deliberate. Disasterpeace did a good job on not making any "throwaway" tracks.
So while messing with setting up a spectrogram for streaming, I remembered the FEZ soundtrack existed, and had a listen to my favorites... and saw something regular. Very regular. HORIZONTALLY, not just the usual vertical of drums or shifting horizontal lines/planes of synths. Tweaking the settings, I got the best screencap I possibly could, but as you can plainly see without the context of the game, it's too blurry to properly see anything besides the telltale grid and tiny lines within, juuuust clear enough to recognize a few, but not enough to read at all.
The song is Sync by Disasterpeace.
This is the original capture:

This is the same image but cropped with the context on top:

Original Upload - Imgur
This is the FEZ alphabet (for reference), in case you don't know what you're (possibly) looking at:


texts: (Radiation) Pulse detection and height characterization when pulses are stacked

texts:
Edit: Title
Edit2: Clearer picture of low count rates.
Edit3: Added 2nd sentence for context.
Edit4: Added deconvolution attempt
I've been looking at some scope traces I took of radiation. This is a trace taken from a Geiger Muller (GM) tube. My DSP is really rusty and I can't even remember what to call some of this.
To start off, I've got a signal like the following, at low rates this is fairly simple to find the peak and identify the height. I just take the 503 - the peak.

Sometimes events stack up and at first I was content to just use the value of each point relative to the dotted line.

As the pulse rate gets higher this starts to become more of a problem. And my peak detection starts to miss more and more.

I can do a high pass filter to get rid of some of the noise and that helps a fair amount. However I'm having trouble finding the sweet spot between cleaning the signal, ringing at the peaks, and phase/amplitude shifting the signal. Below is a Butterworth lowpass.

I'd like to also be able to characterize the height based on the distance moved and I'm thinking I can find the high peaks and do some logic to try to make a reasonably accurate estimations.

My end goal is to get a histogram of the pulse heights and distances between pulses. The following is an example based on the peak point vs the purple dotted baseline shown in some of the other plots.

But I feel like I'm well into the weeds at this point and my question is this.
Does anyone have any suggestions on how to improve this or a different approach I can take? I have a vague recollection of some FIR (I think its FIR anyway) filters that can "transform" pulses like this but nothing is jumping out at me in my searches.
Thanks for reading if you made it this far.
High level view. Note the "Bananas" level has so many micro pulses its making the large pulses consistently spaced.

Update
Deconvolution Attempt:
Following one of the suggestions below I tried to find pulses via deconvolution. I say attempt because I'm obviously missing something.
from scipy import signal

single_peak_l_edge = find_nearest_position(raw_dat["Time"], -0.000115)
single_peak_r_edge = find_nearest_position(raw_dat["Time"],  0.0002)
single_peak = raw_dat[single_peak_l_edge:single_peak_r_edge].copy().reset_index(drop=True)

print(raw_dat.head())
print(single_peak.head())

decon, remainder = signal.deconvolve(raw_dat["Channel A"], single_peak["Channel A"])

fig, ax = plt.subplots(1, 1)
ax.plot(single_peak["Channel A"])
ax.set_title("Template")

fig, ax = plt.subplots(2, 1, sharex=True)

ax[0].plot(raw_dat["Channel A"])
ax[0].set_title("Origional")
#ax[0].set_xlim(0, 40e3)

ax[1].plot(decon)
ax[1].set_title("Deconvolved")


texts: Does Function to Function Multiplication and Convolution, Follow Laws of Convolution

texts:
Apologies this is long – I do not want to leave any ambiguity.

I have a hopefully simple question, that does not seem to be covered by the DSP books I have in regards to theory of operation.

I will use the ‘*’ as the operation for convolution, and ‘x’ to denote multiplication. For multiplication, the operation is an element by element multiplication, as opposed to a constant multiplication.

Assume that there is a continuous sine wave, which will be sampled at 192kHz, with frequency 1kHz and amplitude 1, which lasts for 1 second, denoted as sin(n).

We also have the rectangular function, with the same sample rate, which lasts for 5ms, about the centre of the 1 second interval, denoted as rect(n).

There is a filter function that based on the sample rate has a cut off at 24kHz, is defined as symmetrical, linear phase, and has 501 taps – denoted as h(n).

What I want too know is, are the two operations described below valid in terms of LTI systems, convolution, and multiplication, and the distributive/associative/commutative laws.

Process A). The sine wave is multiplied by the rectangular function to produce a truncated sine wave, which starts and ends at the zero crossing of the sine wave. Essentially creates a gated sine wave. The resultant truncated sine wave is then applied to a filter – convolution.

 rect(n) x sin(n) = A(n)    →     A(n) * h(n) = Q(n)

Process B). The sine wave is convolved with the filter, and the rectangular function is convolved with the filter, and the result of the two outputs, are then multiplied together.

sin(n) * h(n) = B(n),       rect(n) * h(n) = C(n),    B(n) x C(n) = R(n)

The question is, is Q(n) = R(n) ?.

I used Octave to implement this, and they are not the same, but the errors are small, and visually the Process A output looks different to Process B output about the rectangular function discontinuities.

[Reason for asking this question : it has been claimed -

You have two input functions:
1) a sine
2) a boxcar function
The product of the two gives you the gated sine. You present this to a steep linear phase filter. This filter then rings, not because of 1), but because of 2). 1) occupies a single spectral line,but 2) occupies an infinite spectrum.
As the filter is a low-pass and linear phase it spreads function 2) to the left and to the right of the time interval it originally occupied. The sine itself is not affected by the filter because it resides entirely in the passband. So if you then cut out the sine part and join the two ringing parts then you are looking at the ringing as caused by a boxcar.]

Thanks and Regards,
Code_X


texts: Negative bias in sample auto-correlation of uncorrelated time-series

texts:
I am using the following definition for the sample auto-correlation:

$AC_x(l)=∑_{i=1}^{N-l}(x_i-μ)(x_{i+l}-μ)$    ;    $μ=\frac{1}{N}∑_{i=1}^Nx_i$

I have noticed that this definition introduce a systematic negative bias to the results due to the subtraction of the sample mean. I calculated the auto-correlation of a white noise sample and after repeating that for thousands of realizations and averaging them in each time lag, I got that bias (attached are my code).

I was really surprise at first, but then, I calculated $E(AC_x(l))$ ($E$ for expectancy value) by hand and got: $E(AC_x(l))=-(1-\frac{l}{N})E(x_i^2)$ $^1$ (for $l>0$). This is the exact pattern I got in my simulations.

So, my question is how should I interpret that? And which definition I should use for auto-correlation in order to get the intuitive result of $\delta(l)$?

def autocorrelation(x):
    x_mean = np.mean(x)
    x_var = np.sum((x-x_mean)**2)
    corrs = []
    for i in range(len(x)):
        test_x1 = x[:(len(x)-i)]
        test_x2 = x[i:]
        corrs.append(np.sum((test_x1 - x_mean) * (test_x2 - x_mean)) / x_var)
    return np.array(corrs)

s = np.random.normal(size=(10000, 10))
corrs = np.array([autocorrelation(s[i]) for i in range(s.shape[0])])

plt.figure(figsize=(4*3, 3*3))
plt.errorbar(np.arange(1, corrs.shape[1]), np.mean(corrs[:, 1:], axis=0), st.sem(corrs[:, 1:], axis=0))
plt.xlabel('time lag')
plt.ylabel('correlation')
plt.xticks(ticks=np.arange(1, corrs.shape[1]))
plt.show()

$^1$ A full proof of the bias expression:

\begin{align}
E(AC_l (x))&=E(\sum_{i=1}^{N-l}(x_i-μ)(x_{i+l}-μ))\\
&=\sum_{i=1}^{N-l}E((x_i-μ)(x_{i+l}-μ))\\
&=\sum_{i=1}^{N-l}E(x_i x_{i+l}-x_i μ-x_{i+l} μ+μ^2 )\\
&=\sum_{i=1}^{N-l}E(x_i x_{i+l} )-E(x_i μ)-E(x_{i+l} μ)+E(μ^2 )\\
&=\sum_{i=1}^{N-l}E(x_i x_{i+l})\\
&\phantom{=\sum_{i=1}^{N-l}}-E\left(x_i\frac {x_1+⋯+x_N }{N}\right)\\
&\phantom{=\sum_{i=1}^{N-l}}-E\left(x_{i+l}\frac {x_1+⋯+x_N }{N}\right)\\
&\phantom{=\sum_{i=1}^{N-l}}+E\left(\left(\frac {x_1+⋯+x_N }{N}\right)^2\right)\tag{a}
\end{align}

Now, for $i\ne j$: $E(x_i x_j )=E(x_i )E(x_j )=0$, because they are independent and each with 0 mean, therefore a lot of mixed elements will fall off, and we will stay with:

\begin{align}
&=\sum_{i=1}^{N-l}\left(-E(\frac{x_i^2}{N})-E(\frac{x_{i+l}^2}{N})+E(\frac{x_1^2+⋯+x_N^2}{N^2})\right)\tag{b}\\
&=\sum_{i=1}^{N-l}\left(-\frac{E(x_i^2 )}{N}-\frac{E(x_{i+l}^2)}{N}+\frac{E(x_1^2)+⋯+E(x_N^2)}{N^2}\right)\tag{c}
\end{align}

$x_i$ are identically distributed, therefore:

\begin{align}
&=\sum_{i=1}^{N-l}\frac{-NE(x_i^2 )-NE(x_i^2 )+NE(x_i^2 )}{N^2}\\
&=\sum_{i=1}^{N-l}-\frac{E(x_i^2 )}{N}\tag{*}\\
&=-\frac{N-l}{N} E(x_i^2) \\
&=-(1-\frac{l}{N})E(x_i^2)
\end{align}

And this is exactly what the simulation shows for N=10


texts:
I am trying to listen VLF radio signals. I have a recorded wave file (download) and here is the frequency spectrum:

I have produced this spectrum using this matlab code:

signal= wavread('/Users/ecabuk/Downloads/DR0000_0165.wav');
X_mags = abs(fft(signal));
bin_vals = [0 : N-1];
fax_Hz = bin_vals*fs/N;
N_2 = ceil(N/2);
plot(fax_Hz(1:N_2), 10*log10(X_mags(1:N_2)))
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)');
title('Single-sided Magnitude spectrum (Hertz)');
axis tight

It has two clear picks near at ~24KHz and ~25KHz.

How can I crop 24KHz and then return to time domain and save as a wave file, so I can hear that. (and same thing for 25KHz of course)

I am not sure but am I trying to make a Demodulation process?


texts: How can I get rid of this unexpected minus sign on my inverse Fourier transform of two impulse functions?

texts:
I'm trying to find the inverse Fourier transform of two impulse functions, which correspond to the Fourier transform of the function $h(t)=A\sin(2πf_0t)$.
The Fourier transform of the above sine function is as follows:
$$H(f)=j \frac{A}{2} \delta\left(f+f_0\right)-j \frac{A}{2} \delta\left(f-f_0\right)$$
When I try to find the inverse Fourier transform of $H(f)$, I keep getting a minus sign which is not in the original time-domain function. Here is my procedure:
\begin{align}
h(t)&=j \frac{A}{2} \int_{-\infty}^\infty\delta(f+f_0 ) e^{j2πft} df-j \frac{A}{2}\int_{-\infty}^\infty\delta(f-f_0 ) e^{j2πft}df\\
&=j\frac{A}{2}e^{j2πf_0t}-j\frac{A}{2}e^{-j2πf_0t}\\
&=jA\left(\frac{e^{j2πf_0t}-e^{-j2πf_0t}}{2}\right)\\
&=-A\left(\frac{e^{j2πf_0t}-e^{-j2πf_0t}}{2j}\right)\\
&=-A\sin(2\pi f_0t)
\end{align}
THAT is the minus sign that, so far, I've been unable to get rid of!
What is it that I am missing here? I hope you can help me!
Thank you very much!


texts: Why does the representation of the filter matter? How explain it to people outside signal processing theory?

texts:
Recently I was able to solve a problem on concerning filtering by changing the representation from zero-pole-gain to 2nd-order-section when dealing with higher sampling rate data.

But: What do representations do to the function of the filter? Why did this work?


texts: Texture detection and region properties on an image

texts:
I have an interesting problem that I'm trying to solve. So for example, if we have a black and white image containing two textures (A and B), I'm interested in knowing the pixel values of the boundaries that would completely cover the individual textures.

I thought of using cross correlation, which would give me a cluster of the positions, of the template (legends) on the image but is there a way to use that to get the pixel values of the boundaries (these are typically irregular)? Also, is there any other better way of doing this?

A real world example of this would be in detecting the regions of rainfall on a map showing three levels of rainfall in a year. Each level is assigned a texture thats present in the legend, which is used for texture matching on the same image.


texts: What does $[-\pi \; \pi]$ band-limited signal mean?

texts:
I know that a band-limited signal is a signal which have a limited set of frequencies.

What is then the  relation between band limiting and $[-\pi \; \pi]$  since $-\pi$ and $\pi$ are related to angles and frequencies are in Hertz ?


texts: How auto release works in dynamic range compressor

texts:
Could anyone help me to understand how auto release mode works in audio dynamic range compressor?

After I typed "auto release" in seatch box on that forum I get "0 results".


texts: Simple FFT convolution with impulse response wav file doesn't give the right results

texts:
I have been trying to find a solution to my FFT convolution problem but everything that I have found while searching hasn't been helping me.

I have a working forward and backward FFT function, that I have tested with perfect results. A wav file that I ran through the forward FFT came out with a result of a frequency domain data, ran this domain data backwards again and back came a nice sounding waveform.

Here's the problem; I have now tried to put forward FFT to a pre-recorded piano sound (wav) a file with only one note and no dead silence. Then I've done the same to an IR-file (wav) of a room reverb, took the results from these two forward FFTs and tried to convolve them with the following code (the res_ir buffer has been scaled to have values between -1 to +1 before this):

long bufSize = 1024*62;
mFFT->runFFT(res, bufSize);
mFFT->runFFT(res_ir, bufSize);

double a=0;
double b=0;
double c=0;
double d=0;
for (int i=0;i<bufSize;i++)
{
     a=res[i].re();
     b=res[i].im();
     c=res_ir[i].re();
     d=res_ir[i].im();

    res[i].mRe = (a*c - b*d) * (gain);
    res[i].mIm = (a*d + b*c) * (gain);
}
mFFT->runIFFT(res, bufSize,true);

I'm not looping through the complete wave file but just the size of one really big FFT buffer (1024*62), this to make it easier for me to follow and to eliminate extra possible bugs or errors keeping the problem down in size.

the result I'm getting is just the IR wav sound shaped somewhat like the piano file, but it sounds like the "starter gun" from the IR file (no piano sound at all).

Here's an image if the results (starting from above, first is the IR wav with the starter gun, second is the piano wav and last is the result from this):

Someone who can help me find what or where to dig for answer to this problem?


texts: Distortion of a signal consisting of two periodic components

texts:
We have a signal
$$x(t)=U_1\cos\omega_1t+U_2\cos\omega_2t$$
whose frequencies are $f_1=100\,\text{Hz}$ and $f_2=600\,\text{Hz}$. This signal is being discretisated in time using unipolar rectangular pulse with 1 V  amplitude, length $\tau$ and period $T=\frac{1}{f_0}$. Can we reconstruct this signal without distortion if we use ideal low-pass filter if sampling frequency is:
a) $f_0=1\,\text{kHz}$
b) $f_0=1.3\,\text{kHz}$

My attempt:
when we want to tell whether we can or cannot reconstruct original signal when sampling with specific frequency we compare sampling frequency with the frequency of the given signal, sampling frequency must be at least as twice big as signal frequency (NYQUIST criterion). However i cannot determine frequency of this signal since it has two components.
Since we are doing time discretisation with rectangular pulse we want to find fourier transform of $f(t)=x(t)s(t)$ where $s(t)=\sum_{n=-\infty}^{\infty} \frac{\tau}{T}sinc(n\omega_0\tau/2)e^{jn\omega_0t}$.
I know that multiplication in time is convolution in frequency but i don't know how to implement it in this case since
$X(j\omega)=\frac{U_1}{2}2\pi\delta(\omega -\omega_1)+\frac{U_1}{2}2\pi\delta(\omega +\omega_1) + \frac{U_2}{2}2\pi\delta(\omega -\omega_2) + \frac{U_2}{2}2\pi\delta(\omega +\omega_2)$
How can i do that and how can i tell, when i find fourier transform, if signal can be reconstructed or not?
Any help appreciated!


texts: Time invariance and linearity of recursive system

texts:
I am confused about the definition of linearity and time invariance of recursive system

Given $$y[n] = y[n-1] - y[n-2] - x[n]$$

To test time invariance, we shift the input $x[n]$ for shifting and see if the output $y[n]$.

Now, does shifting the input include the recursive terms?

That is if we shift the input by k, then we get
$$y[n-1+k] - y[n-2+k] - x[n+k]$$

and when the output is shifted we get

$$y[n+k] = y[n-1+k] - y[n-2+k] - x[n+k]$$

and thus the system is time-invariant?

I have the same question with regard to linearity.


texts: Gray Level Dependence Matrix applied to time domain signals

texts:
It make sense to calculate gray level dependend matrix on al time domain signal in order to extract features related to that matrix?

I have EEG signals from stroke people in the time domain.  My goal is to classify from the signal the level of recovery from the stroke (I have also some scale to quantify the recovery).

I tried different classification pipelines but I achieved good results only extracting features related to the GLDM calculated directly from the time courses.

Since I'm no expert in texture analysis I was wondering if make sense to compute the GLDM matrix from a time varying signal instead an image.

I also tried to transform the time signal into a recurrence plot and then compute the GLDM but I didn't achieve good results.


texts: Large spike at beginning of signal after applying Bandpass filter

texts:
Foreword: I am a PhD student and fairly unexperienced with many signal processing and engineering concepts, please be gentle.

I am attempting to filter out a frequency range of 1Hz to 2Hz from a 2.4GHz CSI amplitude signal, however after applying a butterworth bandpass filter I observe a large spike at the beginning of my signal. If I remove the first 100 or so samples from my signal, this has no effect on the spike. I have attempted this using both Python (with scipy's lfilter), and MATLAB (with butter and filter), and have observed the same behaviour in both. I am aware there are variations of these filter methods, however perhaps I do not understand which one I should be using. I am attempting to replicate this work.

The signal is comprised of roughly 60 OFDM subcarriers, which are all plotted in my example.

Where:

buttOrd = 2
fcutlow = 1
fcuthigh = 2
Fs = 9.7

MATLAB:

[b, a] = butter(buttOrd, [fcutlow fcuthigh]/(Fs/2), "bandpass");
filterSig = filter(b, a, signal);

Python:

b, a = signal.butter(buttOrd, [fcutlow/(Fs/2), fcuthigh/(Fs/2)], "bandpass")
filterSig = signal.lfilter(b, a, signal)

Above: Unfiltered signal.

Above: Filtered signal.

By reducing the range given to the bandpass filter to something much smaller, like 1Hz-1.01Hz, a smaller, consistent signal can be observed. I understand why a smaller range would produce a different response, but I don't understand the specific behaviour I'm observing.


texts: Difference between bandpass filter and using fast fourier transform to extract power of frequency bands

texts:
In signal processing, I have heard of two terms:

Using band-pass filter to extract some frequency bands.
Using Discrete/Fast Fourier Transform (DFT/FFT) to extract some frequency bands.

Are these two terms similar or different?

How and when we use each of these methods?

Thanks in advance


texts: Accuracy of time domain signal when one frequency is absent

texts:
Suppose the known frequency spectrum of a signal is:
$$
G(n\Delta f)=9,4,3,5,1,6,...
$$
where $n=0,1,2...$ and $\Delta f=1$ Hz

If, for some reason, we cannot sample $G$ at $n=0$ (i.e. $G(0)=9$ is not available), but can sample the frequencies everywhere else, including at finer $\Delta f$'s.

What can we do to minimize the error of the recovered time-domain signal $F(t)$?

For example, how fine $\Delta f$ should be? How many frequencies needed to be sampled? Can we use the discrete Fourier transform or should we use the continuous Fourier transform by interpolating the shape of $G$? etc.


texts: Harris Corners Detector squared derivatives

texts:
I have trouble understanding something (small) regarding the math behind Harris Corners Detector.
(for example I looked at this explanation - https://aishack.in/tutorials/harris-corner-detector/)

In the equation we get there are squared derivative matrices - $I_x^2, I_y^2$ and also $I_x \times I_y$. I've seen code implementations of this around the web, and it seems to me that these multiplications are element-wise.
My question why? I thought that when you take the square of a matrix it should be matrix multiplication, and not element-wise multiplication...

I'd really appreciate some clarifications regarding this,
Thank you


texts: Distinguishing Spoken Speech from Played-back Recording of Speech

texts:
Do any general-purpose techniques exist to distinguish live spoken speech from played-back speech samples? For example, if I were to deploy a speaker verification system to authenticate users by voice, I would not want the system to be able to be spoofed by playback of voice recordings.

I think I can imagine at least one technique which might work for certain known combinations of microphones / speakers: If a microphone of sufficient quality captures a novel signal outside the speech band that corresponds (in time) to a signal within the speech band, this would seem to indicate a high likelihood of the sample not being a live speaker (because live speakers don't emit signals outside the speech band). Is this reasoning sound? (No pun intended).


texts:
What is difference between "Direct form" and "Normal Direct form"?
I was reading about filters implementations(structures) and found out both words "direct form"and "normal direct form" especially in proakis,2nd edition as shown highlighted in attached snapshot


texts:
This is my first question at this site, please excuse me if I'm not asking the question properly.

I have an acoustic signal of a test and I want to remove the "thin" peaks, because they don't really affect the structure that I'm studying. For that I've thought of a Low pass filter in order to retain only frequencies below 300 Hz.

My aim is to count the peaks of the filtered signal above 3 sigma (Standard Deviation).
I'm programming in C# and I don't know if there is a direct (and simpler way) of doing this but what I'm doing now is

Discrete Fourier Transform to my signal (SPL/s -> SPL/Hz)
rescale what I obtain (bins = sampling frequency)
Cut frequencies above 300 Hz
Inverse DFT

It seems logical to me but I'm not sure if I'm doing it correctly.
I have this little problem while doing the FT, is that I don't know how to scale properly the magnitude axis (y): if I transform and then I do the inverse transform I don't get the original signal but an attenuated one. What's happening here?

And my other question is about the symmetric nature of a FT. If I do a Fourier Transform to my signal I get a mirrored spectrum that goes till 8000 Hz, can I simply cut at my desired frequency (is what I'm doing now)? Thanks for your time.


texts:
I am having trouble calculating my Energy per symbol and Es/No. Using these parameters and equation
$N_s = $Number Symbols
$R_s = $Symbol Rate
$T_s = $Symbol Time
$sps = $samples per symbol
x = signal = QAM-16 with no noise added
Then using these, two equations:
$E_s = E_{total} / N_s = sum(abs(x)^2) / N_s $
$E_s=P_{avg} / (sps/R_s)  = P_{avg} sps T_s$
This second equation comes from Energy = Power x Time. So Energy per symbol = Power x Time for Symbol, but my symbol spans more samples because its upsampled, one symbol spans sps samples. So Energy per symbol = Power x time for symbol x sps.
Where
$P_{avg} = sum(abs(x)^2) / N $
N = Number Samples
I have tried both equations after the RRC transmit and after the RRC receive filters, both times these equations give two different answers.
First equation gives a very large number and the second is incredibly small number in comparison. Ive tried removing sps from the second equation but does not get anywhere close to first equation.
Ultimately I need to work out Es/No and I cant get Es right.  Any thoughts please? :/


texts: LPF and HPF Confusion - Rectangular and Circular Cut-Offs

texts:
Interpreting some homework, I'm a little confused on what it's asking for. I'm asked to filter in the frequency domain (easy enough, just a fft2 and ifft2 when I'm done) a 256x256 8bit grayscale tiff with the following filters:

"Rectangular low pass filter using cutoff frequency of
(uc=N/4,vc=M/4) where N and M are the row and column sizes of the
image."
"Circular low pass filter using cutoff frequency of Circular
filter the cutoff frequency is given by Rc=N/4= sqrt[(uc)^2+(vc)^2]
where N and M are the row and column sizes of the image"
"Rectangular high pass filter that has the same cutoff as part a."
"Circular high pass filter that has the same cutoff as part b."

Now, I understand some of this well enough, but the "Rectangular/Circular" throw me.  We didn't really cover anything like that.  What we did cover were the ideal low/high pass filters and the butterworth low/high pass filters.  Is this perhaps a synonym for the two, the ideal with its immediate cutoff and the buttworth with its tapering? My book does not mention anything in this regard (though perhaps I have not found it...the book is verbose and I am an impatient student at times), only that the general form it gives for the Ideal filters is a circular cutoff, which is what prompts my second supposition: that the circular is the method the book uses, and the rectangluar means to filter anything inside a submatrix one quarter the size of my image, centered, in the frequency domain.

Or are we talking two different kinds of ideal LPFs and HPFs,

Yes, this is homework for a course, but I'm not looking for easy answers.  I'm looking for understanding.


texts: Confused on the difference between the frequency spectrum of an entire song, and the frequency spectrum of a point in time

texts:
I am very much a beginner in this field - but find it really interesting. However I am a little confused on a certain area of knowledge.

If I have understood correctly:
At any point in an audiosignal, for instance when someone is strumming a D-Major on a guitar, i can reproduce that exact sound in that moment by looking at the frequency spectrum for that time, do a Fourier Transform, and recieve a periodic signal in the time domain presented as a fourier series. If I play that signal, I will hear the sound that was in that exact moment of a song, just as a never ending note. In this scenario the frequency spectrum tells me what pitches were played- and the frequency domain will change for point in time.

However, If a look at a three-minute-song in the time domain, I dont quite understand what the fourier-transform will tell me. If I have this audiofile, and I view it in the timedomain, what will it tell me? (view picture)
And if I transform it to the freq. domain, what will it tell me?

As far as my logic goes, I wont ge able to tell any of musical features just of an amplitude value in the time domain.

(And the confusion continues when we sample an audiosignal, and all we get is an amplitude value for a given time. How can any musical information be there?)

Thanks for answers.


texts: Effective field in MRI when solving for Bloch equations

texts:
I have a confusion regarding MRI signal formation. So, as I understand it, we need to solve the Bloch equations for the excitation and the relaxation stages:

So, in the excitation stage, let us assume that we have an RF field excitation which is applied along with the slice selection gradient. The bloch equations are given by:

$$
\frac{dM}{dt} = \gamma M \times B - R
$$

where $R$ is the vector accounting for the relaxation effects. Now, during excitation, the B1 field is on and as I understand it, the B vector is given as:

\begin{align}
B_x &= B_1 \cos(\omega t)\\
B_y &= B_1 \sin(\omega t)\\
B_z &= z G_z
\end{align}

The $B_z$ field is basically the gradient times the position offset from the origin and the $B_x$ and $B_y$ fields are the real and imaginary parts of the B1 waveform.

Now, when the B1 field is turned off, I think $B_x$ and $B_y$ components should be 0. However, let us assume that we have a readout gradient on when we are sampling the MR signal.

What will contribute to the $B_z$ field now? Assuming that the RF excitation is with a 90 degree pulse and after the excitation the magnetization vector lies completely along the $Y$ axes.


texts: Is it possible to combine two Sobel kernels into one?

texts:
sobel-y --> [ 1   2   1]
                             [ 0   0   0]
                             [-1  -2  -1]

                sobel-x -->  [1  0 -1]
                             [2  0 -2]
                             [1  0 -1]

Is it possible to combine two Sobel kernels (x-direction, and y-direction) into one and then convolve that with an image?

The idea is that, I already have an Convolution function written. I would be able to reuse it in that way.

Update:

I tried Fat32's suggestion of applying X and Y kernels sequentially.

Input:

Expected Output:

Present Output:

Looks like my filter isn't producing the correct output.


texts: PyWavelets CWT: resampling vs recomputing wavelet

texts:
Related. The implementation pre-integrates a wavelet once, and resamples it at each scale, finally differencing to implement below:
$$
C_{a, b} = \frac{1}{\sqrt{a}} \sum_k s(k)\left( \int_{-\infty}^{k+1} \overline{\psi \left(\frac{t-b}{a} \right) }dt - \int_{-\infty}^{k} \overline{\psi \left(\frac{t-b}{a} \right) }dt \right)
$$
But it also does * sqrt(scale), whereas above we're clearly dividing; what's the deal? And how's it compare to actually recomputing the wavelet at each scale?


texts:
Over on the TeX stackexchange, we have been discussing how to detect "rivers" in paragraphs in this question.

In this context, rivers are bands of white space that result from accidental alignment of interword spaces in the text. Since this can be quite distracting to a reader bad rivers are considered to be a symptom of poor typography. An example of text with rivers is this one, where there are two rivers flowing diagonally.

There is interest in detecting these rivers automatically, so that they can be avoided (probably by manual editing of the text). Raphink is making some progress at the TeX level (which only knows of glyph positions and bounding boxes), but I feel confident that the best way to detect rivers is with some image processing (since glyph shapes are very important and not available to TeX). I have tried various ways to extract the rivers from the above image, but my simple idea of applying a small amount of ellipsoidal blurring doesn't seem to be good enough. I also tried some Radon Hough transform based filtering, but I didn't get anywhere with those either. The rivers are very visible to the feature-detection circuits of the human eye/retina/brain and somehow I would think this could be translated to some kind of filtering operation, but I am not able to make it work. Any ideas?

To be specific, I'm looking for some operation that will detect the 2 rivers in the above image, but not have too many other false positive detections.

EDIT: endolith asked why I am pursuing a image-processing-based approach given that in TeX we have access to the glyph positions, spacings, etc, and it might be much faster and more reliable to use an algorithm that examines the actual text. My reason for doing things the other way is that the shape of the glyphs can affect how noticeable a river is, and at the text level it is very difficult to consider this shape (which depends on the font, on ligaturing, etc). For an example of how the shape of the glyphs can be important, consider the following two examples, where the difference between them is that I have replaced a few glyphs with others of almost the same width, so that a text-based analysis would consider them equally good/bad. Note, however, that the rivers in the first example are much worse than in the second.


texts: Properties of convolution same as LTI systems?

texts:
I have attached a snapshot from "signal processing first "
Where author says that properties of LTI systems are same as properties of convolution as shown in attached snapshot

Are these properties exactly same for both cases,convolution and LTI systems?and we don't need to apply any scaling etc?


texts: Can a state space model have changing state size over time?

texts:
I have worked with state space models in relation to Kalman estimation. Here I have always seen state space models with fixed state size over time, i.e. the state transition matrix is square.
Let us for example define:
$$x_{t+1} = A_t x_t + B_t u_t\\
y_t = C_t x_t + D_t v_t$$
Then $A_t$ is $n \times n$.

I suppose I could easily allow the state to change size at time $t_\text{change}$ by allowing $A_{t_\text{change}}$ to be of size $m \times n$ where $m\neq n$. Is this "allowed" in state space models in general? And does this entail any problems in applying a Kalman filter to estimate the state $x_t$ for $t$ "across" the point $t_\text{change}$?


texts: I am trying to implement the paper "Face Reconstruction in the Wild". In that I use a template 3D model and rotate it to align it with the orientation of the face in the 2D image. Now I want to project the 2D image onto the rotated 3D model. Could you please help me regarding how to do this. The paper gives no references for this so I think there might be an obvious solution I'm missing.


texts: Is gradient vector of pole zero carry usful information?

texts:
Consider a transfer function (TF) with $n$ number of poles $(p_1,..p_n)$ and $m$ number of zeros $(z_1,..z_n)$.  One can write the magnitude of the frequency responce of the TF in terms of poles and zeros.

This means one can take partial derivative of the magnitude of the TF with respect to each pole and zero for a paticular frequency. Now consider $f_1$ is the frequency at which TF is deviated most from the desired responce. Thus one can change the poles and zeros based on the gradient of the magnitude of TF at $f_1$ and optimize the poles and zeros for $f_1$. Can one can keep doing this procedure for each frequency until a desired result is obtained? Is this a valid process of filter design?

Any comment would be appreciated.


texts: Determination of periodicity in data and finding mean

texts:
I have to find whether there is any pattern (I mean periodicity or close to periodicity) and if there is, for one cycle i have to perform numerical integration to determine mean. In the first picture I have done moving average(every 254 data points) using excel.

Then in the next picture i have done again moving average(with 250 points) using the data got after performing first moving average.

I have also thought about doing Fourier transform.
These datas are values of cl (lift co-efficient) vs time in a unsteady solution of CFD simulation.Variation of values at initial time steps are not significant as some time is needed for simulation to give exact value.  DATA file is here (drive.google.com/open?id=0B1KEir1gFkaMQW5GbmFoZlpRUVk)


texts: Determine if system is linear time variant

texts:
The system equation is given as:
$$y(n)=(n-1)x(n-1)+(n+1)x(n+1)$$
I solved that the system is time variant:
\begin{align}
y(n-k)&=(n-k-1)x(n-k-1)+(n-k+1)x(n-k+1)\\
H[x(n-k)]&=(n-1)x(n-k-1)+(n+1)x(n-k+1)
\end{align}
And for the linear/non-linear part, here is what I have so far:
\begin{align}
H\big[a_1x_1(n)+a_2x_2(n)\big]&=(n-1)\big[a_1x_1(n-1)+a_2x_2(n-1)\big]\\&+(n+1)\big[a_1x_1(n+1)+a_2x_2(n+2)\big]
\end{align}
It is ok?


texts: MATLAB Plot of FT(Cos) Displays Weird Impulse

texts:
It is known that:
$$
\mathcal{F}\{\cos(2\pi t)\}=\frac{\delta(f-1)+\delta(f+1)}{2}
$$
However, on MATLAB, I used F=fftshift(fft(x))/N;  to obtain the FT of $\cos(2\pi t)$ and I obtained the following:

My question is why does each $\delta$ appear to be made up of two thin close parallel lines. Note that I have used $1024$ sample points and constructed $f$ a vector from $-51.2$Hz to $51.2$Hz and $t$ a vector from $-5$ to $5$.


texts:
i have a matlab file and i'm trying to understand what's going on.

when i run it, it shows this when i type the command :

this at

and this at

can someone explain to me what increasing the value in  does because i can't seem to understand some of what's going on in the graphs.


texts: What is Fourier transform in terms of area under the curve?

texts: We know that integration gives area under the curve.  And that FT is also an integration.  How do we interpret FT in terms of the area under the curve especially because e^(jwt) is a complex term?  In general, while dealing with complex terms in integration can we relate to some area?


texts: Image not divisable by 8? (JPEG Compression)

texts: I have learned that an image is to be divided by 8*8 blocks, and the 2D DCT is then applied to these blocks. My question is, what if the image is not divisible by 8? What should I do in this case?


texts: Trouble with time-syncing two radio signals using cross-correlation

texts:
I posted a similar question a while ago here (I'm posting this follow-up since I'd like to focus more on cross-correlation now). I have a setup where I have two software-defined radios connected to different antennas, and a circuit switches the antennas on and off at the same time. I am trying to time-sync the two signals as precisely as possible. The radios are sampling at 2.4 MS/s and I'm sampling about 0.2 seconds of data. Even though I've synced the two clocks of the radios, due to slight hardware differences there will always be a slight delay in one of the signals which is why I need to sync them in software. I have a system that is able to sync the signals most of the time just by getting the signal's envelopes and identifying where the antenna switching happens, but this doesn't work so well when the "silence" part is too noisy / too high amplitude, so I would like to use cross correlation.

Here are two of the signals I'm trying to align: s0, s1. I believe the correct delay of s0 should be approximately 1069.

I'm normalizing both signals to have a max amplitude of 1, and I've also tried downsampling to make it lower detail. I'm just doing signal.correlate(s0, s1) and plotting the result, but I don't even see any local maximum at the correct delay (I know the correct delay from the other method).

Here's the plotted correlation:

And here it is zoomed in to where I'd expect the actual delay to be:

There doesn't seem to be any local max around 1069.

Is anyone able to successfully sync these two signals using cross correlation, or is it just not possible for this kind of data? Everyone doing similar project to me uses cross correlation to do the time synchronization, so I'm not sure why it's not working at all for me (even when I use their code). Any help would be greatly appreciated!


texts: What is the Gabor filter? And what are its main uses?

texts:
I'm doing research on the Gabor filter. When I Googled it, I found very long and complicated articles. Can anyone help me to find a simple explanation about it, or recommend a website or article to read?

I want to understand this filter in order to use it in Matlab.


texts:
I'm looking for a simple way to show that you can form a single impulse response that is the equivalent $M$ other impulse responses, ie:

$$
h\left(t\right)=h_0\left(t\right)\star h_1\left(t\right)...\star h_{M-1}\left(t\right)
$$

I know convolution is multiplication in the frequency domain, so I cooked up this "equation":

$$
h\left(t\right)=\mathcal F^{-1}\left\{\prod_{i=0}^{M-1} \mathcal F\left\{h_{i}\right\}\right\}(t)
$$

With $\mathcal F^{-1}$ being the inverse Fourier transform operator, and $\mathcal F$ being the Fourier transform operator. Expressing myself in math notation isn't really my strong side, what I intended to show was that the combined impulse response $h(t)$ equals the sequences multiplied together in the frequency domain.

Does it make any sense?
Or is there perhaps a simple way to show this?
What about circular convolution in the frequency domain, and infinite impulse responses in continuous time?


texts: I wanted to know how observability of a stochastic state space system affects the performance of a Kalman Filter. Do we check for the usual observability matrix involving $\mathbf{C}$ (observation matrix) and $\mathbf{A}$ (state transition matrix) or there is a newer notion of stochastic observability? In case of non-observability, does the error between true and estimated states go out of bound ?


texts: Help me understand this simple code snippet to get the magnitude frequency response

texts:
I inherited the following FFT code to get the magnitude frequency response of a sample window. I understand what fft() does. What I don't understand are the lines marked with a "???". What do they do? In particular the "real[i]/real.length/2" portion and the multiplication and division by 1000 portion.

double[] real = new double[_FFTSize];
double[] imaginary = new double[_FFTSize];

loadDataIntoReal(real);

fft(real, imaginary); // in-place FFT

for (int i = 0; i < spectrum.length; i++)
{
    double reValue =((int)((real[i]/(real.length/2))*1000)/1000.0); // ???
    double imValue =((int)((imaginary[i]/(real.length/2))*1000)/1000.0); // ???
    double value = Math.sqrt(reValue * reValue + imValue * imValue);
    spectrum[i] = value;
}

Each line seems to have a redundant multiplication and division by 1000. However, if I change the code to be the following, then I get slightly different floating-point results, so I guess they must provide some sort of precision.

    double reValue =(real[i]/(real.length/2));
    double imValue =(imaginary[i]/(real.length/2));


texts:
I know whats the difference between various formats such as YUV444,YUV420,YUV422.
But what exactly these numbers mean? They are mentioned as chroma subsampling in horizontal and vertical directions. In YUV420 Cb and Cr are sampled at half the resolution of luma in both vertical and horizontal directions. So what does zero in YUV420 mean?


texts: Hydrophone kit to transmit (and receive) underwater

texts: May I ask you if there exists a complete kit (e.g., by including the amplifier, etc.) of professional hydrophones to transmit and receive signals in underwater environments? If not, can I ask you for help about the configuration and which are the best instruments that can I buy? Scope: Research and Development.


texts:
I'm currently reading about segmentation, and have come across finding edges in an image. I then have this image:

Now, I understand how the mask used for the second-derivative works, and give the values for that, but I can't figure out how the mask for first-order derivative works ?
The second-order 1D mask is just [1 -2 1], but how does the first-order one look like ? If there even is anyone. Of course I do know, that the first-order derivative is just the slope of the line, and from that it's easy to see what the values should be. But mask wise, I'm not sure how it works.

Thanks in advance.


texts: Removing bright lights from image using Matlab

texts:
I want to remove a bright spot in an image. This is the image I used:

and this is the Matlab code I wrote:

clc;                 % Clear the command window.
close all;           % Close all figures (except those of imtool.)
imtool close all;    % Close all imtool figures if you have the Image Processing Toolbox.
clear;               % Erase all existing variables. Or clearvars if you want.
workspace;           % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 18;

%==================================================================
% Read in a color demo image.
folder = 'C:\wamp64\www\EE368_Android_Tutorial3_Server\Stadium 3 Cropping';
baseFileName = '003.png';

% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);

if ~exist(fullFileName, 'file')
    % Didn't find it there.  Check the search path for it.
    fullFileName = baseFileName;         % No path this time.

    if ~exist(fullFileName, 'file')
        % Still didn't find it.  Alert user.
        errorMessage = sprintf('Error: %s does not exist.', fullFileName);
        uiwait(warndlg(errorMessage));
        return;
    end
end

rgbImage = imread(fullFileName);
% Get the dimensions of the image.  numberOfColorBands should be = 3.
[rows, columns, numberOfColorBands] = size(rgbImage);

% Display the original color image.
subplot(2, 3, 1);
imshow(rgbImage);
axis on;
title('Ori  ginal Color Image', 'FontSize', fontSize);

% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);

% Convert to gray scale.
grayImage = rgb2gray(rgbImage);
subplot(2, 3, 2);
imshow(grayImage);
axis on;
title('Gray scale Image', 'FontSize', fontSize);

% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
subplot(2, 3, 3);
bar(grayLevels, pixelCount);
grid on;
title('Histogram of gray image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.

% Threshold to get binary image
binaryImage = grayImage > 225;
subplot(2, 3, 4);
imshow(binaryImage);
axis on;
title('Binary Image', 'FontSize', fontSize);

% Dilate the binary image to tell it what pixels shoudl be used to fill in holes.

binaryImage = imdilate(binaryImage, true(17));

subplot(2, 3, 5);
imshow(binaryImage);
axis on;
title('Dilated Binary Image', 'FontSize', fontSize);
drawnow;

promptMessage = sprintf('Next we will fill the white areas.\nNote: Computing the filled image will take some time.');
titleBarCaption = 'Continue?';
button = questdlg(promptMessage, titleBarCaption, 'Continue', 'Cancel', 'Continue');
if strcmpi(button, 'Cancel')
    return;
end
tic

% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);

% Fill holes
redChannel = regionfill(redChannel, binaryImage);
greenChannel = regionfill(greenChannel, binaryImage);
blueChannel = regionfill(blueChannel, binaryImage);

% Recombine separate color channels into a single, true color RGB image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
subplot(2, 3, 6);
imshow(rgbImage);
axis on;
title('Fixed Color Image', 'FontSize', fontSize);
gray = rgb2gray(rgbImage);
offsets = [0 1;-1 1;-1 0;-1 -1];
[GLCMS,SI] = graycomatrix(gray,'Of',offsets);
stats = graycoprops(GLCMS,{'contrast','homogeneity','correlation','energy'});

toc;

The result is the following.

Maybe someone can help me to fix this. Thanks in advance.


texts: Calculate a Kind of Equivalent Baseband Signal by Examining the Zero Crossing

texts:
I have a device (whose behaviour I can't change) which does the following signal processing:

The incomming signal contains two frequencies $f_1$ and $f_2$. One has a huge amplitude, the other a smaller one:

$x_1 = X_{01} \cdot cos(2\pi f_1 \cdot t)$

$x_2 = X_{02} \cdot cos(2\pi f_2 \cdot t)$

with (for example):

$f_1 = 20.02e6, f_2 = 20e6, X_{01} >> X_{02}$ (Actually $f_2$ is an interfering signal).

An example for this signal (only the beating envelope is visible) is depicted below.

At first, phase durations are calculated by "measuring" the duration between two zero crossings. Then the phase duration of $f_1$ is subtracted - so if $f_2$ wouldn't be there, the phase duration signal would always be zero.
But since there is $f_2$ also, the phase duration signal contains a new periodic signal, beeing periodic with $f = f_1-f_2 = 20kHz$. I get the following signal:

With zoom

My problem is: This signal is not a pure sine wave but it contains some additional frequencies - as already visible in the zoomed phase signal. The DFT shows the containing frequencies (which are harmonics). They are depicted below.

Does anyone know an equation for the amplitudes of those frequencies as a function of the amplitude and frequency of $X_{01}$ and $X_{02}$?

To make it more complex, I unfortunaly have a second interfering signal at $f_3=19.08e6$. Is there an equation for this case, too?


texts:
I am the author of an amateur radio application that produces a waterfall display across a range of frequencies. Time is on the $x$-axis, frequency is on the $y$-axis, and the relative strength of each signal is depicted by the intensity of color.

Some of the signals have, what are called, "key clicks". That is, at the start and end of each signal, the bandwidth of the signal is wider than the steady-state bandwidth. An example is shown below:

[1] http://www.kkn.net/~n2ic/key_clicks.jpg

These are actually present in the signal - They are not artifacts of my DSP processing. I would appreciate suggestions on how to filter out the key clicks.


texts: Is there an algorithm to compare several pictures?

texts: I'm looking for an algorithm to store small dimensions of some pictures and later search on the stored data for matches similar to a new picture. Maybe something with Self Organizing Map in machine learning ?


texts:
Can two modulations be used in the same frame?
For qam/qpsk/psk/ modulation scheme for the data bits can i have a fixed preamble with psk modulation?
does this help in achieving faster carrier freq lock and timing lock?


texts: Complex numbers in a frequency domain of a 2D image

texts:
I am try to grasp the idea of frequency domain for images. I think get the basics, but now I've stuck with a question that I can't find appropriate answer anywhere.
How are frequency domain and complex numbers in relationship?
I've read this article from DSPguide and I understand that after applying DFT to an image in spatial domain, we get two planes: real and imaginary plane. By doing some calculations, we can get amplitude and phase planes. For what is the phase plane used for?


texts: Distinguish harmonic sounds from non-harmonic

texts:
I am trying to distinguish harmonic sounds in the range from $100\rm \ Hz$  to $1000\rm \ Hz$ in my audio recording.

I attach the spectrogram ($y$-axis is freqeuncy and $x$-axis is time) of a typical audio recording. The red square shows the harmonic sounds I want to distinguish, whereas the green one - the random sounds which I want to omit.

I can clearly see the harmonic components and consistent high-power fundamental frequency in the wanted sounds, while random sounds are not harmonic and frequency range is cluttered with low-power components.

My question is, how do I distinguish them?

I was thinking of calculating THD for both and selecting only the high results as harmonic sounds seem to carry more power, however, that's not always the case.


texts:
I used the measured position to estimate the velocity using a Kalman filter.

But in simulations, the Kalman gain changes quickly and then remains constant when position and velocity continue to change. For example, position and velocity change at times  0 to 0.5(s) and 3 to 4(s), respectively. But the Kalman gain only changes  0 to 0.1(s) and then remain constant.

My question is: Why is the Kalman gain constant when position and velocity change?


texts: Optimal method to calculate Fractional Fourier for Chirp signals

texts: There are several method exist in the literature to calculate fractional Fourier transform. My interest is in chirp signals and want to find time delay estimation using fractional Fourier transform (Frft). Can anyone point me which algorithm I should use to obtain Frft. I think Frft canbe calculated several ways, by Eigen decomposition , Hermite polynomial, chirp convolution etc.Any comment would be appreciated.


texts: Generating a high SNR sinusoide with lut on a DSP

texts:
I'm generating a sinus by using a lut method on a DSPic33f. My sample rate is 48 kHz, so I saved 12000 of the first value (unsigned int, 16 bits) and use trigonometric formulas to calculate the other parts of the sinusoid. I can change the frequency of this sine by turning a rotary encoder. Every 2 ms, a timer interrupt read the value of the rotary encoder, and the value (frequency in Hz) will be the new index to read my lut.

A bit of the code for you to understand :

ANGLE += FREQUENCY_VALUE;
if(ANGLE < SINE_TABLE_LEN)
{
    index  = ANGLE;
    sign = 1;
}
else if((ANGLE >= SINE_TABLE_LEN) && (ANGLE < SINE_TABLE_LEN2))
{
    index = SINE_TABLE_LEN2 - ANGLE;
    sign = 1;
}
else if((ANGLE >= SINE_TABLE_LEN2) && (ANGLE < SINE_TABLE_LEN3))
{
     index = ANGLE - SINE_TABLE_LEN2;
     sign = -1;
}
else if((ANGLE >= SINE_TABLE_LEN3) && (ANGLE < SINE_TABLE_LEN4))
{
     index = SINE_TABLE_LEN4 - ANGLE;
     sign = -1;
}
else
{
     ANGLE -= SINE_TABLE_LEN4;
     index = ANGLE;
     sign = 1;
}
audio_sample_l = sign * sine_lut[index-1];
audio_sample_r = audio_sample_l;

I initialize my variable ANGLE at 0 and FREQUENCY_VALUE at 1. When a plot the fft of my sinus I get some odd harmonic noise that I can not explain. When I compare the output samples with the one from my lut, they are the same (no index error). The problem may come from the fact that I do not start at the beginning of my lut but at the previous sample to avoid phase changes. There may be some rounded error also. My third lead is the initialization values and the index calculation (test in the loop also). What do you think ?

Anyone have some ideas to change that ?


texts: Proof that the Lomb-Scargle periodogram reduces to the classical periodogram when the sample is equally spaced

texts:
If we have a equally spaced sample, we can use the conventionally used periodogram:

$$P_x(\omega) = \frac{1}{N_0}\left[\left(\sum_j X_j\cos \omega t_j\right)^2+\left(\sum_j X_j\sin \omega t_j\right)^2\right]$$

But in a unevenly spaced sample, it's also well known the Lomb-Scargle periodogram:

$$P_x(\omega) = \frac{1}{2}\left(\frac{(\sum_j X_j\cos\omega(t_j-\tau))^2}{\sum_j \cos^2\omega(t_j-\tau)}+\frac{(\sum_j X_j\sin\omega(t_j-\tau))^2}{\sum_j \sin^2\omega(t_j-\tau)}\right),$$

with $\tan(2\omega\tau)=(\sum_j\sin 2\omega t_j)/(\sum_j\cos 2\omega t_j).$

I want to see that, if we apply the L-S periodogram to an equally spaced sample, it becomes the classical periodogram, e.g, the denominators are equal to $N_0/2$ and it has time-translation invariance, e.g., $\tau$ doesn't affect anything (Scargle, 1982):

$$\sum_{j=1}^{N_0} \sin^2\omega(t_j-\tau)= N_0/2 = \sum_{j=1}^{N_0} \cos^2\omega(t_j-\tau)$$

Some books I've seen says it's purely trigonometrical reasons, but I don't see it. Also, it's empirically shown that, even for an unevenly spaced sample, this denominators are never far from $N_0/2:$

$$\sum_{j=1}^{N_0} \sin^2\omega(t_j-\tau)\approx N_0/2 \approx \sum_{j=1}^{N_0} \cos^2\omega(t_j-\tau),$$

is there some analytical explanation of why this happens?


texts: How to segment blood vessels and detect malignant?

texts:
I have a task of segmentation of retinal blood vessels from fundus images an the same time detect malignant. so the output images should contain both segmented image and detected malignant. I am using Matlab.

original input image

I tried thresholding algorithm but for this kind of image I didn't get good results. But for the same algorithm when I applied for images for public available datasets such as STARE and DRIVE the segmented results compare to ground truth is almost the same


texts: Why does the excitation signal appear, separated, at high quefrencies in the cepstrum?

texts:
So, I've just begun a speech and language processing course and have found the explanation of the process of getting the cepstrum of a signal and its properties a little confusing. The following is a description of my current understanding and an explanation of confusion it's causing me:

start with the speech signal. we can think of it as the formant signal convolved with a the excitation signal which is a dirac comb (approximately).
take the FFT, giving the spectrum of the excitations multiplied with the spectrum of the formants. the FFT of the excitation signal is another dirac comb with period 1/T
take logs. so the 2 signals above are now added
inverse fourier transform - the two signals from 1 should now be combined in addition (the FT transform is linear)

So if those 4 step are right, then why does the excitation appear at a particular region in the quefrency domain? it should emerge as a Dirac comb, added to the formant impulse response shouldn't it?


texts:
I’m currently trying to understand a digital tanlock carrier recovery loop for QPSK (for example)

I cannot understand how it works.

For example we an ideal QPSK constellation.

phi = atan2(Q/I) = pi/4,3pi/4,5pi/4 or 7pi/4.
After multiplying by M=4 and (mod 2pi) operation the angle is pi.

So after rotating constellation by pi we only gain phase ambiguity and no phase errors.

But how does it work in case of phase/frequency errors?

And one more question. What does "carrier tracking loop BW mean"?

I guess it refers to loop filter?

Is it the bandwidth of the filter? F(z) = Ki + Kp/(1-z^-1).

Jason thanks a lot for the answer.


texts: Complex Samples (IQ) - Baseband Filtering

texts:
We are currently analyzing a large set of IQ samples in a desktop application and we are interested in implementing many different bandpass filters dynamically.
We realized, that working with scipy offers no suppport for complex bandpass filtering.
We have already checked following link which suggests a solution to the problem when it is decided to approach the problem with complex filters:
How to implement bandpass filter on complex valued signal?
We wonder, why that is even necessary, since the data could be transformed to a real format. Instead of $[-f_s/2, f_s/2]$ the range is from $[0,fs]$ (mirrored about the $0\,Hz$ point). This way already implemented filtering tools could be used.


texts:
I have a 1D signal that is roughly periodical (but not exactly) - think of some kind of motion that someone performs repeatedly, and which is measured by some sensor.

I am looking for a way to

automatically chop up the signal into the individual cycles, and
somehow calculate an "average" that preserves the characteristics of the measured motion

How could this be done?


texts:
This sample image:

is warped on the left side.

I don't want to dewarp, but just to remove shadow gradient (caused by book's spine). I guess gradient can be calculated from upper part of the image and that information can be used for reconstruction.

First I thought to apply some layer transformation in Photoshop. I took upper part with clear gradient and scaled it vertically to cover whole image in new layer. Then I did layer difference:

but while upper part is acceptably reconstructed, colored part is not.

Does anyone have an idea how to approach this in Photoshop, or Python/SciPy/OpenCV, or Matlab?


texts:
I'm having some trouble getting consistent results with PSD calculations. If I just take a basic sine wave

fs = 20000;
len = 16384;
fsig = 1000;
Sig = 1.5 * sin( (1:len) * 2 * pi * fsig / fs);
fsig = 700;
Sig = Sig + 0.9 * sin( (1:len) * 2 * pi * fsig / fs);

and I run it through the follow two Welch's functions with MATLAB's pwelch:

[matWelchD1, matWelchF1] = pwelch(Sig, length(Sig), 0, [], fs);
[matWelchD2, matWelchF2] = pwelch(Sig, ceil(length(Sig/2)), 0, [], fs);

I get the $1\textrm{ kHz}$ peak at approximately $0.65$ and $0.26$. I would love to blame frequency leakage due to how the frequencies line up, and there is some support for this because the $0.65$ peak has a much narrower base, but I see a similar result on real world data with FFTs that have broadband frequencies.

Anyone know why the two implementations would be different?


texts: Reconstructing a signal from FFT by adding individual signal components

texts:
I'm attempting to reconstruct a signal from the DFT of the signal. I tried to do it by extracting the individual sinusoids and adding them up, but the answer I get is incorrect.

s = [3 1 4 1 5 9 2 6]#Some random signal(first few digits of pi in this case)
t = 0:(1/7):1;#Sampling at each of these equally spaced time intervals
f = fft(s);
a = abs(f);#Magnitude of each DFT component
an = arg(f);#Phase of each DFT component

recs = (a(1)/8)*cos(0*pi*t + arg(1)) + (a(2)/8)*cos(2*pi*t + arg(2)) + (a(3)/8)*cos(4*pi*t + arg(3)) + (a(4)/8)*cos(6*pi*t + arg(4)) + (a(1)/8)*cos(8*pi*t + arg(5));
#The above equation is derived(hopefully correctly) from the theory given in the question description
recs
s

This is a program I wrote in GNU Octave(should work on Matlab too). And the basis for using that particular expression for recs is based on some info I got from http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf.

I don't understand if my method for getting the individual components was wrong or is it some basic step I'm missing here.


texts: Tutorial on 2nd generation wavelets (with lifting)?

texts:
For some denoising and deconvolution experiments, I'd like to apply a 2nd generation wavelet transform (using lifting steps) to images.

I know that there are several implementations available, but most of them use matlab, while I want to work in C++ with OpenCV.
Since there is no built-in wavelet transform implementation in OpenCV 2.x, I plan to implement it myself (plus, it will make a good exercise for me).
After some research, I've been able to find the original articles about the 2nd generation transform, but I'm still a bit confused about the exact way the algorithm works.

Taking for main reference the paper [1] by Sweldens: The Lifting scheme: a construction of second generation wavelets, I'm still confused by the definition of the index sets $\mathcal{K}(j)$ : what is their size ? how are they built ? ...

Hence my question : does anyone know about some resources about the 2nd generation wavelet transform (papers, tutorials, slides...) that are either in a tutorial-like form, or that provide a more algorithmic view (rather than a mathematical one), which would help me designing my own implementation ?

Thank you in advance.

References

My main reference is:

[1] Sweldens, W. (1998). The lifting scheme: A construction of second generation wavelets. SIAM Journal on Mathematical Analysis, 29(2), 511.

And I am also learning from:

[2] Daubechies, I., & Sweldens, W. (1998). Factoring wavelet transforms into lifting steps. Journal of Fourier analysis and applications, 4(3), 247–269.

[3] Kovacevic, J., & Sweldens, W. (2000). Wavelet families of increasing order in arbitrary dimensions. Image Processing, 9(3), 480–496. doi:10.1109/83.826784


texts: $2\pi$ Periodicity is not working for me for Fourier of Discrete Time Signal

texts:
please help me find the error in the following counter example.

Consider we take sinus with period of $2\pi$. We sample it many time, and more than 3. We make convolution with rectangle of height 1 and width $2\pi$.

We’ve got sine wave sampled many times without periodicity.

Now we make fourier transform of it. We shall get delta at omega 2pi and as we know, since we transformed a discrete signal, we shall get this delta every 2pi, alas at 4pi, 6pi, and so on. Meaning by that, that each multiplication by two of this signal in the time domain shall fit the discrete signal’s samples.

But it does not work for me.

Say we have 999 samples on the original sine on single period. Signal which is shortened by two will simply remain long enough not to fit between each of two samples in each of the halves of the signal because it works only if we have 3 samples (on the 0s). Only then the $4\pi$ sinus will lay down on on the samples, which are the zeroes of the sine wave.

What am I missing? Please help.


texts: MUSIC algorithm for frequency and DOA estimation

texts:
$\lambda$ denotes the wavelength of the incident sinusoid, $\theta$ the direction of arrival (DOA), and x the distance between the sensor array elements. The signal is $x_{1}(n)....x_{k}(n)$
How do I proof/explain that estimating the DOA($\theta$) is the same as estimating the frequency of the signal (where $x_{1}(n)=x_{1}(m)$ instead where m is the time instant.

I understand that the MUSIC algorithm can be used to estimate the frequency of a signal, and the MUSIC algorithm can be used to estimate the DOA of a signal as well. They are both related as they are basically finding the peak of the power spectrum, but I'm not entirely sure how to explain this.


texts: Which anatomical model to use as "ground truth" for validating an MRI segmentation method?

texts:
I am research in brain segmentation task that classify a brain in to 3 classes : White Matter, Gray Matter and CSF. To validate my method, I used Dice Coefficient that compare my result and ground truth result. However, I am confusing about ground truth result. As I found that ground truth brain of brainweb service has two models: fuzzy and discrete models.

A fuzzy phantom will specify a mixture of tissue classes for each voxel (eg. a voxel might contain 90% grey matter and 10% white matter). A fuzzy phantom was used to describe the tissue within each voxel during the simulation process.

A discrete phantom specifies the tissue type with the largest proportion in each voxel. A discrete phantom was not used in the simulation process. However a user might use this phantom when comparing simulated data against the underlying tissue types (eg. a user might have a classification algorithm which classifies each voxel into one specific tissue type).

They suggest that "If your method attempts to estimate the partial volume (that is, the tissue fractions in each voxel) then the fuzzy model is probably what you want. Otherwise, the discrete model will probably do..."

From that information, Which model can I used for segmentation task?

As my knowledge, I think that discrete model must be used. How about you?


texts: Equalization : using the spectral or the temporal signal?

texts:
I'm trying to equalize a sound signal - using a JAVA program - and I'm using this process :
1/ Conversion of the temporal signal to a spectral signal, using a FFT

2/ Applying a coefficient to each frame of the spectral signal to equalize it

3/ Conversion of the spectral signal modified to a temporal signal

4/ Reading of that temporal signal

If I'm applying that process to a "pure" signal (ex : a 400 Hz sinusoïdal signal generated "on the fly" by a java class), it seems to work. But if I'm applying it to a "real" wav signal (a song, for example), the result is unsusable. I hear a kind of "sliced" sound, even if all the equalization coefficients are equal to "1" (=no modification).

So, to equalize a sound, does the process I describe above is the right solution ?
Or shall I avoid that double conversion and applying a convolution product on the temporal signal ?

If I have to do apply a convolution product, how to do it ? I have no clue about calculating it with "random" signals.

Thank you for all your answers.