texts: What is the spectrum of generalised periodic signals assuming mainlobe covers the first two harmonics?

texts:
I found this statement in the paper here which I have difficulty seeing why is it true.
Let $H(\omega)$ represent the Fourier transform of a time-windowing function. Assume the width of the mainlobe of $H(\omega)$ only covers two harmonic components of the fundamental period $T_0$. Therefore it is sufficient to assume that the test signal representts the general periodic signals where $T_0$ is the fundamental period:
$$ S(\omega) = \delta(\omega) + \alpha e^{j \beta} \delta(\omega - \omega_{0}) $$
I tried to attack this statement from a various angle. I find the wording of the statement confusing and that's why I don't know what this statement really wants to say.
This is certainly a spectrum, so the name "test signal" is a bit odd to me. My interpretation is that the writer wants to show that general periodic signals (including the class of harmonics) will have this spectrum assuming the width of the mainlobe of $H(\omega)$ only covers two harmonic components of the fundamental period $T_0$.
If my understanding of the statement is right, what I don't get is the implication of the mainlobe covering only two fundamental periods or either the interpretation of "covering two fundamental periods".
For a general cosine $ y = A cos (\omega t + \theta) $:
$$ S(\omega) = \pi A [ e^{-j \theta} \delta(\omega - \omega_0) + e^{j \theta} \delta(\omega + \omega_0)] $$,
where we can see that this roughly corresponds to the second term. The next step would be to apply the windowing function
$$S_{windowed}(\omega) = H(\omega) S(\omega)$$
To my understanding, the mainlobe covering the two fundamental periods, means at the mainlobe width has tobe at least $2\omega_0$. Without further guidance what window to choose, I chose a Hann window.
$$ H(f) = \frac{1}{2} \frac{\sin(\pi L f)}{\pi f (1 - L^2 f^2)}. $$
I don't know how to choose L so it gives the desired width (apart from empirically trying it). So let's just write the general formula for now.
$$ S_{windowed}(\omega) = \frac{1}{2} \frac{\sin( L \frac{\omega}{2})}{\frac{\omega}{2} (1 - L^2 \frac{\omega^2}{4 \pi^2})} ( \pi A [ e^{-j \theta} \delta(\omega - \omega_0) + e^{j \theta} \delta(\omega + \omega_0)]  ) $$
How do I proceed from here?


texts:
On page 137, chapter 5 in the book titled 5G Physical Layer: Principles, Models and Technology, the author says:

An important attribute of the FBMC waveforms is that they typically do
not employ any CP or GI, unlike the OFDM-based waveforms. The
prototype filters in the FBMC waveforms have long decaying tails which
can make them robust to the ISI caused by frequency-selective channels

Question: Why would filter long decaying tails make a signal robust to ISI caused by frequency selectivity?


texts:
I am studying Signals and Systems. Anyone, please help me to answer the problems.

$y(t)=dx(t)/dt$ is time invariant:  True or False ?
$h(t)$ is the impulse response of an LTI system. If $h(t)$ is periodic and non-zero, the system is unstable:  True or False?


texts:
I am trying to learn digital Image processing by myself and now stuck at a problem in the two dimensional unitary transformations. It states that let $U$ be the input image and $V$ be the transformed image and $A$ is the unitary transformation matrix.
To prove above equation I am rather trying to prove $$U^2=V^2$$ which I think is equivalent to proving equation in question.We have $$ V=A U A^T $$ now to prove the above relation: $$V^2=V^{*T} V$$ where
 $$ V=A U A^T \mbox{ and } V^{*T}=A^*[A^*U^*]^T$$ which on solving gives me $$ A^* U^{*T} U A^T $$ which gives $$ A^* U^2 A^T $$but it should be equal to $$U^2$$, as I understand. Though $$ A^T A^*=I $$ as $A$ is Unitary matrix, but as much as I know we can't change order.


texts: Sample rates, Samples per Symbol, and Digital Pulse Shaping

texts:
Having some confusion about digital pulse shaping for complex baseband (passband) signals. The complex baseband linear modulation equation is
$$s(t)=\sum_{m=-\infty}^{\infty}\text{Re}\{a_m\}h(t-mT)+j\sum_{m=-\infty}^{\infty}\text{Im}\{a_m\}h(t-mT)\tag{2}$$ where $a_m$ are the symbols and $h$ is the impulse response of the pulse shaping filter. Consider for now this is a root raised cosine filter with QPSK symbols.
It is often stated in references that the output rate of the pulse shaping filter should be at least twice the input rate - in other words, the pulse shaping filter should be at least a 2x interpolator. For example the following equation holds for the required (positive) bandwidth:
$$BW = (1+a)\frac{R_b}{2\log_2(M)} = (1+a)\frac{R_s}{2}$$ where $R_b$ is the bit rate, $a$ is the excess bw, $R_s$ is the symbol rate, and $M$ is the constellation size. Thus to satisfy the nyquist criterion, we must sample with at least $f_s = (1+a)R_s$. I believe another way of stating this is that the two-sided bandwidth $(1+a)R_s$ is equal to the complex sampling rate.
So considering some values, take $a=0$ which gives the sinc pulse, the digital pulse shaping filter could theoretically operate at 1 (complex) sample per symbol, i.e. the input and output rates are both $R_s$ (disregarding all the other obvious drawbacks of using sinc pulses).
Another common value $a=0.35$, gives us a sampling rate of $1.35R_s$, so we would need at least a fractional interpolating filter (e.g. upsample by 27, downsample by 20) to avoid aliasing. So clearly it seems possible to achieve less than 2 complex samples per symbol. My question is, if this is correct, why do so many references and libraries mandate a minimum of 2 (complex) samples per symbol when the actual limit is 1 complex sample per symbol (e.g. GnuRadio constellation modulator is one). I am assuming this is just due to simplicity and 2 being an easy value to interpolate and cover the range of allowable RRC bandwidths.
A second related question, assume we are doing BPSK, e.g. with $\text{Im}\{a_m\} = 0$. It seems to me in that case if you're in an IQ system still, you'd actually need 2 complex samples per symbol in order to actually give 2 real samples per symbol to the BPSK I channel. Perhaps this is yet another reason for mandating the 2 complex samples per symbol minimum?


texts: What interpolation methods can I use to get the tightest fit for these curves?

texts:
I am working with MRI images of the brain that have certain areas marked by hand like  and .

I am trying to come up with an interpolating function that will let me describe such curves so that I can use machine learning techniques to automatically generate such markings on unmarked images like  and .

I've considered using cubic spline interpolations to approximate the curve, but as far as I know, I would have to split the curve into multiple parts to interpolate it.

Am I on the right track or are there other (better?) ways to do this?


texts: Are wavelets for audio spectrograms available as a simple FIR filter?

texts:
I have read that "Debauchies Wavelet is simply a short FIR" so i am searching for a single FIR that i can make into a filterbank, a precise "bandpass filter" that detects narrow frequencies, i.e. 1Hz resolution and very narrow.
Having an FIR filter function allows for multithreading which is not easy with a transformation matrix, and arbitrary analysis windows.
In Reaktor DSP suite i simply used a bandpass to make an amazing filterbank program. I tried the same with a cookbook FIR filter and it was totally erratic and garbled as a filterbank analysis filter, even though it sounds good.
What FIR or wavelet can i use for a filterbank where:
 T=time, F=freq;

 for loop T++;                        // (1 second 0-44100 samples)
    for loop F++;                     // (512 bands 0-512 kHz frequencies)
       graph2D[T,F] = FIRfilter(T , F );

EDIT- on request, schematic of a bandpass that can be used for audio analysis:


texts:
I want some data to fit the corresponding Gaussian distribution.

The data is meant to be Gaussian already, but for some filtering reasons, they will not perfectly match the prescribed and expected Gaussian distribution. I therefore aim to reduce the existing scatter between data and desired distribution.

For example, my data fit the Gaussian distribution as follows:

The approximation is already decent, but I really want to crunch the still tangible scatter between simulated data and expected distribution.

How can I achieve this?


texts: When did signal processing become a field of its own?

texts:
This is perhaps a bit soft question but when did signal processing become a field of its own? It would appear to have first been a branch of mathematics and statistics but then emerged as an independent field.

If there is any book that would cover this, or perhaps some special issue article, I would love to read it.

PS. Please help to add relevant tags; I could not find any


texts: Difference between 'spatially' and 'instantaneously' independent

texts:
For a multivariate time series

$$\underline{y}(t)=[y_1(t) \dots y_n(t)]^T$$

What is the difference between the components $y_i(t)$ being spatially independent and instantaneously independent?


texts: How does direction finding work when using GMS mobile station and additional handset?

texts:
I am trying to understand the concept of direction finder (DF), for mobile GSM devices.

I have found the following description:

http://www.pki-electronic.com/products/interception-and-monitoring-systems/gsm-direction-finder/

It seems to describe the following configuration:

<IMSI catacher>-------- <additional handset (mobile)>
|
|-------- <target mobile device>

According to web site description, it is composed of IMSI catcher (probably), i.e. active base station, which force the target mobile to transmit, and probably the attacker base station (SDR radio) can detect the exact direction/signal strength of the attacked device.

I am not sure how it works, but this is what I think:

The base station (which is also a receiver) force the target mobile to keep transmission (by sending silent sms which force the mobile to transmit ack).
The additional handset is actually a second receiver.
So we get 2 receivers (handset and base stations) , each can find the signal strength.
We can draw a map, with 2 circles, and the merge points will point us to the correct direction.

Do you think this is how it works ? any comment is appreciated.

EDIT:
Can someone please give a description how it is done and what is the purpose of the handset ? Is it a reciever of just an antenna ?

Thanks.


texts: Reconstructing Tree Limbs that are Occluded by Leaves

texts:
How would would one approximately reconstruct the branches in a photo of a tree, where portions of the branches are covered by leaves?

I can extract the visible portions of the branches by threshholding then opening with line segments at a few different angles.  But how would I then (approximately) fill in the spaces that were covered by leaves?

Suppose we start with this drawing of a tree:

load the image as grayscale

uu = mmreadgray('tree2.jpg')

threshold the darker colors; convert to binary; remove connected regions under 200px area

vv = mmareaopen(mmbinary(mmthreshad(mmneg(uu), 200)), 20)

open vv with 10px line segments at 90 degrees, 180 degrees, 135 degrees and 45 degrees; add these images together to form a marker image zz

zz = mmaddm(mmaddm(mmaddm(mmopen(vv, mmseline(10, 90)), mmopen(vv, mmseline(10, 180))), mmopen(vv, mmseline(10, 135))), mmopen(vv, mmseline(10, 45)))

reconstruct the visible limb portions in vv from marker image zz

aa = mminfrec(zz, vv)

display result aa on top of original image uu; a reasonable extraction of limbs is achieved

mmshow(uu, aa)

I would appreciate any thoughts on how to now approximately reconstruct the entire limb.  (Or improvements to the steps given above).  Thank you!


texts: What bandpass filter design will yield the shortest impulse response?

texts:
Designing a simple 2nd order IIR bandpass Buterworth filter with a centre frequency of 500 Hz and a 1 octave bandwidth gives me the following frequency response ...

Now, if I take the impulse response and normalise it and convert it to dB, we can observe the decay of the impulse response.

The decay of the impulse response is approximately linear with time when plotted on this scale, allowing us to define a decay time statistic (just like in room acoustics where you can define reverb time). For the impulse response of this filter to drop below 30 dB, it takes about 11 ms.

We are trying to minimize this decay time keeping the following constant:

-3 dB bandwidth
Filter order

I am happy to accept (within limits) passband and stopband ripple, and/or a compromise on the steepness of the transition band to achieve this. Can anyone suggest a method for filtering with the shortest possible impulse response duration as defined above?


texts: Spectrogram for created signal in Octave

texts:
I'm trying to test the specgram function located in the signal package in octave but I'm a little confused at the variables in specgram.  What I would like to do is be able to get the specgram data into an array that will show the frequency and the length of time when the frequency starts and stops.

See example code below: I was trying to get the array to show that for the length of t1 will be $7 \textrm{ Hz}$, t2 will be $12\textrm{ Hz}$ and for t3 will be $2\textrm{ Hz}$.  How can I go about doing this?

I'm using ubuntu 12.04 and octave 3.2.4 and the signal pacakage 1.0.11

% combines sig with spectra plot
clear all,clc,tic;
fs=1000;
t1=linspace(0,2*pi,fs/0.1); %need to round off no decimals
t2=linspace(0,2*pi,fs/0.3); %need to round off no decimals
t3=linspace(0,2*pi,fs/0.6); %need to round off no decimals

%Create signal in different arrays
y1=sin(7*t1);
y2=sin(12*t2);
y3=sin(2*t3);

%append arrays to test specgram
yt = [y1 y2 y3];

%plot(yt) %will show combined plot

%Spectrum section
yts=specgram(yt',20,500, 2,1);
plot(yts)
fprintf('\nfinally Done-elapsed time -%4.4fsec- or -%4.4fmins- or -%4.4fhours-\n',toc,toc/60,toc/3600);


texts: Is it impossible to determine the inverse Z-transform without any other information?

texts:
Suppose I give you this as my transfer function $H(z)$:

$$   H(z) = \frac{1} { 1 - az^{-1}}$$

With no other information given, is it even possible to determine the inverse Z-transform?

The reason I'm asking is because on a particular Z-transform table I have, there are two possible resolutions for this, depending on the desired region of convergence:

As one can see we have two choices,

$a^nu[n]$
$-a^nu[-n-1]$

So I think I need more information about the system to make the right decision, that is, whether the response is supposed to be causal, stable, or both.


texts: How to determine SNR from FFT of measured data?

texts:
I am doing impedance measurements, where I do a frequency sweep of a test current, and I measure the resulting voltage. Offline, I compute the FFTs of the voltage and current, and I want to make sure that the voltage is above the 'local' noise floor. I don't care if the signal at the test frequency isn't the biggest, as long as it is above the 'local' noise floor.

Below is an example of a signal that's acceptable. The red-dot is the frequency of interest. There are components at least 20dB bigger than the frequency of interest, but the frequency of interest is around 20dB above the 'local' noise floor.

Example 1

Below is a second example which I would want to be alerted to. It appears to be around 10dB above the noise floor, but zooming in you can see that there is another component too close.

Example 2

Example 2 (zoomed)

My ideas so far are to do peak detection on the FFT (i.e. one point at the peak of each lobe), then peak detection again on the peaks, and see if the frequency of interest is a local peak. If so, the "SNR" that I report is the component of interest (in dB) - closest peak-peak (in dB).

Does anyone have suggestions on a good way to calculate the "local SNR"?


texts:
I'm trying to make a frequency response of that function:

in matlab a made this:

d=[1 -0.494 0.6404];
p=[1 1.58567330897 0.96];
[h,w] = freqz(p,d,40000);
z = abs(h);
plot(w/pi,z);

d and p i calculated.
The plot gives me this:

but in book has that answer:

as you can see the peak of magnitude is 2 and not about 6.5. '-'
What am I doing wrong?
H2 has an abs 1 because it is a all pass filter.


texts: Where to place origin when warping an image using 3D rotation and translation?

texts:
Suppose, I've two images taken by a camera at two different locations. The two locations are related by a Rotation and Translation. So, points $X1$ in first frame will be at $M \cdot X1$ where
$$ M = \begin{bmatrix}
R & T \\
0 & 1
\end{bmatrix} $$
Now suppose, I have image1 and I want to warp it to image2 using $R, T$. I have ground truth depth map corresponding to image1. To do this, I will represent each pixel in image1 as a vector. First I'll convert it to 3D point by multiplying Depth (in homogeneous coordinates) and inverse of camera matrix. Then I apply the transformation $M$ and then project it back to image space by multiplying by camera matrix and then normalizing the 3rd coordinate to 1.
But how and where do I fix the origin in the image1?


texts:
If I have a stationary signal $x(t)$ with zero mean and with an auto correlation $r_{xx}(\tau)$, then what is the auto correlation of $y(t)=x(t)+b$ ?

My calculations so far:

$$\begin{align}
r_{yy}(\tau) &= E\{ [x(t+\tau) + b] [x(t) + b] \} \\
&= E\{ x(t+\tau)x(t) + b x(t+\tau) + b x(t) + b^2 \} \\
&=r_{xx}(\tau) + b^2 \\
\end{align}$$

The problem is that the autocorrelation of a constant is a triangular pulse and not just a squared offset. What am I missing here?


texts: Is there any possible periodic  signal can exist(even mathematically) whose period gets change after differentiation?


texts: Acoustic room simulation - Craven's hypothesis

texts:
I'm reading Udo Zölzer's "Digital Audio Signal Processing" and there's a piece about acoustic room simulation.

This question will be more about maths and acoustics, but I assume anybody who does DSP with sound knows the topic.

I'm trying to understand an excerpt about Craven's hypothesis (conerning human's sound source distance evaluation) which is used at Gerzon's algorithm.

It looks like this:

My understanding: Craven was trying to say that as we perceive signals with our ears, we can easily evaluate two things:

time difference between arrivals of the direct signal and the first reflection
the ratio of their amplitudes

Then, he says, our brain evaluates these two and can determine (more or less) the distance of the sound source.

I don't get the thing with g. It's said, that g stands for relative amplitude of direct signal to first reflection.

Shouldn't it be the other way? I mean, shouldn't it stand for "relative amplitude of first reflection to direct signal"? If we assume same SPL at both sources, the source that is further provides a weaker signal, than the one that is closer to the receiver.

If I would know only the verbal description of g, I would expect it to always be greater than 1, as direct signal is always louder than any reflected.

But how does it happen, that
g = SPL/SPL' = d/d'
?

According to inversed square distance law for sound, if we use SPLs, sound pressure level at distance r:

SPL(r) = (SPL@source)/r

So, if g would stand for the "relative amplitude of direct signal to first reflection" I would calculate:

g = SPL/SPL' = (P/d) / (P/d') = d'/d

SPL is Sound Pressure Level of the direct sound at the receiver,
SPL' is SPL of the first reflection at the receiver, P is sound source's SPL, d and d' are distances from sources.

Question 1.: is there a mistake at my interpretation or in the description in the book?

Question 2.: after all the calculations, when we have the formula for d, that Craven says allows our brain to evaluate the distance of the source, where does brain take the speed of sound from to calculate it? Should it be trained?


texts:
I am implementing an iris recognition system in matlab and have performed the following steps according to an algorithm proposed in a paper

Initial image

Median filtering
For each row in the filtered image, assign a value of one to the pixels that have the minimum value in that row and the other pixels to zero
Again median filtering to remove white spots here and there.
States that: Get the row and column that has maximum
number of ones. Then find the center (xo, yo) and
the radii (rx, ry) as follows: xo = the index of this
column, yo = the index of this row, rx = the
number of ones in this row/2, ry = the number of
ones in this column/2

My question is how do i do step 5 in MATLAB?


texts: Simulate a simple multipath channel for OFDM Modulation test. MATLAB

texts:
Hi I need to simulate a simple multipath channel in matlab through which I can send my OFDM transmission signal, I want to test my OFDM receiver design.
So far I have:

%% Passing through Channel
nIFFT = 4096;

% Create channel
channel = randn(1,nIFFT) + sqrt(-1)*randn(1,nIFFT);

% cext_data is the signal to be transmitted
after_channel = filter(channel, 1, cext_data);
wavwrite(after_channel,'ofdm_tx8khz.wav');

I get a warning when I run the transmitter:

  Warning: Data clipped during write to file:ofdm_tx8khz.wav

and when I run the receiver I get:

  Index exceeds matrix dimensions.

  Error in ofdm_rx (line 26)

  chunk2 = signal((s+nIFFT):(s+nIFFT+nCyclic-1));

I was really hoping someone could help me simulate a multipath channel for my OFDM program.


texts: Can the intelligence message of an FM signal be cross-modulated to another center frequency due to non-linearities?

texts:
Can the intelligence message of an FM signal be cross-modulated to a  a different frequency by non-linearities, but with the FM modulating message remaining (relatively) intact on the new frequency?
This isn't really trying to solve a particular problem, but I'm trying to understand if this is possible, and if the math checks out.  In FM two-way radio, sometimes users experience "bleed over" from another channel.  I've heard intermodulation or cross-modulation being cited as the cause.  Reading the literature however I can't find this phenomenon discussed.  I'm Using Leon Couch, Digital and Analog Communications Systems by the way.
Studying non-linearities; intermodulation and cross modulation, I see that the 3rd order output is:
$$V_{out} = K_{0} + K_{1}V_{in} + K_{2}V_{in}^2 + K_{3}V_{in}^3$$
If you put signals into the system where
$$V_{in} = A_{1}\sin(\omega_1t) + A_{2}\sin(\omega_2t)$$
Then part of the third order outputs are:
\begin{align}3K_{3}A_{1}^2A_{2}\sin(\omega_1t)^2\sin(\omega_2t)  =   \frac{3}{2}&K_{3}A_{1}^2A_{2}\{[\sin(\omega_2t) \\&- \frac{1}{2}\big[\sin(2\omega_1 + \omega_2)t + \sin(2\omega_1 - \omega_2)t\big]\}\end{align}
and another
Generally it's explained that term $\sin(2\omega_1 - \omega_2)t$ accounts for intermodulation distortion that is difficult to filter because it is close to the desired signal.  Also they show that if there is any amplitude variation on signal 1, that it can amplitude modulate signal 2, because
$$\frac{3}{2}K_{3}A_{1}^2A_{2}\sin(\omega_2t)$$
But I never see a discussion of an FM signal being cross-modulated onto another FM signal.  It seems to me that if signal 2 is an FM signal as:   $\sin\big((\omega_2 \pm \Delta\omega) t\big) $. then the cross modulating term:
\begin{align}
\sin(2 \omega_1t - \omega_2t)  &=  \sin\big(2\omega_1t - (\omega_2 \pm \Delta\omega)t\big)\\
&= \sin\bigg(\big(2\omega_1 - (\omega_2 \pm \Delta \omega)\big)t\bigg)\\
& = \sin\bigg(\big(2\omega_1 - \omega_2 \mp \Delta \omega\big)t\bigg)\\
& = \sin\big((2\omega_1 - \omega_2)t \mp \Delta \omega t\big)
\end{align}
Which looks to me like the modulating signal would be impressed on the intermodulation product $\sin((2\omega_1 - \omega_2)t$
It seems to me about the same as super-heterodyning the message signal, which would be the $ \Delta\omega t$
Of course my reasoning might be totally incorrect.
Like I said, I've never been able to find a mathematical or physics treatment of the phenomenon, but I've heard people argue that it happens, and others argue that in the FM domain cross modulation will only cause noise, not the imparting of an intelligent signal on another signal like in AM.


texts: How to blend images on a spherical surface / cube map

texts:
I already have an algorithm for making panoramic image mosaics by image registration and then blending images in the overlap regions.

The following image from Wikipedia illustrates several images under translational movement stitched together by finding optimal dividing lines in the overlap regions:

Now I would like to extend this blending algorithm to various panoramic image projections.

The simplest case is planar projection in which does not posses any problems for blending. The following image illustrates two images and the stitch line.

I can basically take a region from canvas (already stitched composite image) and a corresponding region from image, then blend the two together and render the blended region back to canvas:

This is done sequentially for each new image.

However, when I experimented with spherical projection and 360° mosaics a problem appears when two images and their overlap region crosses the 360° boundary:

I can no longer take out a simple rectangular regions to blend as I have to count on wrapping.

Even worse, blending images on a cube map can split the overlap region in two or three parts:

I came with a few solutions on how to blend images on spherical surface or a cube map, but no one is satisfactory:

Solution 1

Process each facet of the cube separately (or similarly, each part of a spherical map separately). Unfortunately, this produces visible artifacts where the two facets of the cube meet as the blending of images in neighboring facets are different sub-optimal solutions.

Solution 2

Perform blending in the context of newly added image. This requires to inversely project composite image from cube map (or spherical map) in the coordinate system of newly added image, blend the two images and the project the overlap region back on the compositing surface.

This should work and remove artifacts, but requires more computation as data are repeatedly projected back and forth.

Solution 3

Always blend on a spherical surface, then project the whole mosaic on whatever surface.

This reduces blending problem on a single type of surface, but spherical projection treats image parts unevenly and more elaborate approach (such as blending images on a triangulated sphere) would be needed to ensure high quality re-projection.

Solution 4

When performing the blending, provide a function that properly maps out-of-bounds coordinates.

This is similar to Solution 2, but may be even more computationally expensive as the mapping function would be called too often (the blending algorithm may access the same pixel position many times).

Question

How to efficently blend several images on spherical surface or cube map or some other common compositing surface?


texts: Characteristic function of a random Gaussian variable

texts:
I have to find the characteristic function of a random Gaussian variable of $$ \sigma_z (w)  = E e^{i w z } $$. This is the variable and I know , from the theory that the characteristic function of this variable is the Fourier transform of the probability density. From theory I read that the probability density is $$\frac{1}{\sigma \sqrt 2 \pi } e^{- \frac{(z - \mu)^2
}{2 \sigma^{2}}} $$. Now I’m blocked because I don’t know how to calculate this :/
Thank you so much


texts: detect to rising, stable and falling point in non-smooth rectangular wave

texts:
I am working on basic signal processing problems in MATLAB. I have found a signal from the internet (i don't remember the site exactly). The data is organized in column wise. 1st and 2nd column is data and 3rd column is a rectangular wave. The rectangular wave is not very smooth. So I decided to detect four points as shown in the figure. I spend 2 days to find the exact solution but i couldn't find any solution to the detect those four points.
I tried few things:
1) finding the difference between the points to get 1,2,3 and 4 points.
but it doesn't work.
2) Median Filter to smooth the wave.

Anyone, please give some suggestion to detect these points in MATLAB


texts: Finding the Amplitude spectrum of a FM signal

texts:
My textbook have a question p.360 problem 6.26 is like this

  Consider the signal $v(t) = 8 cos (2\pi [10^5 + 4 sin(5 \times 10^3 t)]t)$. And Please Draw the amplitude spectrum of $v(t)$

So, The first step, I did, was proving the $v(t)$ is a FM signal

The the instantaneous frequency is

$\frac {d\psi} {dt} = \frac {d} {dt} 2 \pi[10^5+4sin(5 \times 10^3 t)]t = 2\pi10^5+8\pi sin(5 \times 10^3t) + 8 \pi t (5 \times 10^3) cos (5 \times 10^3 t)$

So it is linear function to $\frac {d} {dt} t[sin(5 \times 10^3 t)]$ and it is a FM signal.

But, I don't know why I cannot find out the summation of sinusoids.
My methods is

$v(t) = 8 cos (2\pi [10^5 + 4 sin(5 \times 10^3 t)]t)$

$=Re \{ 8 e^{(j 2 \pi 10^5 t)} e^{j4t sin(5 \times 10^3 t)} \}$

$=Re \{ 8 e^{(j 2 \pi 10^5 t)}  \sum\limits_{n=-\infty}^\infty J_n(4) e^{j 2 \pi n (\frac {5 \times 10^3}{2 \pi})t}\}$

And my problem is I dont know my last step is correct or not because it look very weird.


texts: Face Recognition: Simplistic Explanation on PCA Eigenface Algorithm

texts:
I m working on a project that I have to use eigenface but I have some uncertainty and I dont know how to deal with it. There are some tutorials about it on internet but I can't understand what exactly they mean.

This is what i know:

First of all you have to make image matrix to a vector. So you have to attach next rows one after another to the first row.
Then if we have many images of one person, we add up every certain index of all images and divide it count of those images. so
mean[1]= image1[1]+image2[1]+..../images count

Questions:

After that we have make deviation image. First question is we do it for every row image? So:
divImage1[1]=image1[1]-mean[1];
So we have to make covariance matrix of deviation image; so:
cov(image1)=cov( transpose(devImage1)* devImage);
Next question is: it's a big matrix.

How should I deal with it? I read that you can just calculate subImage of it. Or as it's a symmetric matrix, you just have to calculate befor diagonal elements. but im not sure its the main idea
So I have to calculate eigenvector of this matrix. And this is our eigenface. So we have one eigenface for every image of one person?

Next question is: I don't know when they give us a new image how we should work with these eigenfaces to recognize that is some one?


texts: What Do We Expect Likelihood Function to Be Used For?

texts:
In my understanding, I let make a example.

For example,  you can see in the following picture.

Consequently, We want to find  ^sigma. and We have already known the observation data(which is random data such as C) and bin(0.3).

To know "the estimated standard deviation ^sigma", First of all,

Find Likelihood for each bins with observed data( for example, data of C).
Find Maximum Likelihood among previous Likelihood values(from 1).
the Maximum Likelihood is "the estimated standard deviation ^sigma".  Am I wrong?
In other words, the Maximum Likelihood (^sigma) represent all bins's Likelihood values.


texts: Understanding Active Contour results - Williams and Shah 1992

texts:
I have implemented a version of Williams and Shah's 1992 active contour algorithm, which uses the energy function:

Ej = alpha * Econtj + beta * Ecurvj + gamma * Eimagej

where j is a N8 neighbor of a contour point in question. If the energy Ej is minimized by a neighbor, then the contour point in question is replaced by that neighbor.

At this point, the results seem somewhat reasonable, but I am seeing an unexpected sharp edge across the beginning and end points. Following from the paper, I am processing the first point twice to ensure that the contour is closed. However, I have included two GIFs of output: the first one includes the double counting of the first point, and the second one does not. The first point seems to be shooting away from the object in both cases.

The first point is filled in, and the last point is surrounded by a larger circle.

Is there any obvious intuition into why this may be happening?

Thanks!


texts: The FFT of a sine wave with varying frequency and constant amplitude does not show a plateau, why?

texts:
I want to use python to see what the audio response of a speaker is. This would be done by comparing the output of the speaker measured with a microphone to the given input. That means that for both of these signals that will be in the time domain I need to perform a FFT. Eventually I want to play a target curve close to a Harman curve. I tried to generate the signal to put it in a wav file and when checking if the signal does what I ask with the FFT I got some weird behaviour. So then I tried to perform an FFT on a sine wave that has a constant amplitude and goes from 21-19700 Hz in 5 seconds with a sample rate of 44100 Hz. I would like to use the welch method where I took the window to be the full length of the sample as in this case the signal I generated does not have any noise. This got me the following result:

I used the following python code
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import welch

samplerate = 44100
duration = 5
time = np.linspace(0,duration,samplerate*duration, endpoint= False)
frequency = np.linspace(21,19700,len(time),endpoint= False)
Const_wave = np.sin(np.pi*2*frequency*time)
f, check = welch(Const_wave,samplerate,nperseg=len(Wave))
plt.plot(f,check)
plt.xscale('log')
plt.xlabel('Frequency [Hz]')
plt.yscale('log')
plt.ylabel('Power')
plt.grid()
plt.show()

Afterwards, I tried the scipy.fft module which yielded a different but also not expected result:

for this I used the following code:
f = rfftfreq(samplerate*duration,1/samplerate)
check = rfft(Const_wave)
plt.plot(f,check)
plt.xscale('log')
plt.xlabel('Frequency [Hz]')
plt.yscale('log')
plt.ylabel('Power')
plt.grid()
plt.show()

I would expect to see a flat plateau of equal power on all frequencies, but that is not happening. I also tried to do the same with a linear sweep wav file generated by REW and got similar results, so is my expectation of a flat plateau incorrect or is there something else at play here?


texts:
What happens if the noise has no zero mean? I mean, if the exercise is something like:
$$y(k) = A x + \eta(k)$$

When I have zero mean, I start from:
$$y = A x$$
$$\Rightarrow \hat{y} = A \hat{x}$$
Using algebra, I to get to this equation:
$$A^H y = A^H A \hat{x}$$

But what happens if it has no zero mean? I have to use the following inner product, I suppose:
$$\langle x,y \rangle = \mathbb{E}[(x-\mathbb{E}[x])^H(x-\mathbb{E}[x])]$$
But I can't see how to get to an equation from that.

Thanks!


texts:
I am trying to compensate for the high frequency droop of a TDA1543 based nos DAC. One straightforward method is described here.

Having played the resulting .wav, which I feel satisfied with, I am trying to replicate the results with Brutefir.

In essence it is a three tap filter:

  1,
  -0.15,
  0.026

The setup I am using is: Volumio + Brutefir plugin.

What I have attempted is to simply save the three numbers as .txt file and load them into Brutefir.

For some reason I am doing something wrong because there is no resulting music.
Is Brutefir expecting an even number of taps? Is the format the problem?


texts: How to correctly compute the EEG Frequency Bands with Python?

texts:
so I am trying to compute the EEG(25 channels, 512 sampling rate, 248832/channel) bands (alpha, beta, gamma, etc.) with Python. I managed to do so by: firstly filtering the signal with a butterworth filter that looks like this:

def butter_bandpass_filter(data, lowcut, highcut, fs, order=2):
    nyq = 0.5 * fs
    low = lowcut /nyq
    high = highcut/nyq
    b, a = butter(order, [low, high], btype='band')
    #print(b,a)
    y = lfilter(b, a, data)
    return y

I used the filter with the low set on 0.1 and high on 80. Than I compute the fft of the signal and store it in fft1, on which I use again the butterwort filter to extract the frequencies of each band and it looks like this:

for i in np.arange(n):
    alpha1 = butter_bandpass_filter(fft1[i, :], 8.1, 12.0, 256)
    beta1 = butter_bandpass_filter(fft1[i, :], 16.0, 36.0, 256)
    gamma1 = butter_bandpass_filter(fft1[i, :], 36.1, 80, 256)
    delta1 = butter_bandpass_filter(fft1[i, :], 0.0, 4.0, 256)
    sigma1 = butter_bandpass_filter(fft1[i, :], 12.1, 16.0, 256)
    theta1 = butter_bandpass_filter(fft1[i, :], 4.1, 8.0, 256)
    sumalpha1 = sum(abs(alpha1))
    sumbeta1 = sum(abs(beta1))
    sumgamma1 = sum(abs(gamma1))
    sumdelta1 = sum(abs(delta1))
    sumsigma1 = sum(abs(sigma1))
    sumtheta1 = sum(abs(theta1))
    objects = [sumalpha1, sumbeta1, sumgamma1, sumdelta1, sumsigma1, sumtheta1]
    N = len(objects)
    ra = range(N)
    plt.title(signal_labels[i])
    plt.autoscale
    somestuffneeded = np.arange(6)
    ticks = ['alpha','beta','gamma','delta','sigma','theta']
    plt.xticks(somestuffneeded, ticks)
    plt.bar(ra, objects)
    plt.show()

The problem is that I get a high value for gamma( which represents a high cognitive activity, which the person clearly didn't have). The result for the first channel is:

Can anyone point out a better solution/ has any ideas about what is wrong/ can tell me what is wrong? Am I using the filter incorect?
Thanks!


texts: Algorithms for deformable image registration

texts:
I need to perform a deformable image registration (DIR) for delineation of the different brain parts on the brain MRI 3D image. I faced with a problem that there are a lot of different approaches for solving this problem while I don't have enough experience to choose the right approach. First off I tried a lot of different algorithms from the itk library. After that I made several conclusions:

1) Affine registration is not appropriate for general case of this problem (I mean I always can find such examples that require not affine transformation for proper registration).

2) All itk cpu based algorithms for DIR takes at least several minutes to get the appropriate results. The only way to reduce this time is to use gpu based algorithms. (I use 256*256 and 512*512 T1 images)

3) Demons algorithm is really good approach for solving the general purpose registration, I just need to find the right parameters and number of iterations.

Are this conclusions right?
What other fast algorithms for DRI can you suggest? (I have found such algorithms as 6 types of Demon's, SG-LDDMM, IC-LDDMM, BSpline and fluid registration, but I can't find out do they really efficient for solving my problem)

P.S.
I would appreciate any links for gpu based source code for DRI.


texts: Using ICA on EEG signals for feature extraction

texts:
I am attempting to use ICA (FastICA via scikit-learn) on EEG signals from seven electrodes per subject for feature extraction and identity classification – that is to extract signal which is related to a specific cortical area without noise and feed it to e.g. MLP for classification.

As I currently understand it, I should be able to get at most seven individual components which I seem to be achieving, but I do not understand how to actually choose the one related to a specific area nor how to verify the results. How do I know I am not extracting noise (they are all very similar)?

The data have been pre-processed with a Butterworth bandpass filter (4 – 40 Hz). The mean error for classification of six subjects via MLP is currently around 12% but similar studies achieved far better results.

See for example:

Selecting Relevant EEG Signal Locations for Personal Identiﬁcation using ica and neural network
Personal Identification by EEG Using ICA and Neural Network

Excuse the lameness with this one, please – the research papers and introductions to ICA I have read are not brilliant at explaining and use examples involving ideal components.

Anyone?


texts:
I am working with face anti-spoofing. The database consists of a number of real face images and a number of fake images. After pre-processing and feature extraction, I have a feature vector for each image. For classification, the Euclidean distance measure is used. The test image vector is compared with all real image vectors stored in the database, and the minimum distance is chosen (min.1) . The same vector is compared with all fake image vectors and the minimum value is chosen  (min. 2). The minimum rule is applied again to choose the minimum of both min.1 and min.2 to identify the correct class of the test image. My problem is in plotting the ROC curve.  To draw a ROC curve, only the true positive rate (TPR) and false positive rate (FPR) are needed (as functions of some classifier parameter). The TPR defines how many correct positive results occur among all positive samples available during the test. FPR, on the other hand, defines how many incorrect positive results occur among all negative samples available during the test.
I do not have a threshold which can be changed, how can I plot this curve?


texts: how to calculate cross correlation of transient signal?

texts:
there.

Let me have a noisy speech signal $y(k)$ as below.

$$ y(k) = x(k) + v(k) $$

where, $k$ is the discrete-time index, $x(k)$ is clean speech signal, $v(k)$ is a zero-mean random process, uncorrelated with $x(k)$ e.g. white noise.

If we put into this as a vector form:

$$ \textbf{y} (k)  = \textbf{x}(k)+\textbf{v}(k)$$

where,

$$ \textbf{y}(k) = [y(k)  \text{ }\  y(k-1) \text{ }\ ... \text{ }\ y(k-L+1)]^T,$$

$L$ is a length of vector.

If we try to calculate the correlation matrix of size $L \times\ L$, the noisy speech signal can be written as

$$ \textbf{R}_y = E[\textbf{y}(k)\textbf{y}^T(k)] = \textbf{R}_x+\textbf{R}_v.$$

Also, $\textbf{R}_x = E[\textbf{x}(k)\textbf{x}^T(k)]$, $\textbf{R}_v = E[\textbf{v}(k)\textbf{v}^T(k)]$.

However, the speech signal is not the stationary signal but the transient signal.
This correlation matrix also can be used for calculating MVDR(Minimum Variance Distortionless Response) process.

Here is what I want to know.

Because $\textbf{y}(k)$ is not the stationary signal, I think there is a method for calculating the correlation matrix for transient signal.

How can we calculate the cross-correlation matrix for transient signal?

Thank you in advance.

Above article is in the below. If there is any problem, I do delete this post. Thank you.

Jingdong Chen, Jacob Benesty, Yiteng Huang, and Tomas Gaensler(2011), "On single channel noise reduction in the time domain,"  Acoustics, Speech and Signal Processing (ICASSP), 2011 IEEE International Conference on, On page(s): 277 - 280.


texts: What are the standard ways to measure SNR, particularly before demodulation/synchronization?


texts: How to remove spike from the data series?

texts:
I am getting load cell reading from my adc ADS1231 every 100 ms or say at 10Hz i.e. 10 samples per seconds. I have obtained the readings as shown in the image.
As you can see i am getting spike on sample number 8 which I would like to eliminate using digital filtering method. Any advice would be of great help.

I am continuously getting the adc values and the older data will be the first one to go out  the accumulator. In below image i have shown accumulator values from 1 to 10. Latest value will be at position 10 and oldest will be as position 1.


texts: Question on PCM Sampling and Quantization order

texts:
I had a doubt in my mind regarding the orders of sampling and quantization in PCM. What is the impact if the order is reversed, that is, the continuous time signal is first quantized and then sampled? I find a source on the internet claiming that quantization noise will increase with the reversal (link given), but I'm not sure why. Personally, I feel it should be unaffected as we're simply quantizing as in allowing a finite set of amplitudes first and then sampling those amplitudes. Am I missing something?
Link which claims the same: (Question 16)
https://electronicspost.com/signal-and-systems-interview-questions-and-answers/


texts: Is there any alternative basis for a fourier-like transform?

texts:
Fourier transform of a continuous signal is just the projection of the signal on the sinusoidal family for imaginary part and the same family with phase offseted by a quarter of period for the real part.
Beside the magical Euler's formula $e^{ix} = \cos x + i\sin x$ that ease the analysis of the transform and the fact that sinusoidal functions happen to be the solution of a prefect harmonic oscillator, I always wondered where the Fourier supremacy came from. Sinusoidal signals aren't so common in everyday's life. Even with human speech, vocal tract function isn't sinusoisdal.
For example, one transform basis that would seams interesting to me would that with a saw tooth function as signals with fast attack and slow release aren't uncommon...
I guess that the transform need to be inversible and that might not be the case for every basis, but aren't there any alternative basis that provide a bijective forward and inverse transform ? (And if so, what would be the conditions ?)

I will elaborate a little. I'm looking for a basis family of periodicals functions named $B(t)$ for example with B of unitary periods such as : $$ S(f) = T\{s(t)\}(f) = \int s(t) B\left( t * f\right) dt + i \int s(t) B\left((t - \frac{1}{4})*f\right)dt$$ with T inversible in some way...


texts:
The target is to get a color of selected area from taken photo on a mobile device.
So I've needed to make some image processing programmatically.
Is it exist any algorithm to approximate color to it's natural value?


texts: Training a NN classifier on a single\double channel out of a surround sound dataset

texts:
I want to train a neural network for a classification task on the VSD2014 dataset. I have downloaded the movies, but they have a 6 channel audio format (surround sound). 6 channels will cost a very long training time, and so, I wish to trail on a single\double channel first, in order to prove the concept.
Is it better to convert into a stereo or single channel? If so, how do I convert this on MATLAB? Can I get away with, simply, choosing one of the channels? If so, which one? I am guessing the subwoofer channel is not the best choice. I do not even know which one is the subwoofer channel.
How do I train a NN classifier on a single\double channel out of a surround sound dataset?


texts: How do I find the power of a specific frequency at a specific sample of a discrete time varying signal?

texts:
EDIT:

First off let me explain that I understand that frequency makes no sense for a single sample. What I am actually talking about is the power spectrum within a short time window around a specific sample.

I have a time varying discrete signal: $\ s(t_i), i=0...199 $ with sampling dt = 10 ms.

I want to find the power of a specific frequency: 15 Hz at time sample j = 100.

This is how I would solve this:

I understand that I must extract a subset of the signal in a window around j = 100 and multiply it with a window function to avoid "ringing".

I therefore extract the subset j=93..107 and multiply it with a -/+ 2 standard deviations gaussian kernel.

Any advice on the size of the window?

Next I zero-pad the subset to 512 samples in order to achieve some "spectral interpolation"
and take the FFT.

Finally I locate the complex number corresponding to f=15 Hz and take the absolute value.

Actually I would repeat this procedure for j = 7...192 to find the power of f=15 Hz at each sample.

However reading about the Short Time Fourier Transform got me confused:

they seem to break the data to be transformed into overlapping chunks,
window the data within each chunk, take the FFT and then somehow adding the results together!?

Is this just a matter of performance?
As a first solution I would prefer a simple but slow approach (such as mine).


texts: Does any paper use energy harvest to in the baseband?

texts:
Most of RF energy harvest system just harvest $\rho$  of the RF signal for charging the battery,and the other part RF energy will be processed to baseband signal by RF Chain to do the information decoding,like this below

Now i have a new thinking,if we receive signal and use the RF chain to let the signal become the baseband signal first,then use the power splitter to let $\rho$ of baseband signal power to charge the battery(energy harvest).Can we do that?

Is there any paper which use this method to do the energy harvest?like this below


texts: Comparing two audio (Phone operator messages)

texts:
I have this two wavs. Same audible audio differente data.

The audios are phone operator messages, so they are always the same.

Wav:http://instaud.io/3Ezu

Wav:http://instaud.io/3Ezw

Using this formula I found here i get how similar they are:

https://stackoverflow.com/questions/5847570/use-convolution-to-find-a-reference-audio-sample-in-a-continuous-stream-of-sound

    double[] Data1 = GetMyWav1InDoubles();
    double[] Data2 = GetMyWav2InDoubles();
    double Mx = Data1.Average();
    double My = Data2.Average();

    double Denominator1 = Math.Sqrt(Data1.Sum(x => (x - Mx) * (x - Mx)));
    double Denominator2 = Math.Sqrt(Data2.Sum(y => (y - My) * (y - My)));
    double MaximumNormalizedCrossCorrelation = maxValue / (Denominator1 * Denominator2);

The MaximumNormalizedCrossCorrelation value es 56% similar which is low, considering they sound the same...

I have read I must do FFT and then compare! but I'm lost, I'm using:

http://www.alglib.net/translator/man/manual.csharp.html#example_fft_real_d1

After getting the real part of the result I got this graphs

So, how can i get a similarity percentage?

I read this:

src: https://lstsal.wordpress.com/2015/02/28/comparing-two-audio-files/

but how?


texts: difference between GMSK (Gaussian Minimum shift keying) and GFSK (Gaussain frequency shift keying)

texts:
I am unable to differentiate GMSK and GFSK.
How do the modulation techniques differ in Tx?

How do their receiving techniques differ..?


texts:
I am trying to implement a burst demodulator. I have catered bits in premable for carrier and timing recovery and for fec also
in the recieve side if i am using viterbi decoder/TPC coder will the processing add any extra processing time. So if my burst time is say 1 ms. Is it possible to decode inside the 1ms or will there be any processing delays?


texts: How can 802.11p ensure 1 Mbps in 1 km range?

texts:
Using the 802.11p standard, mobile vehicles can communicate each other.

IEEE 802.11p standard typically uses channels of 10 MHz bandwidth in the 5.9 GHz band (5.850-5.925 GHz).

And the transmission power is typically 20 mW.

In BPSK OFDM and 1/2 code rate of 802.11p standard documents, data rate of 802.11p is 3 Mbps. But in some overview, the 1 Mbps is ensured in 1 km transmission range.

Is the data rate is changed in the real environment?

If so, how was the data rate 1 Mbps calculated?


texts: Double the "speed", double the frequency?

texts:
Usually, when some sample is played-back at twice the rate it was recorded, the pitch of the recording sounds an octave higher.

For example: $g(t) = \sin(2 \pi f t)$ and $g(2t) = \sin(2 \pi f 2 t) \implies \sin(4 \pi ft)$. Where $f$ is a given frequency.

There are some strange "sample" cases however that when played back at twice their recording rate their pitch appears to...not have changed as expected. And some even stranger "sample" cases that when played back at twice their recording rate their pitch appears to be...lower!

How do these strange "sample" cases might "look like" (in terms of a mathematical description) and what are, broadly, the conditions that can lead to such cases?

EDIT (hint 1):

Variants of the technique of pitch-shifting / time stretching have been mentioned so far by more than one persons in relation to this question.

Pitch shifting is not the core of the question and the technique of pitch-shifting does not change the nature of the question.

As it was pointed out in one of the comments to this post and as a form of a hint: Yes, pitch shifting does alter the pitch of the "sample" but a) what sort of sample would sound almost identical to its unshifted version if it was passed through a $2 \times$ pitch shifter and b) what sort of sample would sound at a lower pitch if it was passed through a $2 \times$ pitch shifter. (the $2 \times$ here is just an example).

EDIT (hint 2):

Another two things that have appeared in responses so far are aliasing and some aspect of human hearing. In other words, "Maybe you have pitch shifted in such a way that the frequency jumps back on to itself" and also "Maybe you are taking advantage of some psychoacoustic phenomenon in which the frequency has changed but the perceived frequency does not"

Aliasing and the limits of human hearing are relevant to this question but are not absolute requirements for the "paradox" that is mentioned here to occur.


texts: Incremental Online Update of Tf-IDF Indices for Image Retrieval

texts:
In their paper Scalable Recognition with a Vocabulary Tree, Nister and Stewenius mention that after an offline training stage, new images can be inserted
on-the-ﬂy into the database. However, at the end of the training stage the IDF is computed and normalized. My question is, how would you incrementally update such a database composed of inverted document frequencies?


texts:
Having $h[n]=u_0[n]+0.8u_0[n-1]+1.6u_0[n-2]$ and $x[n]=(u_1[n]-u_1[n-3])$

The goal is to determine if the system $y[n]=h[n]*x[n]$ is linear.

I know that I would have to test it for Homogenity and Additivity in order to determine if the system is linear or not, but the actual proccess testing it is getting me confused.

My professor did it the following way:

$$y_1[n]=h[n]*x_1[n]$$

$$y_2[n]=h[n]*x_2[n]$$

$$h[n]*(\alpha x_1[n]+\beta x_2[n])$$

$$y[n]=h[n]*\alpha x_1[n]+h[n]*\beta x_2[n]$$

Wasn't this insufficient to prove linearity? Wouldn't we have to test it with the actual values of $x[n]$ and $h[n]$?


texts:
One of my weekend projects has brought me into the deep waters of signal processing. As with all my code projects that require some heavy-duty math, I'm more than happy to tinker my way to a solution despite a lack of theoretical grounding, but in this case I have none, and would love some advice on my problem, namely: I'm trying to figure out exactly when the live audience laughs during a TV show.

I spent quite a bit of time reading up on machine learning approaches for detecting laughter, but realized that's more to do with detecting individual laughter. Two hundred people laughing at once will have much different acoustical properties, and my intuition is that they should be distinguishable through much cruder techniques than a neural network. I may be completely wrong, though! Would appreciate thoughts on the matter.

Here's what I've tried so far: I chopped up a five minute excerpt from a recent episode of Saturday Night Live into two second clips. I then labeled these "laughs" or "no-laughs". Using Librosa's MFCC feature extractor, I then ran a K-Means clustering on the data, and got good results -- the two clusters mapped very neatly to my labels. But when I tried to iterate through the longer file the predictions didn't hold water.

What I'm going to try now: I'm going to be more precise about creating these laughter clips. Rather than do a blind split and sort, I'm going to manually extract them, so that no dialogue is polluting the signal. Then I'll split them into quarter second clips, calculate the MFCC's of these, and use them to train a SVM.

My questions at this point:

Is any of this making sense?
Can statistics help here? I've been scrolling around in Audacity's spectrogram view mode and I can see pretty clearly where laughs occur. In a log power spectrogram, speech has a very distinctive, "furrowed" appearance. In contrast, laughter covers a broad spectrum of frequency quite evenly, almost like a normal distribution. It's even possible to visually distinguish applause from laughter by the more limited set of frequencies represented in applause. That makes me think of standard deviations. I see there's something called the Kolmogorov–Smirnov test, might that be helpful here?

(You can see the laugh in the above image as a wall of orange hitting at 45% of the way in.)
The linear spectrogram seems to show that the laughter is more energetic in lower frequencies and fades out towards the higher frequencies -- does this mean it qualifies as pink noise? If so, could that be a foothold on the problem?

I apologize if I misused any jargon, I've been on Wikipedia quite a bit for this one and wouldn't be surprised if I got some jumbled.


texts: Can I use Fourier transforms instead of Laplace transforms (analyzing RC circuit)?

texts:
I don't study electrical engineering or something related but I was assigned a problem on transfer functions, impulse responses, and in general, everything related to this post. (Specifically, I'm analyzing an RC circuit)

I do know the details of the Laplace transform but I prefer the Fourier transform. I wanted to know if there is any problem in substituting the Laplace transform for the Fourier transform in the analysis of LTI systems, impulse responses and transfer functions.

The important thing these transforms share is a Convolution theorem, which is highly relevant to the analysis of the things I've already mentioned above.

What do you think? What am I sacrificing by substituting transforms? Why is the Laplace transform favored over the Fourier transform?


texts:
Good afternoon. I have some heart monitor data that I am attempting to analyze. I have been given time between the peaks (in milliseconds), and have attempted to reverse-engineer a signal from this using the following code.

clc;
clear all;
%Sampling frequency
Fs = 250;
%total data time (s)
ts = xlsread('12_RR_1.xlsx','G:G');
%total data time (ms)
%total_time = xlsread('12_RR.csv.xlsx','I:I');
%Point in time where there is a max point
xn = xlsread('12_RR_1.xlsx','H:H');
xnt = size(xn);

t = 1:ts;
time = transpose(t);

for i = 1:ts
    for j = 1:xnt(1,1)
        z(i,j) = xn(j,1);
    end
        i = i+1;
        j = j+1;
end

for i_2= 1:97484
    for j = 1:xnt(1,1)
   if time(i_2,1) == z(i_2,j)
       z_raw(i_2,j) = 1;
   else
       z_raw(i_2,j) = 0;
   end
    end
    i_2 = i_2+1;
   j = j+1;
end

 peaks = sum(z_raw,2);
 Peaks = abs(peaks);
  N = length(peaks);

 subplot(2,1,1)
 plot(t,Peaks)
 title('Raw Data')
 subplot(2,1,2)
 plot(t/Fs,fft(Peaks,ts))
 title('FFT')

This produces a binary signal where y=1 if a peak is detected and y=0 if it is not. However, when I attempted to take the FFT of this it returns a signal with weirdly uniform noise, as shown below.

What's going on--why does a seemingly low-frequency signal have a uniform frequency response? What can I do to my original data (the time between heart impulses) to extract more meaningful information and get a more realistic FFT (high amp low freq data with small amp high freq data)


texts: A few overview questions about FFT. Relationships between input, buffer size, and expected output?

texts:
I have a FFT set up and I've found that it responds very differently based on the buffer size and input. The output varies wildly, with magnitude of the peak frequency ranging from 500 to <1.

I have two tests in particular I'm running, the first being a sine wave at amplitude 1.0 with an LFO sweeping it's frequency at 0.1Hz. I've found that smaller buffers are more accurate in their ability to track the frequency. The magnitude of the frequency playing reaches 300 pretty easily.

The next test is with a mic, and it responds incredibly differently. If I whistle or hum, it will pick up that frequency. If I play music, rather than getting an increase in magnitudes of all frequencies, everything becomes weaker, including any whistling or humming. Changing the buffer size to be smaller helps, but at most iterations of the FFT on a buffer it results in very tiny magnitudes across the board.

In general, the things I'm finding are that smaller buffers are more likely to get a very strong magnitude of a frequency, but the more frequencies there are with a (magnitude > 1), the less likely that any of them are very strong (> 200).  But none of this really means anything if it's a product of a broken implementation, and I can't seem to find any specific numeric information on what my expectations should be.

So, given an audio input and an output of frequencies and magnitudes (calculated by $\sqrt{\frac{\text{real}^2 + \text{imag}^2}{\frac{\text{numSamples}}{2}}}$), my questions are as follows:

Given a sole, unmoving sine wave, with a relatively small buffer size what kind of magnitudes are to be expected on what frequencies?
Given a sole, unmoving sine wave, with a relatively large buffer size what kind of magnitudes are to be expected on what frequencies?
Given a sole, sweeping frequency sine wave, with a relatively small buffer size what kind of magnitudes are to be expected on what frequencies?
Given a sole, sweeping frequency sine wave, with a relatively large buffer size what kind of magnitudes are to be expected on what frequencies?
Given static, with a relatively small buffer, what kind of magnitudes are to be expected?
Given static, with a relatively large buffer, what kind of magnitudes are to be expected?

I know this is a lot of questions, but the results I'm getting from these tests are not what I was expecting, and I want to start by making sure it's not my expectations that were wrong.


texts:
Given a gaussian white noise with mean 0 and $\sigma = 1$.
I'm interested in the PSD (power spectral density), when the signal is plain up- or downsampled. No interpolation, no filtering nothing.

There are some related topics in the web, but they are always ending with someone considering low- or passband filters. They are also often speaking about the aliases which get e.g. back in the nyquist band when downsampling, but they never properly describe it with math:

So, what happens with the given PSD, (which should have an amplitude of 1/fs between -fs/2 and fs/2) when it's led trough a down and upsampler?

I assume first, up and down or the opposite should result in the same PSD. Otherwise one could just up and downsample to benefit from some noise reduction.
I could also imagine that up and down sampling make no changes at all to white noise. On the other hand, there might be an effect when downsampling, due to aliases.


texts: How to determine the type of a digital filter given its expression?

texts:
I'm trying to understand a variant of the filter presented in http://www.stockspotter.com/files/PredictiveIndicators.pdf in the "Code Listing 1.". Its expression is given as follow:
$$y_n = c_0 x_n + c_1  y_{n-1} + c_{2}  y_{n-2}$$ with:
\begin{align}
c_0&=(1-c_1-c_2) \\
c_1&=2 a \cos\left(2\frac{\pi\sqrt{2}}{T_s}\right) \\
c_2&=-a^2
\end{align}
and:
\begin{align}
a&=\exp\left({-\frac{\pi\sqrt{2}}{T_s}}\right) \\
T_s&=10
\end{align}
I'm wondering how these coefficients were computed. I'm told it might be a 2-pole Butterworth filter, but my attempts at finding the coefficients for such a filter failed (and my searches online give me many different results, sometimes involving $x_{n-1}$ and $x_{n-2}$ whereas they are not used in this expression.
Does this ``SuperSmoother'' filter has another name in the literature ? How could I describe the effect of such a filter (beside being a low-pass filter)?
The paper is cited in the Linux Kernel's packet rate estimation smoothing.

For the records, here is the response of this filter using the notebook provided in the answers, compared with a moving average and an exponential moving average:

As someone remarked on IRC, this filter looks a lot like the "multiple feedback digital low-pass filter" from Chamberlin 1987 book "Musical Applications of Microprocessors", with $F=\frac{\sqrt{2}}{16}$ and $Q=1$:


texts: Why do cutoff frequencies of a high-pass digital filter differ from the ones i used to transform it from a low-pass analog filter in MATLAB?

texts:
I need to transform an elliptic analog low-pass filter to a digital high-pass filter but i'm having a problem because the resulting filter has lower cutoff frequencies than the ones i set. Here is the code sample from MATLAB:

Fs = 44100; %Sampling rate
Rp = 0.05;
Rs = 60;

Wp = 2*pi*10000; %Cutoff frequencies of my high-pass filter
Ws = 2*pi*9700;

WsE= Wp/Ws; %LP->HP transformation for the analog stopband frequency
WpE=1

k=sqrt(1-(WpE/WsE)^2); %Elliptic filter calculation of N
D=(10^(0.1*Rs)-1)/(10^(0.1*Rp)-1);
q0=(1/2)*((1-sqrt(k))/(1+sqrt(k)));
q=q0+2*q0^5+15*q0^9+150*q0^13;
N=ceil(log10(16*D)/(log10(1/q)));

[z,p,k]=ellipap(N,Rp,Rs); %Making the analog prototype
bE=k*poly(z);aE=poly(p);

[bE,aE]=lp2hp(bE,aE,Wp); %Transforming the low-pass into a high-pass
[bd,ad]=bilinear(bE,aE,Fs);

Ndigital = 20000;
[h,w]=freqz(bd,ad,Ndigital);
H=abs(h);

f = w/(2*pi)*Fs; % Ploting the filter
figure(1);
plot(f,20*log10(H), 'LineWidth', 2);
xlabel('Hz');
ylabel('|H(z)|');
pause

and i am expecting a filter with my desired frequencies but get this:

I can't pin-point the problem in the code. Why am i getting these results and how do i fix them?


texts: Uneven background subtraction: Rolling ball vs Disk tophat

texts:
A classical technique in still images (e.g. fluorescence microscopy images) to remove uneven illumination and isolate bright blobs is to use morphological operation such as the top-hat transform.

For instance the Rolling-ball algorithm[1] uses a ball as a structuring element and performs the top-hat transform[2].

The structuring element is a grayscale element that extends the disk structuring element in 3D. For instance in MATLAB:

se2 = strel('ball', 3, 3);
     0    0.4999    0.9997    1.4996    0.9997    0.4999         0
0.4999    0.9997    1.4996    1.9995    1.4996    0.9997    0.4999
0.9997    1.4996    1.9995    2.4994    1.9995    1.4996    0.9997
1.4996    1.9995    2.4994    2.9992    2.4994    1.9995    1.4996
0.9997    1.4996    1.9995    2.4994    1.9995    1.4996    0.9997
0.4999    0.9997    1.4996    1.9995    1.4996    0.9997    0.4999
     0    0.4999    0.9997    1.4996    0.9997    0.4999         0

My question is: Is it so much better than simply using a binary disk as a structuring element? What are the use cases where a rolling ball is way better, or even required?

My experiments with comparing the outputs of the two do not show a striking difference between the two, but the literature behind the Rolling ball is very abundant.

[1] Stanley Sternberg, "Biomedical Image Processing", IEEE Computer, January 1983

[2] Here is the source code for a Java implementation in ImageJ: http://rsbweb.nih.gov/ij/plugins/download/Rolling_Ball_Background.java


texts:
Here is the part of the paper,

  Based on these architectures, a lot of recent developments have lately appeared intending at enhancing the rate-energy performance of multiuser Multiple
  Input Single Output (MISO) SWIPT systems.These works mainly target at the optimization of TX precoding and PS operation, and can be classiﬁed into the following two categories. The ﬁrst category is based on whether RXs are required to perform both Information Decoding (ID) and Energy Harvesting(EH) (co-located ID and EH) or just act as ID or EH RXs (separated ID and EH). The second category includes performance objectives like the minimization of TX power required for meeting Quality of Service (QoS) and EH constraints, and throughput or EH maximization for a given TX power budget and QoS constraints

Why do we need to minimize the TX power to require for meeting QoS? Does't the more powerful signal means it can be broadcasted to the farer place?

paper link : https://www.groundai.com/project/energy-sustainable-iot-with-individual-qos-constraints-through-miso-swipt-multicasting/


texts:
I conducted a research on how to implement a QPSK demodulator. I found out the Quadrature QPSK demodulation technique which seems very straight forward. Here is what i understood from the explanation of the block diagram, and would like to confirm from this platform if my understanding is right.  From the block diagram below, I am meant to do the following for a 2048 bits QPSK modulated signal:

Split the incoming 2048 bits of QPSK modulated signal into the I and Q phase
Multiply the 1024 bits in the I phase by the recovered carrier
multiply the other 1024 bits in the Q phase by the 90 shifted recovered carrier

My question is what do I do to this sets of I and Q phase outputs in order to get my demodulated bits ?

Most explanations I have seen just says it passes through a decision maker, but none has gone the extra length to explain what really happens within the decision maker


texts: Two lock in amplifiers, almost identical setup, different AC Gain?

texts: I am measuring a voltage output of around ~110 uV for two thermometers. Other than the placement of the thermometers on the sample and the frequency of the lock ins, everything else is kept the same but for some reason the lock ins hits at input overload at different AC gains. Could this be a ground loop issue? I'm not quite sure what else it could be as I'm still trying to familiarize myself with the lock ins. Any suggestions are appreciated!


texts: Interpretation of FFT result when frequency is an exact multiple of frequency bin

texts:
My FFT spectrum analyzer works fine in general except when the frequency is an exact multiple of the frequency bin. In the pic at the left the frequency is 5999Hz and at the right 6000Hz. The lines that appear when the frequency is an exact multiple, appear randomly (i.e. when I change the frequency to 5999Hz and back to 6000Hz the lines may be fewer or in some cases non-existent at all ).

How should I interpret the FFT results when the frequency is an exact multiple of the frequency bin?


texts: I am not working in signal processing field, but recently I happen to read a paper which estimates source numbers using Gerschgorin radii, and I feel kind of confused about why we need to estimate eigenvalues (this might be a silly question in your point of view). I google it and some answers say the reason is that it is hard to get eigenvalues in some cases. But I still feel confused. It seems to me that we can directly calculate some or even all the eigenvalues even though the matrix is in relatively huge sizes, for example, $1000\times 1000$, with the formulation $AA^T x=\lambda x$, which can be done in a few second in Matlab. Is there anything wrong with the way I think?


texts:
I'm smoothing a signal with an little algorithme and I can control the amount of smoothing dynamically. Now it could be interesting to drive that amount with a measure depending of the frequency content. in other words if my signal is containing quick frequency it is interesting to have less of smoothing especially is the main signal is stationary.

What could I use for that? I tried mobile variance but I'm not sure this is the best method. I'm trying to avoid FFT methods or other that could dephase the signal.

second question, does kurtosis can be something relevant for that ? I think no but I would like to be sure.

thank in advance : )

PS: this isn't in real time, just sayin'


texts: Measures that can be used to truncate linear series of functions

texts:
Say we have the following (wavelet) series representation at some location and scale in a signal:

$$ f = \sum_{k=1}^{K} c_k \psi_k$$

where $c_k$ is the coefficient, in order of magnitude ($|c_k| > |c_{k+1}|$) and $\psi_k$ is the wavelet, although it could be any $L_2$ function I guess.

Is there a principled way of truncating the series? E.g. could AIC be applied to say choose the first $N < K$ wavelets? If so how?


texts:
I am new to image processing and I am interested how image masking can be used to extract a portion of a image.

Have a look at this OpenCV tutorial.

In the section Application of Mask, they say that you can use a white mask over the area of the image you want to extract.

So I am interested in how this math works. Correct me if I am wrong but if I take the minimum of the pixel from the original pixel and the mask I should get the portion of the portion of the image I want to extract.

This works because the area that I want to extract is covered by the white area of the mask, ie covered by pixels with 255 in all channels, so

min(pixel, 255)

will always give me the pixel value,

while on the other hand the portions I don't want are covered by black pixels(intensity value of 0), so

min(pixel, 0)

will always give me 0 thus I will exclude these sections from my filter.

This my intuition correct ? Is this how image masking works in order to extract the image ?


texts: What is the bandwidth of a NRZ signal (of a given frequency) and how would you directly synthesize a discrete version a band-limited NRZ signal at some higher sample rate?


texts: Convert a Park McClellan FIR Solution to Achieve Stop-band Roll-off

texts:
Often it is more desirable to have a roll-off versus frequency of the rejection in the stopband; for example resampling filters where all the alias image locations fold into the first Nyquist Zone. What is a VERY simple change you can make to the coefficient solution provided by the Parks-McClellan algorithm that will convert the "equiripple" stopband to one that rolls off with greater rejection (at the expense of exceeding target limits near the transition, and increasing passband ripple)? Note: This is a great "trick" that I learned from fred harris.

Note- for full credit please explain why this "trick" works.

To help illustrate the end result, see the plot below showing a standard design using P-McC before and after the simple modification.  Here we see the stop band rejection with a roll-off instead of being flat, but increased passband ripple and degraded rejection immediately near the beginning of the stopband, but overall significantly better rejection.

Before (blue) and after (red) modifcation to filter coeff. Note the region close to the transition where the stop band is worst, but overall rejection is much better:

Zoom in showing trade-off of degraded ripple in passband.


texts:
For OFDM we select the known gold sequence as the preamble or pilots. We can correctly estimate the channel(10 to 20taps).

Is there any relationship between the length of preamble and the number of taps of the channel?

For eg. Using a length of 8 pilot samples can we detect a channel of 20 taps?

Any insights?


texts:
I’m running an auto regressive model with IIR exponentially decaying filters.
Let $V$ be the input dataset and let $X_s$ be $V$ convoluted with an causal exponential IIR low-pass filter with decay rate $s$.
I’ve noticed that $<X_{s1}, X_{s2}> = (<V, X_{s1}> + <X_{s2}, V>) / (s1 + s2)$. As such, you can use these inner products to create a covariance matrix.
I’ve also noticed that letting $Y_s$ be the time-flip of $X_s$. I’ve noticed that $<Y_{s1}, X_{s2}> = (<V, X_{s1}> - <V, X_{s2}>) / (s2 - s1)$.
When you form $X^tX$ and $X^tY$ from these equations you’ll find that the matrix-solution greatly resembles the Yule-Walker equations. But the square $XtX$ is not quite Toeplitz. I’m having trouble understanding the exact relationship.
Any insights would be greatly appreciated!
James


texts: Why calculate negative frequencies of DFT?

texts:
This answer says that when calculating the DFT on a real valued signal, the (roughly) second half of the bins are the complex conjugates of the first half of the bins. Firstly I was curious if that is true?

If it is true, it seems like for frequency analysis purposes, you could forgo calculating the second half of the bins, which ought to be helpful for computation times and also for storage space if you want to store information in frequency domain since you could calculate the second half of the information on demand.

This also seems to be "more correct" to what people would expect when doing an FFT.

For instance, if using the equation:

$$X_k = \frac 1N \sum\limits_{n=0}^{N-1}x_ke^{-2i \pi kn/N}, \quad k\in[0,N), \quad k\in \mathbb Z$$

If you DFT a 4 sample cosine wave: $[1, 0, -1, 0]$, it gives the result: $[0, 0.5, 0, 0.5]$.

But, if you are only calculating the positive frequencies, it seems reasonable to modify the equation to be this:

$$X_k = \frac 2N \sum\limits_{n=0}^{N-1}x_ke^{-2i \pi kn/N}, \quad k\in[0,N/2), \quad k\in \mathbb Z$$

Which when applied to the 4 sample cosine wave gives us this result:
$[0,1]$

It seems more correct (to me anyways!) that it shows that $0\textrm{ Hz}$ (DC) has an amplitude of 0, and that $1\textrm{ Hz}$ has an amplitude of 1.  It's kind of confusing the other way, where the full amplitude of the $1\textrm{ Hz}$ wave is split between the positive and negative $1\textrm{ Hz}$ frequency.

Why is it then, that for real valued signals, we even bother calculating and reporting negative frequencies?


texts: How to ampfify/reduce certain frequencies in time data

texts:
currently I am trying to filter time data so that certain containing frequencies are getting amplified/reduced. I am dealing with a system which has a certain characteristic that I would like to get rid of by modifying my system input time signal so that the changes the system does to my signal result in getting back my original signal:
$y(t)$ -> $Equalizer$ -> $y2(t)$ -> $System$ -> $y(t)$
So I need to figure out the Equalizer part. I am working in Matlab and my time signal has a fixed sample time $Fs$. I used pink noise as an input signal to the system and I recorded the output of it:

Using Y=fft(y) and Y2=fft(y2) by doing V=Y./Y2 I could calculate y2=ifft(V.*fft(y)) which then would give the alternated input $y2(t)$ to my system. Does this work like this? Here is how V should look like:

However I would also be interested in a solution using the filter() command in matlab to do everything in the time domain using a difference equation. I expect that solution to be much faster. The whole thing should run in real time continuously and I assume using fft() on chunks of data is slowing things down. Also the data length of the chunks could be changing and then I would need to change the length of the vector V all the time.
The overall gain of my output signal is not important for me. So for instance if the output also shows the pink noise characteristic while all frequencies are 10 dB down that would be fine for me. Phase information is also not relevant.
Thank you for any help!


texts:
I am using a Sigma Delta ADC and really understood the working of it
I need to sample a signal at 8.5 Mhz.
The SD ADC has a Demodulator and decimating FIR filter
The Oversampling ratio options are 32/64/128/256 and FIR filter has 32 taps
What should be OSR ratio and how to determine the FIR coefficients
Thanks


texts: How to scale fundamental frequency to [0,1]?

texts:
[Sorry for the noobish question...]

I have a signal which is known to be generated by a process operating at some known rate $f$ Hz and the sampling rate is also know to be $K$ Hz. Now I do a periodogram of the signal and its first peak (aka fundamental frequency, right?) closely corresponds to $f$  - so I'm quite happy.

But now I want to estimate the amplitude and phase using a standard algorithm which I am taking from this good book (Algorithm 9.2). The snag is that there the frequency $f_{0}$ is supposed to satisfy $0 < f_{0} <\frac{1}{2}$ and I am at a loss as to how to convert my $f$ to Kay's $f_{0}$. I tried to take $f_{0}=\frac{f}{K}$ but got gibberish results.


texts: What is the difference between convolution filter, low-pass filter, and median filter?

texts:
Isn't blur filters, like median filter, a type of convolution filter?
How does a low-pass filter relate to them?
Why does this guy differentiate convolution filters here from blur filters here?


texts: Coherence of a signal with itself to assess the PSD increase due to device turning on

texts:
I have a sensor that acquires data in the form of a time series, which I can model as a (mostly Gaussian) stationary stochastic process. I can study it in the frequency domain through its Power Spectral Density (PSD). Then, I have a device that when turned on changes the spectral properties of the previous signal, in particular in a specific frequency band.
I would like to characterize in the frequency domain the effect of this device turning on. I'm thinking of something similar to a "transfer function", but I don't have an input and an output signal, just two realizations of the same one. Actually, these are not exactly realizations of the same process because of the frequency region where the PSD is modified by the device turned on.
I was thinking of computing the coherence between the time series that I have when the device is on and when it is off. However, the signal is uncorrelated with itself (even ignoring the device) after some time, so it is going to be zero. Or, to be precise, proportional to the number of averages I've made for estimating the PSDs with Welch's method.
So, do you know of some metric more informative than the simple ratio of the two PSDs?
Thanks!


texts: Concept of combining multiple FIR Filters into 1 FIR filter

texts:
I try to combine my 7 band FIR filters into 1 FIR in order to process an audio signal.  I  use convolution to combine their coefficients but the effective is not the same as I apply 7 different FIR filter.  I also have the gain problem

H = conv(conv(conv(conv(conv(conv(h1,h2),h3),h4),h5),h6),h7)

My questions are
Is convolution a correct way to do combine multiple FIR filters into one filter
If not, then what technique should I look into?
If yes, then what did I do wrong?

Regards


texts: A 3x3 image kernel takes 9 multiplications and 8 or 9 additions for each pixel?

texts:
I doubt because you have 9 multiplications and you are adding 9 numbers together, when using a 3x3 convolution matrix.

Adding 9 numbers: 1+2+3+4+5+6+7+8+9

We are performing 8 additions  as we repeat the operation of 'adding' 8 times (8 times a '+' sign).

We can say there are 9 additions as well, if you would accept a definition like: 0+1+2+3+4+5+6+7+8+9

But what does make more sense for computers: 8 adds or 9 adds?


texts: Invertibility of Time-Dependent Fourier Transform

texts:
I am reading Oppenheim & Schafer's (O&S) Discrete Time Signal Processing (2nd or 3rd edition, does not matter) and I find hard to understand a technicality behind the Time-Dependent Fourier Transform (TDFT from now on). Specifically, I have a question regarding the invertibility of the TDFT.

According to the textbook, the TDFT is given by
$$X[n, \lambda) = \sum_{m=-\infty}^{+\infty}x[n+m]w[m]e^{-j\lambda m}$$
which can be thought as the DTFT of a windowed signal portion around sample $n$. So, by moving one sample at a time, we have "a collection" of DTFTs of windowed signal portions around sample $n$, and the TDFT is a 3D-function (consider magnitude only) with axis $n$ vs axis $\lambda$.

Then, O&S mentions that the TDFT is invertible iff $w[m]$ has at least one nonzero sample.

If we take the Fourier synthesis equation, we get: $$x[n+m]w[m]=\frac{1}{2\pi}\int_0^{2\pi} X[n,\lambda)e^{j\lambda m}d\lambda, \: \: \: -\infty < m < +\infty$$
which makes perfect sense as it reconstructs the windowed signal around sample $n$ from complex exponentials weighted by the DTFT $X[n, \lambda)$.
Dividing by the window: $$x[n+m] = \frac{1}{2\pi w[m]}\int_0^{2\pi} X[n, \lambda)d\lambda$$ if $w[m] \neq 0$.

Here's my question: where did the $e^{j\lambda m}$ term go??

Isn't this equation supposed to recover the full windowed signal $x[n+m]$? The integral looks as a number to me (summing $X[n,\lambda)$ values for all $\lambda$ at index $n$ of the TDFT).

The same equation is in all O&S versions, so I guess it's not a typo and I am missing something very fundamental here :D

Thanks in advance.


texts:
I'm relatively new to DSP so excuse my simplified words, and my detailed explanation.

if the signal have non-coherent sinusiod, it will induce energy spreading into the frequency domain.

One of the solutions is :

how to estimate the signal component correctly?

And I'm stuck here, I don't really know how to optimize such problem and setting a stopping criterion in Matlab,R..etc

How to optimize such objective function?

What are you thoughts about the drawbacks about such solution to separate signal components?

Thanks in advance :) ,


texts: Finding where signal is showing some (unknown) periodicity

texts:
I have readings of the vertical displacement of someone over time, as in the picture below:

At some points in time, the person will be exercising or jumping up & down, creating more or less obvious periodic motions (yellow regions of the graph). I am now trying to find a way to automatically spot these yellow areas, by looking for periodicity in the recorded signal.

My initial attempt has been to use a spectrogram, using the specgram built-in function in Octave:
segmentLength=150;
window=hanning(150);
overlap = 80% * segmentLength;
specgram(x, segmentLength, 1, window, overlap)

Which results in the following output:

This seems to be hinting in an ok direction since I see for example that something gets picked up just before frame 2000, however it is not very conclusive. Given my limited understanding of the spectrogram, I am not sure how to proceed from here.

Is the spectrogram the right approach? If yes, how can I improve the output? If no, what approach would you recommend for this task? I am aware that some of the windows that I am trying to identify will be too difficult, but was expecting to at least pick up windows 1, 2 and 5 (starting from the left). Thanks for any pointers!

EDIT

I have tried to implement a simple ASDF in octave with the following code:

#Parameters for asdf analysis
  N=400; %Window size
  kmin= 12;
  kmax= 40;
  step = 50;

  n0min = floor((N+kmax)/2);
  n0max= size(x,2) - floor((N+kmax)/2) -1;
  Q=zeros(kmax-kmin+1, floor((n0max-n0min)/step)+2);

  i=1;
    for k= kmin : kmax %i

    j=1;
    for n0= n0min : step : n0max %j
      for n= 1 : N-1
        Q(i, j) = Q(i,j) + ( (x(n+n0-n0min) - x(n+n0-n0min+k))^2 * hanning(N)(n+1) );
      end
      Q(i, j) = (2/N) * Q(i,j);
      j++;
    end

    fprintf('Calculated %d out of %d periods \n', k-kmin+1, kmax-kmin+1);
    fflush(stdout);

    i++;
  end

  imagesc(Q)

Tweaking around with the parameters, I ended up with the ones shown in the code, that yield the following result:

This is already getting closer to what I expected. Other suggestions welcome :)


texts:
I'm currently reading a paper and I can't seem to make sense of a certain part. A link to the paper: removed

The part I don't quite get is on page 286 (after the part where they explain their filters). It starts with the sentence "Two common methods can be used ...". They explain how they calculate the interbeat intervals of a signal.

The things I do not understand:

  Cubic spline interpolation is applied to the data for ensuring the
  existence of continuous ﬁrst-order differential and second-order
  differential

1. Do they mean that the first & second order derivative of two sequential splines should be the same to ensure that they are smooth ?

Then:

  $m$ is the number of feature points

2. Is this the $n$ in the formula ? ( really none of the symbols are explained of the formula. I doubt t is the value at a certain frame, since the values are really small, which would make it impossible to be in the defined interval.)

Subsequently then:

  We consider the interval between [0.25, 2]

3. what is this interval ? With respect to which variable ?

And this sentence I can't figure out entirely.

  We choose the ﬁrst-order differential point in each cycle of BVP as
  characteristic point to demarcate the interval. The number of
  ﬁrst-order differential points in a period of wave ﬂuctuates narrowly
  than the number of usual maximum points in the presence of measuring
  errors.

4. How do they know anything about any cycle at this point, this is what they are trying to determine at this point ...

5. What is a first-order differential point in a cycle ?

6. Is a feature point a first-order differential point ?

I am trying to implement this (in python), based on this explanation I can't seem to figure out the details to do this.


texts: Sampling and the creation of multiple images at integer multiples of the sampling frequency

texts:
From what I thought I learned about sampling is that when you draw a sampled signal in the frequency domain, you can show copies or "images" of that signal at integer multiples of the sampling frequency. Is this true?

If so, I'm having a hard time understanding this conceptually. What does it really mean to make a copy at a different location on the frequency line?

For example, if I have a signal which when drawn in the frequency domain looks like a box centered at zero extending from $f_{low}$ to $f_{high}$, can I now say I can draw this box centered at integer multiples of the sampling frequency and so long as my box when redrawn does not touch another box I avoid aliasing? Why do I do this at integer multiples? For example if my sampling frequency is $20 \ \mathrm{Hz}$, what does the next integer multiple at $40 \ \mathrm{Hz}$ tell me? Does it mean I'll see something interesting if the signal were to run at $40 \ \mathrm{Hz}$?

I'm trying to get a better understanding of this so I can then understand bandpass sampling and what it means to select a location at $k$, $k-1$, etc.


texts:
I want to compare two signals or curves.

Unfortunately they have different sample rates. The first one is sampled at 30 Hz, the second at 2000 Hz. Matlab has the function 'resample' and I  thought, this would make comparison much easier.

My question is: Is it wiser to downsample the second curve or to upsample the first one?

Edit:
I did as I was told. In the picture on the left are the original curves. The curves on the right are resampled. Top right is upsampled, bottom right is downsampled.

I know the curves are of different length, when resampled. However, the second signal will get cropped to the first signals length.


texts:
I recently came across a technique called bit-plane slicing for image
compression in a book "Digital image processing" by gonzalez and woods . They
just presented the theory and i wanted to implement it . So ,my code just creates images out of 8th bit and 7th bit plane seperately and saves them . I
just wanted to make sure that the output is really correct . please check these code and make it more efficient or give your own version.

import numpy as np
import cv2

#create a image array
img = cv2.imread("WIN_20170511_13_06_18_Pro.jpg",cv2.IMREAD_GRAYSCALE)
row ,col = img.shape
#convert each interger pixel value of given image to a bit pixel value of 8-
 #bits
def intToBitArray(img) :
    list = []

    for i in range(row):
        for j in range(col):
             list.append (np.binary_repr( img[i][j] ,width=8  ) )

    return list #the binary_repr() fucntion returns binary values but in
                #string
                #, not integer, which has it's own perk as you will notice

 #as variable name says ,it's list of pixel values in binary , but in 1
 #dimension
imgIn1D = intToBitArray(img)
#reshaping above 1D array to a matrix aka image
imgIn2D = np.reshape(imgIn1D , (360,640) )
def bitplane(bitImgVal , img1D ):

'''
this function extracts the specific bit out of each binary pixel values of
the matrix
for example , if bitImgVal = 3 , then , third bit of each pixel is extracted

:param bitImgVal: specifies the position of bit to be extracted
:param img1D: image which is to be compressed
:return: now returns 1 dimensional list of bits
'''
    bitList = [  int(   i[bitImgVal]  )    for i in img1D]

    return bitList
#i don't know why but the multiplication factor is : 2^(n-1) where n is the
bit number
#example, if binary pixel value is 11001010 and n = 3 , factor = 2^(3-1)
#image represented by 8th bit plane
eightbitimg = np.array( bitplane(0, imgIn1D ) ) * 128

#image represented by 7th bit plane
sevenbitimg = np.array( bitplane(1,imgIn1D) ) * 64

#bitplane of 8th and 7th bit
combine = eightbitimg + sevenbitimg
comb = np.reshape(combine,(row,col))

#save combined plane image
cv2.imwrite("comb.jpeg",comb)

#save eight bit plane
eightbitimg = np.reshape(eightbitimg,(row,col))
cv2.imwrite("8bitvalue.jpg" , eightbitimg )

#save eight bit plane
sevenbitimg = np.reshape(sevenbitimg,(row,col))
cv2.imwrite("7bitvalue.jpg",sevenbitimg)

#grayscale version of original image
gray = cv2.imread("WIN_20170511_13_06_18_Pro.jpg",cv2.IMREAD_GRAYSCALE)
cv2.imwrite("gray.jpeg",gray)

the images are as :
eigth BIt image:

seventh bit image


texts: In MATLAB ,do the input signals need to be of the same sampling rate for the conv function to work correctly?

texts:
eg. z=conv(u,v) where u is the input signal encoded in 24KHz sampling rate and v ,the impulse response encoded in 44kHz .
z is played at 24KHz rate .
In the convolution function ,we basically perform a convolution of input and impulse response samples.But reading across the net, I found that for convolution the input and impulse signals must be signals encoded at the same rate.
How true is this?


texts:
I am trying to understand how exactly to implement what is known as a 'pre-whitening' filter or simply a 'whitening' filter.

I understand that the purpose is to make it have a delta as its autocorrelation function, but I am not sure how to do this exactly.

The context here is the following: A signal is received at two different receivers, and their cross-correlation is computed. The cross-correlation can look like a triangle, or some other godforsaken shape. Due to this, it becomes hard to find the peak of the cross-correlation signal. In this case I hear about having to 'whiten' the signals before a cross correlation is performed on them, such that the cross-correlation is now more delta-like.

How is this done?

Thanks!


texts: Discrete time non-linear time invariant system dynamics descriptions (state-space or input-output relationship)

texts:
For the sake of simplicity the following notation $a_k := a[k]$ is assumed for time sequences.

A completely general discrete-time (DT) non-linear(NL) time-invariant (TI) dynamical system can be described with a system of vector difference equations, where $x[k]$ is the system state, $u[k]$ is the system input and $y[k]$ is the system output:
$$\begin{cases} x[k+1] = f(x[k],u[k])\\ y[k] = g(x[k], u[k]) \end{cases} \quad\forall k \in \mathbb{Z} \ge0$$
$f(\cdot)$ and $g(\cdot)$ are general nonlinear functions.

The first equation is very close to a general autonomous non linear differential equation with $\dot x(t)=f(x(t),u(t))$ where $u(t)$ is the source term.

Now, the same dynamical DT NL TI system could be described also through an input output relationship, involving more among their "samples" (current and past):
$$y[k] = h(y[k-1],y[k-2],...,y[k-n],u[k],u[k-1],...,u[k-m]), \quad\forall k \in \mathbb{Z} \ge 0 \quad$$ where again, $h$ is a general non linear function, and $n,m$ are integer positive values.

How can one prove that this input-output relationship form is equivalent to the former state-space representation, at least when $x[0]=0$ (without any care about a possible relationship between $f,g$ and $h$)?


texts:
Currently, I'm writing a Python script, which should do the following:

read an audio file respectively a wav file via scipy.io.wavfile.read().
calculate the spectrogram of given wav file.
write the data from spectrogram back into a wav file.

Here's a bit of Code:

# Define FFT params:-------------------------------------------------------
windowSize = 512
shiftSize = 160
nFFT = 1024
window_py = signal.hamming(windowSize)
nOverlap_py = windowSize-shiftSize

# Load wav file into memory:------------------------------------------------
fs_rate,s_orig = wav.read('demo.wav')

# Type Casting:-------------------------------------------------------------
s_orig_py = np.asarray(s_orig,dtype=np.float64)

# Spectrogram:--------------------------------------------------------------
Fpy,Tpy,Spy=signal.spectrogram(s_orig_py,fs=fs_rate,window=window_py,
noverlap=nOverlap_py,nfft=nFFT,detrend='constant',return_onesided=True,
scaling='spectrum',mode='complex')

#---------------------------------------------------------------------------
P_py = np.angle(Spy)                    # Phase extraction:
X = np.absolute(Spy)                    # Needed for neural network!
X1 = X*np.cos(P_py)+1j*X*np.sin(P_py)   # "orig." spectrum. Needed for resyn

# Resynthesize to wav:------------------------------------------------------
X1 = np.append(X1,np.conjugate(X1[-1:1:-1,:]),axis=0)
x_opt_py = synthSpectrogram(X1,shiftSize,nFFT,window_py,nOverlap_py)
wav.write('demo.wav',fs_rate,x_opt_py)

But there's is a huge problem: The data in "Spy" is not useable. When I try to write the data back in a wav file, the result is noisy respectively there's nothing at all. Furthermore, I have a Matlab file, which does the same as the code above and it works just fine and in both cases the parameters are the same.

The values in of S in Python and Matlab are not even close and I don't understand why. I get that they can't be identical due the fact that both functions use a different algorithm to compute the FFT but as I mentioned before they are not even close.

Matlab-Values

Python-Values