texts: Problem understanding the Expectation Operator

texts:
I know that the Expectation Operator $E\{x\}$ four discrete values is
$$ \sum_k \alpha Pr(x = \alpha_k)$$

and its very intuitive when speaking out a formula which contains the Expectation Operator. But I often have some troubles when trying to apply it on real examples with numbers.

E.g. the autocorrelation is completely obvious when given as sum like:
$$ r_x(\tau)=\sum_n x_n x_{n-\tau}.$$ However, often principles like autocorrelation, correlation, cross-correlation etc. are formulated with the $E$ Operator. For the autocorrelation:
$$ r_x(k,l) = E\{x(k)x^*(l)\}.$$
I assume this can be written as:
$$ r_x(\tau) = E\{x(k)x^*(k-\tau)\}.$$

The product is the same as in the sum above. However, the $E$ Operator implies that I need to know some probabilities. How can one quickly see that this is the same as above with $\alpha$ is somehow $x_n x_{n-\tau}$ and $Pr=1$? This can't always be the case. Otherwise one could always write the sum instead of the E Operator, couldn't he?

I think about the E Operator as if it is needed for different random processes. This would imply that I can't formulate e.g. a cross-correlation as a sum over all products between two signals, as I used to do. A formula like $r_{xy}(k,l)=E\{x(k)y^*(l)\}$ would then be a more general case and could not be applied on a simple numerical example, without making assumptions about the processes statistical properties.


texts:
Are there any statistical concerns with using a running-window maximum to capture peak values?

Background: We are measuring acceleration during random impacts on a structure. The impacts need ~500Hz sampling to resolve, but due to data volume I can only permanently save a 10Hz data vector. One workaround is to record a running window maximum since I am most interested in peak accelerations during impacts, and how often impacts occur. Are there any statistical concerns (bias, accuracy) about using a running-window maximum?


texts: Generating digitized white noise: uniform vs normal sampling

texts:
Consider the following two ways of generating noise in the time domain for audio applications:

Generate samples from a uniform distribution [-amplitude, +amplitude], where amplitude is in the clipping range.
Generate samples from a Gaussian/normal distribution with μ = 0 and some σ > 0, followed by clipping the samples to the clipping range.

I always thought that the important property of white noise is that it is an uncorrelated process, and expected (1) to produce white noise in the sense of having a flat frequency spectrum. I was never sure why some implementations prefer to use a Gaussian distribution and just came across this comment:

White noise is a continuous process from any uncorrelated random process, like uniform or normal. However, if you digitize it, you must apply a bandpass filter at the Nyquist frequency, otherwise your approximation of the continuous process contains aliasing. It turns out that bandpassing white noise results in a discrete random process where each sample is picked from a Gaussian/normal distribution.

I do not fully understand that comment, and it triggers a bunch of questions:

Does it mean that generating noise via (1) suffers from aliasing, and thus, its frequency spectrum isn't flat, i.e., it should not be considered white noise?
If so, what is the frequency spectrum of (1), i.e., how does aliasing manifests itself here?
If proper white noise generation requires (2), what about the clipping issue of sampling from a Gaussian? Isn't it an issue that for large σ the tail of the distribution gets chopped off?

I'd appreciate any hint that clarifies above It turns out that... statement.


texts: How do I convert a sampled complex signal to a real signal?

texts:
I’m writing a Soapy SDR plugin for the FL2K-SDR.  Soapy SDR expects plugins to produce and consume IQ samples. However, the FL2K-SDR driver consumes only real samples. I know you can convert a real signal to a complex signal using a Hilbert transform. How do I convert IQ samples to real samples?  Do I use an inverse Hilbert transform? Do I just drop every other sample to get only the I samples? One of my goals is to minimize the processing latency of this plugin (I.e. use lookup tables if possible).

Part of my quandary is that I don't know how the user is going to configure their flow-graph. They may:

Simply feed me a complex cosine and expect some sort of real cosine output.
Sample the PC microphone, convert that to a complex signal, and send that to me (no modulation involved).
Attach an analog low-pass filter (~ 70 MHz), do their modulation in their flow-graph, and use the FL2K USB VGA dongle for an HF Ham radio transmitter
Generate an IF in their flow graph, and then attach an analog band-pass filter to transmit an image frequency higher than 70 MHz.

Unfortunately, I don't know which of these they might do.


texts: Why are recursives methods useful for FIR filter design?

texts:
As I understand it, FIR filtering is a linear process. That mean for me that the whole filtering process will have a fully predictable behavior.
So, could someone explain why a universal deterministic and optimal filter design method  to obtain the desired response doesn't exist and why recursive approach seems to be of great interest in practice ?

EDIT: just to clarify, my question is about an "optimal" method, that is one which compute the shortest filter response while staying the closest to the design criteria.


texts: How can I track detected objects from frame to frame

texts:
I want to track people's faces in a video stream (like a security camera), but I am running into a problem. I was using a Haar classifier to find the faces and sending the detected faces to a system to identify the person that was detected (so I can display their name under there face). The problem is that identifying a person takes more than a second, too slow and unnecessary to do every frame as the same people tend to stick around.

What is a good way to track people frame to frame?
I was thinking of something like storing every person, and in the next frame trying to find faces detected very close to where they were, but this does not work very well as faces can skip frames, move more than I expect, or "jump" faces swapping who is who.
Is there an accepted way to solve this problem?
What are some ways to overcome this?


texts: mathematical transfer for different camera attributes

texts:
Suppose I have two camera shoots(Image1,Image2) for the exactly same scene (each pixel is alignment correctly) but from different cameras and different light conditions. I want to remove this light difference. I tried two way till now:

S,V component adjustment

Gamma correction
I am getting result around 7/255 difference after adjustment.

I am looking for a mathematical transform "F", something like Adjusted_Image=F(Image1)  which leads to |Image1-Image2| ~ 0
The "F" function will contains must-tuned parameters (a,b,c,....).
Any ideas of the formula of "F"?
many thanks,


texts: Computing the Power Spectrum Density (PSD) on a CSV File in Python

texts:
im quit new with signal processing and im trying to calculate the PSD of a signal im sampling. the signal is an output of a DC buck converter

this is the code im using and this is the plot im getting

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab

filename = 'scope_yos2.csv'
data = pd.read_csv(filename)
ConvertToMatrix = data.values
time = np.delete(ConvertToMatrix,[1,2],axis=1)
voltage = np.delete(ConvertToMatrix,[0,2],axis=1)
NumOfSampels= len(voltage)
plt.plot(voltage)
voltage1 = voltage.transpose()
samplFreq = 1.25e9
Pxx, freqs = plt.psd(voltage1,
NFFT=256,Fs=samplFreq,
detrend=mlab.detrend_mean,
window=mlab.window_hanning,noverlap=0,sides='onesided',scale_by_freq=True,
return_line=None)
plt.show()

first image is the DCDC ouput
second one is the PSD plot

the csv file contains two columns first is the time ax and the second one is the amplitude

how come the plot is so smooth. this is the plot im getting using the welch algoenter image description here

also theres a argument called **kwargs , what is used for ? , as you can see im not using it

thanks


texts: Confusion in initial condition of differential equation using Laplace transform transform

texts:
I'm confused in solving linear constant coefficients differential equations (LCCDEs) by Laplace transform if initial conditions are given at time

just before $t=0$
just after $t=0$
exactly at $t=0$

Is method of solving LCCDE by Laplace transform is same in all three cases or it's different?
I know it's more of mathematical question and I asked this question in mathematics stack exchange but I didn't get answers, so I ask it here as it is equally a problem of systems differential equation.!


texts: what is magnitude responce at ω = π/2M for freqz function

texts:
what is magnitude responce at ω = π/2M.Code Given is

M=8 % Channel
x=512*8
d1=kaiser(N,B)
d1=fir1(N-1,wc/pi,w);
[h1,fre1]=freqz(d1,1,x)
a1=max(abs(h1));
plot(fre1/pi,a1)

find magnitude at w=π/2M.


texts: Fourier Transform Form: two sin components & a phase shift & a magnitude for only one term

texts:
This is an example from my text book of a continuous signal:
$$x_{in}(t)=\sin \left( 2\pi \cdot 1000 \cdot t\right) + 0.5\sin \left( 2\pi \cdot 2000 \cdot t + \dfrac{3\pi}{4} \right) $$
So to perform a fourier transform on this signal, how to do that, isn't it a bit funny, since it has two sine components. Shouldn't complex numbers have a sine term and a cosine term? And it's got a scalar term applied to only one component, don't those usually apply across both terms of a complex component? And it's phase shifted, what to do about that?


texts: Homography for (small baseline) Stereo Image Registration

texts: If the distance between two stereo cameras (baseline) is much smaller than the distance to the geometry, is it possible to align the resulting two stereo images using a homography?


texts: I have separately computed the cepstrum and the energy of a finite discrete-time signal. If the energy of the signal is high, we would expect (on average) larger cepstral values than if the energy of the signal is low. I am therefore interested in normalizing the cepstral values by the energy in some fashion to adjust for this, because I want to be able to compare the cepstral values from different signals in an energy-invariant manner. However while I know the units of the signal's energy $(\text{volts}^2\cdot\text{seconds})$ I have no idea what the units of the cepstral values are, and therefore do not know how to transform them in order to ensure that the normalization is performed appropriately. What would be the most unit-consistent way to perform this normalization?


texts:
For the following code,

X=[2 2 3 100 4 0 98 100 90 2 3 67 98 0 6 6 89 9 21 78]
[C,L]=wavedec(X,N,'db1');

where N is the level , I get n(approximation and detail coefficients)>n(X)

What does this signify?
Why does this increase happen?


texts: replace input signal with δ will have the impulse response of the function?

texts:
Is my impulse response right?
By definition,the impulse response is the output when the input is a impulse signal,so

$y[n]=\sum\limits ^{n}_{k=-\infty}\frac{1}{2^{n-k}}\ x[k]$,the impulse response of $y[n]=\sum\limits ^{n}_{k=-\infty}\frac{1}{2^{n-k}}\ \delta[k]$ ,Is my thinking right?


texts: Defending Continuous values using Error Correction Codes

texts:
Say I'd like to transmit, using FSK modulation, a 100-bit packet which has a continuous field. I'd like to protect this value with an error correction code but an error in the MSB of this value is much more catastrophic than an error in the LSB, so how do I have to design the code so that it will be optimal by means of protection (more redundant bits for the important parts)?

For example, let's assume my continuous field is Temperature. My problem is that the temperature is represented by X bits but they are not equally important. If the temperature is 23.452298 degrees than I can't risk an error in the integer part (23) but if I'll get an error in the fractional part I'll be able to live with it (though I prefer protecting it too, with less "protection" bits).


texts:
I work on images that contain shot noise (Poisson) acquired from a microscop. On few images, I have a "flat" zone that is supposed to have the exact same intensity, but it's not because of the noise. I was thinking that I could use this zone to estimate the quantity of noise, and then estimate the parameters K and Lambda of the Poisson equation.

Is there a method to do it?


texts: How to Match 2 Signals which Are a Shifted and Scaled Version of Each Other

texts:
I have 2 signals S1 and S2 that contain the same information, but S2 is shifted and scaled compared to S1 by an unknown amount (but small; eg shift would be of the order of 1-10 samples).

What is the best (=most effective yet simple) way to calculate (or estimate) the shift and scaling factor to apply to S2 in order to 'match' with S1.

I have read a few papers referring to using the phase information in FFT, but those were working on signals where scaling was not really an issue (and i must admit not to have understood them completely anyway). I am a bit lost on how to put this in practice when developing that in Matlab (actually I use Octave).

I would love to have an explanation using Matlab/Octave code if possible.

Thanks for any help.

Steve

PS: I add the tag 'image processing' because I suspect that such techniques would be used in automatic stitching of images (in panoramas for example)


texts:
I want play and record a sine sweep.
When i have both signals the recorded one and the send one i can create a Transferfunction.
That is what i know so far.

$$
H_0 = \frac{OUT}{IN} = \frac{Y}{X}
$$

Where i'm stuck is that when i read about the Transfer function it is all about the $Laplace \, transform$ (and sometimes the $Z-Transform$)
While i use the $FFT/DFT$. I tried some GNU Octave code to tried an Transfer function and i think that looks what i suspected.
But now i curious

if the $FFT/DFT$ can be used for/ as a transferfunction and
what is the relation between an $FFT/DFT$, $Laplace \, Transform$ and the $Z-Transform$


texts: ZP-OFDM vs. CP-OFDM channel equalization

texts:
Now, I am working on OFDM equalization, according to what I understood, Adding CP into the OFDM block change the convolution from linear to circular. That circular convolution enables using point-wise equalizer or one tap equalizer such that ZF or MMSE equalizer.
ZP-OFDM is a different scheme, where the CP is replaced by zeros. As I understood, ZP-OFDM should achieve the same performance of CP but under more complex equalization.
So, What means by complex equalization?? Is it time-domain equalization ? Could someone explain for me which equalizer we can adopt with ZP-OFDM in order to achieve similar/near performance of CP-OFDM ?


texts: How to get a Rician fading channel matrix from a Rayleigh fading channel matrix?

texts: I have a Rayleigh fading channel matrix H. Let's say the dimension is 2000*128. Is there any way to convert this matrix into a Rician fading channel matrix for example κ = 5, 10, 15, etc.? Is there a formula for that?


texts: Removing noise from Signal captured by Laptop Sound Card using Mic In (4-pole Audio Jack)

texts:
I am new to Signal Processing and I need a bit of help. I need to capture an Audio signal using the laptop Sound card. But before I captured the actual signal, I tested for the noise levels.

Generated a 1000Hz sine wave from a Mobile App and recorded the Signal using the laptop Sound card using a 4-pole audio cable on both sides (Mobile & Laptop).

After the Recording Audacity's spectrum analysis shows a lot of noise at all other frequencies.

A few questions:

Is there a way I can remove the noise levels from this captured signal since I know that this is a 1000Hz Sine wave?

My ultimate goal is to use the laptop Audio Card to capture the Signal and remove most of the noise.

Since I know the noise levels being introduced by the Sound Card, Can I Subtract a base line noise level from sound Card from the Signal to generate a "Clean" final signal?
Am I thinking about this in a wrong way being a newbee?

Thanks for your help.


texts: From MFCC to Machine learning. What are the steps?

texts:
I was able to get a dataset with MFCC coefficients. However, depending on the length of my sound file I get a different sized matrix. As in, 13 (13 MFCC coefficients) by XXX, where XXX will vary depending on the length of the sound file.
Does it make sense to 'normalize it' to keep XXX consistent? If so, how?
Like in this example, the size of the matrix always varies: https://archive.ics.uci.edu/ml/machine-learning-databases/00195/Test_Arabic_Digit.txt

Also, how will I feed this into a Machine Learning algorithm? (i.e. k-NN, HMM, etc.) I somewhat figured how to do it if it's just one line for each sound file (e.g. 1 by 13 for each sound). What are the steps if it's MFCC? I am a little lost here.

Thank you for your help.


texts:
Hi I would like to find a line in a noisy image as showed bellow. I tried gabor filter and cany edge detection, but it didn't produce anything usefull. I am looking for lines of specific orientation and I don't want to segment them, just to find if the line exist in the picture.

Example pictures with lines

Example pictures without lines


texts: Butterworth filter for signal processing

texts:
I have a school project to be able to move a wheelchair according to user instruction. I am currently starting my project by using MATLAB and I have acquire several data for the training purpose. I am stuck at applying the butterworth filter to the signal, here is a sample of my training data $\tt go10.wav$. And here is my code:

[x,Fs] = audioread('go10.wav'); % to read the data
plot(x) ; % plot the data before aprplying the filter
n = 3; % the number of order
beginFreq = 800 / (Fs/2);
endFreq = 2000 / (Fs/2);
[b,a] = butter(n, [beginFreq, endFreq], 'bandpass');
y = filter(b, a, x);
figure;
plot(y) ; % plot the data after applying the filter
p = audioplayer(y,Fs);
play(p) ; % play the record after applying the filter

Here the plotting result,

So my question is,

Did I do it right? about the begin and end frequency? and is my n correct?
And what can you tell me about this butterworth filter? I know that it's trying to focus on the human voice, but what exactly it does?


texts: Randomly Generate Synthetic Noise in an Image Text Document

texts:
I'm working on denoising dirty image document. I want to create a dataset wherein synthetic noise will be added to simulate real-world, messy artifacts. Simulated dirt may include coffee stains, faded sun spots, dog-eared pages, lot of wrinkles and many more. How shall I do that?

Sample Clean Image:

After adding Random Noise :

How can I randomly achieve images shown above?


texts: Compressing sparse vectors based on compressive sensing

texts:
I have a sparse vector $x$ of size $N$x$1$ which is sparse with number of non-zeros values are $m$, it means $m$ out of $N$ values are non-zeros,  the non-zeros locations are distributed randomly.

Are we able to compress the vector $x$ to be of length $m$x$1$ using a matrix $A$ of size $N$x$m$ ? Generally, I think it's possible since we have the dictionary matrix $A$, But what should be $A$ ? I mean, how can we generate it? Assuming we have the vectors $x$ is of length $8$x$1$ with only two non-zeros values.


texts: How does it go about implementing pitch shifting without affecting the duration or speed on matlab?

texts:
I am creating a project that will record a sound sample from the world, for example, a bird's chirping. And then through pitch scaling, I could create different notes.

I first tried to change the sampling rate fs below in the Matlab code, and I noticed that it will change both the duration and the pitch. After some research, i found out this method is called sample rate conversion. but I still do not quite understand why with a higher sampling rate, the octave created will sound slower and lower, and vice versa.

It would be really helpful if someone could provide some insight into this. Thank you in advance!

function [x1, x2, x3, x4, x5, x6, x7] = signal_generator(n1,n2,n3,n4,n5,n6,n7,fs)
% n is the signal frequency, fs is the sampling frequency

m = fs; % how many samples per second
t = 0:(m-1);
x1 = sin(2*pi*n1/fs*t);
x2 = sin(2*pi*n2/fs*t);
x3 = sin(2*pi*n3/fs*t);
x4 = sin(2*pi*n4/fs*t);
x5 = sin(2*pi*n5/fs*t);
x6 = sin(2*pi*n6/fs*t);
x7 = sin(2*pi*n7/fs*t);

end


texts: How to perform zero-padding to 3 dimensional array

texts:
Consider an array with $t=10000$ rows, $i=2$ columns and $n=41$ as a 3rd dimension. Now I add the columns of this array to yield a matrix with $t$ rows and $n$ columns. However in MATLAB the size of my new matrix X is:

size(X) = 10000   1   41

I want to add $10000$ zeros to each of the columns of this matrix. This should give a matrix with:

size(X) = 20000   1   41

I would try this code:

X_zeros = [X;zeros(10000,41)];

However, apparently the dimensions of X and zeros(10000,41) are not matching. I assume it is because of my 3rd dimension, although this 3rd dimension is empty. I want to delete this 3rd dimension s.t. :

size(X_zeros) = 20000   41

This is not an option:

X_zeros = [X,zeros(10000,1,41)]

because I assign X_zeros to other matrices with only $2$ dimensions. Is there a way?


texts: Difference Between monocular video and stereo video?

texts: What is the difference between monocular video and stereo video ,as i am studying about motion tracking i need to know the meaning of these two things.


texts: Image Processing/ Computer Vision: How is separability of filters implemented?

texts:
I am trying to convince myself that a separable 2D filter can be implemented via two 1D filters. So, I took the example of following Sobel filter:

$1/8\begin{bmatrix}-1&0&1\\-2&0&2\\-1&0&1\end{bmatrix}$

Based on Szeliski

This can be separated as :

$1/2\begin{bmatrix}-1&0&1\end{bmatrix}$ and $1/2\begin{bmatrix}-1\\0\\1\end{bmatrix}$

Consider an image as shown below:

$\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}$

Let us first perform a normal 2D convolution which involves:

1) flipping the kernel horizontally and vertically (i.e first interchange first and last rows, then interchange first and last columns).

2) applying the flipped kernel on the image (the border is assumed to be zero padded).

3) Normalizing values by dividing them by 8.

This yields the output:

$\begin{bmatrix}-1.125&-0.75&1.125\\-2.5&-1&2.5\\-2.625&-0.75&2.625\end{bmatrix}$

Now we can try applying 1D filters:

1) The 1D filter represented by the row vector is flipped (columns are interchanged).

2) The flipped filter is applied to the entire image.

3) The 1D filter represented by the column vector is flipped (rows are interchanged).

4) The flipped filter is applied to the result from first 1D convolution.

5) The values are normalized by dividing them by 4.

This yields the output:

$\begin{bmatrix}1.25&0.5&-1.25\\1.5&0&-1.5\\-1.25&-0.5&1.25\end{bmatrix}$

The two results are different. What's the mistake and how to perform these operations properly?


texts: How can I design a beam former (with weigth vector $w$) that protects a signal coming from an angle of arrival $\theta_0$ and completely suppresses signals coming from $\theta_1,\theta_2,...,\theta_k$? How should I choose the number of elements $M$?


texts: Mathematics / Signal theory behind billiard ball 'wave pendulum' effect

texts:
This YouTube video shows a very interesting effect.

What is the underlying science?

I have recently started studying Fourier theory and DSP, and and trying to understand what is going on in terms of the material I've been learning.  I would like to understand this from as many angles as possible.

For example, at 0:39 the signal forms two lines moving against one another,  and shortly before that I can clearly see two sine waves in the signal.

This reminds me of the illustrations at http://www.dspguide.com/ch3/2.htm

PS  not quite sure how to tag this


texts: Derivation of Transfer Functions for Kalman Filter

texts:
Hi All: I'm  somewhat familiar with the kalman filter from a statistical point of view. But lately I've been trying to familarize myself with the linear systems-EE way of looking at it. So, I've been trying to read the Hannan and Deistler 1988 text slowly. I find it difficult and there is
material in there that I don't follow so this  is what my question is about.

I will write down verbatim what the book has and then explain the parts of it that I don't understand. I don't expect the actual detailed answer but rather a book or notes that explain the derivation. I'm totally new to this notation and terminology so maybe my questions can be easily answered but I don't expect it ? In fact, notes or a reference would still be appreciated even if the answers are straightforward.

Quote from Hannan and Deistler: Page 8

  As will be shown, equations ... can be transformed into a state space system

  1.1.22)$ ~~  x(t+1) = Fx(t) + Lz(t) + K \epsilon(t) $

  1.1.23)  $ ~~ y(t) = H x(t) + \epsilon(t) $

  where $F \in R^{n \times n}$,  $L \in R^{n \times m}$,
  $K \in R^{n \times s}$ and $H \in R^{s \times n}$.

Then there about five pages before the authors comes back to these equations above. I won't quote these five pages but they are mostly about how to use the lag operator to and the z-generating function. Although I find these pages confusing, I do understand the concept of a lag operator. I have a feeling that, if someone can answer my question or point to a useful reference or notes, then they won't need these pages. If someone does need them, I can copy them and send them in a pdf.

So, now I continue to where the authors comes back to above and I quote:

Hannan and Deistler, page 14

  For a state space system (1.1.22), (1.1.23) we have det$(I - Fz) = 1$ for
  $z = 0$ and thus there always exists a causal solution

  1.2.21)$ ~~~  x(t) = (I - Fz)^{-1}z[Lz(t) + K e(t)]$

  where  $(I - Fz)^{-1} = \sum_{j = 0}^\infty F^{j}z^{j}$, provided that the sum in 1.2.21) exists. In this sense, causality is built into the definition of state-space systems.

  The transfer functions corresponding to (1.1.22), (1.1.23) are

  $k(z) = H(I_{n} - Fz)^{-1}zK + I_{s} = I_{s} + \sum_{j=1}^{\infty} HF^{j-1}Kz^{j}$

  $l(z) = H(I_{n} - Fz)^{-1} zL = \sum_{j=1}^{\infty} HF^{j-1}Lz^{j}$

  Starting the system with given initial values $x(0)$, $z(0)$, $\epsilon(0)$ at t = 1, we have

  $ x(t) = \sum_{j=1}^{t} F^{j-1}Lz(t-j) + \sum_{j=1}^{t} F^{j-1}K\epsilon(t-1) + F^{t}x(0)$

  $y(t) = \sum_{j=1}^{t} HF^{j-1}Lz(t-j) + \sum_{j=1}^{t} HF^{j-1}K\epsilon(t-1) + HF^{t}x(0) + \epsilon_{t}$

The three parts that I don't understand regarding above are

1) the statement about the determinant of $(I-Fz)$ being 1 when $z$ = zero.
I mean I understand why that's true but what does it have to do with the price of tea in china ? or causality ?

2) the derivation of the transfer functions, $k(z)$ and $l(z)$. I do understand 1.2.21) so I imagine that 1.2.21) is used to derive them ????? I also understand the second equalities in $k(z)$ and $l(z)$. But not the first equality signs.

3) the equation for $x(t)$ at the very end. I do see how $y(t)$ is obtained once one has $x(t)$.

I imagine that the material that I'm confused about above ( which is most of it )  is hidden deeply in the 5 pages that I didn't quote but, like I said, I found those pages to be quite "opaque", to say the least.

My guess is that I need is nice reference or lectures notes that explain why, when it comes to the KF,

A) the determinant of $(I-Fz)$  is important and

B) how the associated transfer response functions are obtained  from a state space representation?

C) How the $x(t)$ equation is obtained given the transfer function ?

Note that I'm definitely opened to fighting with this material on my own so even just a good link is fine.

Finally,  if anyone knows of a book that has similar objectives to Hannan
and Deistler but is less concise and shows more steps to things (i.e. doesn't assume as much mathematical maturity ), it's appreciated.


texts: How does spectral density of a power signal change when it is multiplied by $\cos(2\pi f_ct)$?

texts:
Suppose we have a power signal $n(t)$ whose power- auto-correlation function is: $R_{n}(\tau)$.

Now we multiply the signal by a cosine as
$$\cos(2\pi f_ct) \cdot n(t)$$
whose auto-correlation is $R_{n_i}(\tau)$.

How is $R_{n}(\tau)$ mathematically related to $R_{n_i}(\tau)$ ?


texts: Frame acquisition vs symbol timing synchronization

texts: For a known length of frames  and using a known sequence in a preamble that is also  of known length can auto correlation at the receiver  be enough to acquire timing or is timing synchronization at the symbol level still needed?


texts: Will LoRa work from Earth to the Stratosphere

texts:
I'm unsure if this is the most suitable exchange however I thought it seemed most fitting personally, please correct me if I'm wrong. (I got redirected to here from the Network Engineering Exchange).

I was wondering if LoRa would work to transmit GPS data from my High Altitude Balloon back to my gateway.

From what I understand it's perfect for line of sight, which means in the sky there is nothing blocking the RF signal, however I'm not sure if there is anything else that'd cause it not to work.

Can anyone confirm if LoRa would be fine to transmit GPS position so I can locate my payload as it rises and falls?


texts: Synchronization with a specified sequence

texts:
I'm currently creating a project in Matlab where I'm simulating a communication, based on the SSB modulation, between a transmitter and a receiver.

I've added a Barker sequence in the trasmitted message in order to Synchronize the receiver. The receiver starts to demodulate the message from the istant when the cross-correlation beetween the Barker sequence and the received message is maximum.

The project works with no problems, but I have a question...which kind of autocorrelation function should have a sequence used for this scope? I've found that a good sequence should have an autocorrelation function similar to a pulse...is it correct? If it is...why?

Thanks for the attention!


texts:
I have to implement an eigenfilter for an arbitrary frequency response in MATLAB. I have this algorithm:

  $N$ - order of the filter

  $M = N/2$

  $c(\omega) = [1,\; \cos(\omega),\; \cos(2\omega), \ldots \cos(M\omega)]'$

  $d = \int D^2(\omega)$ over the desired frequency bands (Should be a scalar)

  $p' = \int D(\omega)c(\omega)$ over the desired frequency bands (Should
  be a  vector)

  $Q = \int c(\omega)c(\omega)'$ over the desired frequency bands (Should
  be a matrix)

My objective for the process goes beyond but my concerns are limited to this part.

My first question is regarding $Q$ matrix, here I am using trapz in MATLAB but it gives me a vector instead of a matrix. I tried using loops so as to integrated is element by element (e.g. C(i*w)*c(j*w)') but then it gives me matrix of all zeros.

My second question is how to get this desired plot into a form over which I can operate in MATLAB. I can plot this using line command but I am not sure if I will be able to work on it (as I have to find $p$ vector and $d$ scalar).

I am attaching a picture for the desired frequency response. I would be really glad if anyone could help me out here. I have been banging my head with this problem for a while now.


texts:
I have an FIR filter on an ADC that samples at 120Hz that I feed into a control loop that runs at 10Hz. What would be better from a noise perspecitve:

Option 1: Just run the FIR and downsample ever 12th point to get 10Hz

Option 2: Run the FIR and average the last 12 points to get 10Hz

This is assuming gaussian noise for the input


texts: what are the applications of fourier transform in modulation

texts: what are the applications of Fourier transform in modulation ? What are modulation schemes that use Fourier transform? I guess, FSK & PSK are related to Fourier transform since it both have frequency and phase in their names respectively.


texts: How to filter a signal knowing the frequency response of a system in MATLAB?

texts:
I have a signal of period $T_0=8$, let's say $x(t)$, and it has the following Fourier coefficients:

$$ a_k=\frac{1}{4} \mathrm{sinc}^2\left(\frac{3k}{8}\right) e^{ik\frac{\pi}{2}} $$ for $1\le|k|\le6 $ and $a_k=0$ for the rest.

I also have a system which has a frequency response :
$$H(j\omega)=\frac{j\omega}{j\omega+\frac{3\pi}{2}}$$

Using MATLAB, what's the best way apply this filter to this signal?
I got the signal $x(t)$ from the coefficients and now I don't know how to proceed from here. I'll leave my code here:

T=8;
w0=2*pi/T;

t=0:0.001:2*T;
exp_jwt=exp(1j*w0*t);

k=-6:6;
ak=0.25*(sinc(3*k/8)).^2.*exp(1j*k*pi/2);
ak(k==0)=0;

x=zeros(size(t));
for (i=1:length(k))
    x=x+ak(i).*(exp_jwt).^(k(i));
end


texts: Finding the Transfer Function of a Multiplicative Distortion in MATLAB

texts: I have the frequency response of two signals shown above. One is uncontaminated, and the other is the same signal contaminated by a multiplicative distortion with two poles and two zeros. I need to find/estimate the transfer function values of the contaminating filter in order to equalize the contamination. How do I accomplish this in MATLAB? Thanks.


texts: Functioning of a continuous data stream processing neural network?

texts:
I've been searching with unfortunately no relevant results about something I have trouble to figure out: neural networks which process continuous data stream (audio, video, anything with a state depending of a period of time)

I'd like a simple explanation on how this kind of NN (which I couldn't find the name, perhaps it's CNN but I am not sure) works.

Currently I only know "basical" NN you're introduced to when you're starting with machine learning — those taking many inputs from an image for example (so these inputs are pixels here), getting fed with a lot of relevant images of different categories and telling you which category the image you provide it belongs to.

These basical NN relies on steady information, they don't change over time, so I can figure out how they can be processed.
But it's harder for me to understand how continuous data can be processed; in a vocal removing sound processer for instance, how does it "know" what data to put next ? How is it even trained as the inputs are not general but relying on time ?


texts: Digital Image Processing Textbook with Specific Topics

texts:
I am looking for a Digital Image Processing and analysis textbook, but there are specific topics that I would like the book to cover. Among other topics, I would like it to include a discussion of:

(Orthonormal) basic functions
Mahalanobis distance
Subspaces
Image registration
Error accumulation
Background estimation

What textbook(s) would you recommend?  I imagine this lack of a direct question is the reason for the two unhelpful downvotes.


texts: time downsampling vs. frequency downsampling

texts:
$x[n]_M$ is a finite length sequence of length M.

if:

$$
y = x[nN]_M    \tag{1}
$$

is called downsampling in the time-domain.

then what do you call the process of converting going from a M-point to an N-point DFT?

$$
y[n] = \Bigg[ \sum_{k=-\infty}^{\infty} x[n-Nk]_M \Bigg] R_N[n] \tag{2}
$$

does that have a name?  like frequency downsampling? frequency rebinning...frequency re-pie cutting or something like that?
just guessing...

($R_N[n]$ = window function, which is 1 between 0 and N-1 and 0 otherwise.)

$$
Y[k]_N = X(e^{j\omega})\bigg|_{\omega=2\pi k/N} \tag{3}
$$

rebinning $Y[k]_N$ to $Y[k]_M$ for example.

>


texts:
I'm reading through a couple of academic papers, and this terms often comes up "local weighted histogram". An example of quote is the following:

  First, cumulative histograms are built for every pixel from its neighborhood, using Gaussian-neighborhood weighting

I would be able to construct a local histogram, I'm not sure what this weighting is about.

Say the central pixel is at $p_0 = (y_0,x_0)$, and we have two pixels of same gray scale value $r$ at coordinates $p_1 = (y_1,x_1)$ and $p_2 = (y_1,x_1)$, but such that $d(p_0,p_1) < d(p_0,p_2)$. A normal histogram would count that value $r$ twice. With a Gaussian weighting for example how would we count such pixel value in the histogram construction?


texts:
Now I receive $y=s+n$, $s$ is the signal and $n$ is the white guassion noise. Everytime $s$ will be change irregularly, have some methods to get a estimation of $s$ namely $\hat s$?

Namely $s$ is random.
And I don't know $s$ how to change everytime,so the traditional kalman filter algorithm may can't be used in this circumstance.


texts:
I was wondering if any of you guys could help me with the next 3 problems.

They're about estimating the lamda on the Optical Flow equation $E =
E_s + λE_c$, for different situations that try to estimate pixel motion in videos.

1) Suppose we're trying to estimate motions in a video gotten from a drone.
Do we have to use
a small, medium, or large value for $λ$? You need to
justify what you answer by using the integral for $E$, $E_s$, and $E_c$.

2) Now we try to estimate some smooth motions. Do we have to use
a small, medium, or large value for $λ$? You need to
justify what you answer by using the integral for $E$, $E_s$, and $E_c$.

3) After applying the optical-flow method, we see that estimated motions
are parallel to the (local) image gradient. To fix this, do we have to use
a small, medium, or large value for $λ$? You need to
justify what you answer by using the integral for $E$, $E_s$, and $E_c$.

Thanks!


texts: Gaussian weighted distance between pixel amplitudes: motivations and sources?

texts:
In several image processing papers, and for instance in Random Walks for Image Segmentation (2006) by Leo Grady, changes in image intensities are turned into edge weights. In some fields, it is called Geographically Weighted Regression. This applies to graphs too, and has become popular for instance in non-local means denoising algorithms. A popular weighting is Gaussian. Quoting Grady (Equation 1, page 1772):

  In this work, we have preferred (for empirical reasons) the typical
  Gaussian weighting function given by:
  $$ w_{ij} =  \exp{\left(-\beta(g_i-g_j)^2\right)} $$
  where $g_i$ indicates the
  image intensity at pixel $i$

My questions are:

what are the earliest/most authoritative references for such a typical Gaussian weighting?
since Gaussian models are not considered the most appropriate for structured image modelling, what are the non-trivial "empirical" benefits of such a weighting, with respect to, eg, a near-Gaussian bisquare function?
$$w_{ij} = (1-\beta(g_i-g_j)^2)^2$$


texts: Should we upsample the channel when upsample the signal

texts:
I have an OFDM system with  Number of sub-carriers $N= 1024$, modulated data using $QAM$ modulation is transmitted via those subcarriers as follows:

modulation --> ifft --> adding CP --> upsampling --> conv channel --> adding noise

Then at the receiving side, the received signal is processed as follows, discarding the channel

delay --> downsampling --> CP removal --> fft --> MMSE equalizer --> demodulation

The issue which I am facing in that system is in the equzlizer step,  When using the original channel, I can not get the performance back. Howenver, when I estimate that channel after the step of fft and then use the estimated channel, The performance is OK !!

Why does that issue happens? I think because of the upsampling step, because when I don't upsample the signal, that becomes fine but when I use the upsampline and use then equalize using the original channel, I can't get the performance back.


texts: Question About Kailath's Paper - An Innovations Approach to Least Squares Estimation Part I: Linear Filtering in Additive White Noise

texts:
I'm reading the paper at the link below and I was following it for about 2 pages until I hit a road block on the bottom of page 648 where the author says:

  putting together 9-11, we obtain

and  gives  equation 12. I understand equations 9, 10 and 11  but don't see how 12 comes about from them.

Also, if anyone knows a book or a paper that provides an exact mathematical definition of white noise, it's appreciated. Definitely, I'm seeing how important it is to understand white noise, particularly in the context of this paper. Gaussanity ( which is what I'm used to seeing  in the many derivations of the Kalman filter ) is clearly quite different ( Dilip, I always believed you but now I'm seeing the importance )  and doesn't cut it here. This paper is actually the first one of a four part-er but, if I can follow this one by the end of 2018, I'd be quite satisfied.

An Innovations Approach to Least Squares Estimation Part I: Linear Filtering in Additive White Noise.


texts: parseval for a continuos but limited signal

texts:
I have a question about the parseval relation written here
https://en.wikipedia.org/wiki/Parseval%27s_theorem (In the chapter Notation used in physics).

If I have a signal continuous but limited (so it does not go from $\infty$ to $\infty$ but from 0 to T, can The Parseval theorem be applied?


texts: Exploiting coefficients symmetry of a FIR interpolation filter in a polyphase implementation

texts:
I'm trying to figure out whether there is a way to exploit a symmetry of a FIR interpolation filter in a polyphase implementation.

I know for a fact that we can exploit the symmetry in a normal FIR filter by reducing the number of required multipliers by half. It's possible because there are always two samples which are multiplied by the same coefficient (symmetry) and thus the complexity can be reduced by using a pre-adder instead of a multiplier.

However, I cannot find a way to exploit that symmetry in a polyphase implementation. I have a FIR interpolation filter which does interpolate by a factor of 16 times and it has 16 polyphases. Polyphases are not symmetrical on their own and we cannot exploit the symmetry since it simply doesn't exist. However, if we combine two polyphase pairs on each end we re-gain the symmetry, but I don't know how to exploit that since we need to calculate two new samples out of two polyphases, so we cannot really add them together in order to exploit the symmetry of the polyphase pair. That kind of symmetry is useful for a normal FIR filter, but not sure how to use it in an interpolator with polyphases.

My goal is to reduce the required multipliers by a factor of two, so I can implement two times longer filter, but with the same amount of required multipliers (pre-adders are not an issue).

The problem is that the design is required to be implemented within a DSP block of an FPGA (DSP48A1), so options are quite limited to pre-adder, multiplier and post-adder / accumulator.

Does anyone know how to achieve that?


texts: Find a LTI system such that $\mathcal{T}\{\frac{\sin t}{t}\} = \frac{\sin 2t}{t}$

texts:
Let
  $$x(t) = \frac{\sin t}{t} \qquad\text{and}\qquad y(t) = \frac{\sin 2t}{t}$$

  Is it possible to find a LTI system such that $\mathcal{T}\{x(t)\} = y(t)$?
  If not, what's the reason for that?

My try:

Assuming frequency response exists

$$Y(j\omega) = H(j\omega)X(j\omega) \tag{*}$$

Since $$\mathcal F\left\{\frac{\sin Wt}{\pi t}\right\} =\begin{cases} 1 &|\omega|\lt W \\0 &|\omega|\gt W\end{cases}$$
We have $$X(j\omega) =\begin{cases} \pi &|\omega|\lt 1 \\0 &|\omega|\gt 1\end{cases}$$
And $$Y(j\omega) =\begin{cases} \pi &|\omega|\lt 2 \\0 &|\omega|\gt 2\end{cases}$$
So it's not possible to find $H(j\omega)$ such that $(^*)$ holds. Because if $|\omega| \gt 1$ we have $X(j\omega) = 0$ which implies $Y(j\omega) = 0$ contradicting $Y(j\omega) = \pi$ for $1\lt |\omega| \lt 2$.

Is my argument right?
Also how we can prove the impossibility for the case frequency response doesn't exist? What's the intuition for this? I mean is it intuitively clear that we can't have $\mathcal{T}\{x(t)\} = y(t)$ for LTI system?


texts: a moving average relation that I can't find a counter-example to

texts:
Hi: I'm new to this list but I had a question that's not exactly related to dsp but maybe in a slight way and I didn't know where else to send it.  So, here goes and my apologies if this is totally the wrong place to send it.

The following describes the background as far as number generation.

Suppose have a series of positive numbers coming in sequentially ( regularly spaced ) that are generated by some invisible machine or oracle. no distribution is assumed for these numbers ( except that they are positive ) and they are generated at t1, ... tn. they are labelled as $x_1, x_2, ... x_n, x_{n+1}$. at each time $t$, the moving average with window size $n$ of the log of the $x_i$ is calculated and is labelled $mavelogx_t$.

the parameters of  are $n$ and $d$. $n$ is the length of the moving average calculated at each time $t$. $d$  is positive and will be explained below.

The following describes the game for a player who decides to play given the above ( assuming that atleast n numbers have been generated by now so a moving average can be calculated ). It doesn't cost anything to play this game.

The player of the game sees a new number at time $tstar$, $x_{tstar}$, and if $log(x_{tstar})$ is $d$ less than the current moving average, $mavelogx_{tstar}$, then $x_{tstar}$ is marked as the player's "initial" number. like 36.83 or whatever. the game works so the next time $log(x_t)$ crosses the moving average, $mavelogx_{t}$, from below at say $t = tstarstar$, then $x_{tstarstar}$ is marked as the player's ending number and the game ends.

The game rule is such that at $t = tstarstar$, the game ends and the player receives $winnum$ = $log(tstarstar) - log(tstar)$ ( winnum could be negative in which the player of course pays ). Of course it could happen that the player never get an initial number or that the player gets an initial number and never gets an ending number but let's make the assumption that the player plays and the game both starts and ends.

Now, I claim ( and think I proved ) the following two things. ( really one because it's an if and only if ) are true for the player playing the game.

A) if $(tstarstar - tstar)$ turns out to be less than $n$, then $winnum$ has to be positive. similarly if $(tstarstar - tstar)$ turns out to be greater than or equal to $n$, then $winnum$ has to be non-positive.

and conversely

B) if $winnum$ is positive, then $(tstarstar - tstar)$ has to be less than $n$. similarly, if $winnum$ is not positive , then $(tstarstar - tstar)$ has to be greater than or equal to $n$.

I could send the proof to anyone who is interested but my questions were :

A) does anyone have a counter-example to disprove what I'm saying in A) or B).

B) if A) and B) are true ( my proof is correct ), then is this a well known result in the literature ( any literature. doesn't have to be DSP ) ?

thanks a lot.
                                                   Mark


texts: How to get main frequency from digital signal

texts:
I have sampled digital signal with noise. I want to get main frequency of this signal how to do it?
Currently it is smoothed by moving average. Is good way to make Fourier Transform an take the highest peak? Or the first peak?

Thanks.


texts:
given the one-zero digital filter,

$$y[n] = x[n]\cdot \frac{1}{2} + x[n-1] \cdot \frac{1}{2}$$

Which has the transfer function:

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

and taking $M$ of these filters in series as a cascade, giving a filter $G$ with

$$G(z) = H(z)^{M}$$
Is there a known closed form of G's impulse response?

I have calculated one and am not sure if it's documented somewhere.
I know we can take the inverse fourier transform of $G(z)$, but we arrive at an integral/sum. I wonder about a closed form.

Thank you very much.


texts: extract the tree structure from a noisy data set

texts:
I am currently doing a project that attempts to reconstruct the 3D structures from slices, i.e. the tomographic approach.  After many steps of image processing, the last task is to connect the “points” (the centroid of the sections) to create the skeletons. The skeletons have been confirmed to be a forest of binary trees.

The problem here is that the data are very noisy. Would you please suggest some techniques to perform data fitting to extract the trees?


texts:
I appreciate this opportunity to submit a query on this forum.

When studying the continuous-time & discrete-time distinction, specifically with reference to discrete signals being identical when separated by 2*pi, it has struck me that a basic premise, per google calc, doesn't hold:

exp(2 * pi * sqrt(-1)) = 1
exp(4 * pi * sqrt(-1)) = 1
exp(6 * pi * sqrt(-1)) = 1
exp(8 * pi * sqrt(-1)) = 1

but...

exp(10 * pi * sqrt(-1)) = 1 - 1.2246468 × 10^-15 i

Any thoughts on the above (discrepancy?) would be appreciated.

Regards,

wirefree


texts:
(This question relates to Extracting Binary Magnetic-Strip Card Data from raw WAV)

I am extracting the binary sequence from the magnetic strip on a credit card.

As you can see, the signal is degraded clearly in one place.   also there is a minor degradation right on the left of the image.

Just using IIR (i.e. $X_{\rm out} = 0.9X_{\rm out_{last}} + 0.1X_{\rm in}$) smooths it, but the resulting signal is not mathematically smooth;  if I differentiate the signal a couple of times the noise comes back with a vengeance:

My question is: can I remove the noise in such a way that the derivatives come out clean?

If so, how?

EDIT: Here is a close-up of some damaged waves:

EDIT(2):
A couple of approaches I am considering:

Firstly I could make a taylor approximation of the signal either side of the damaged sector, and blend the approximations together.
Secondly I could FFT, remove high-frequency components and reverse FFT. I'm going to try that second approach now...


texts:
I am getting a signal from a device. This signal contains a non-random noise signal in it. I want to remove that noise from the signal. This noise is correlated to the motion the device is having. So now I've attached a accelerometer to the device to measure the motion produced by the device. I'm getting the data of X, Y, Z-axis from 3-axis accelerometer.

Now here is the process I thought to remove the noise.First get a motion signal from the 3 axis data which correlate to the motion noise present in the main signal. Then pass the main signal and the correlated noise signal through a LMS filter to get a filtered data. I've already designed a LMS filter but I'm stuck at how to get the motion signal(from the data of the 3-axis from accelerometer) which will correlate to the motion noise present in the main signal.

Can anyone help me with this plz??


texts: What is the difference between the Point Spread Function and Sampling Aperture?

texts: I've been told that the point spread function of a pixel is its distribution of intensity, while the sampling aperture of a pixel is its distribution of sensitivity. I'm a little unsure of what the difference between intensity and sensitivity is. It sounds like the former deals with how a pixel is displayed, while the latter deals with how it is captured. Is that correct?


texts: Correct image rotation/scale/moving change

texts:
I'm pretty new to Image Processing and am using MatLab.
I have an problem were I take an image of light passing trough an set of optical fibers (bundled together) and one were I pass laser energy trough the same bundle of fibers to burn the image of these fibers onto paper.
I then try to match these two. Up to now I just basicly imported both into photoshop and rotated, scaled and resized by hand to match them. However I am looking for an automated method in Matlab as I'm also doing different analysis on these pictures in matlab.
So I'm looking for an automated method to find the rotation, scale an movement difference of both images.
I tried a lot of different things using mostly different tools from the matlab imaging processing toolbox (SURF, BRISK, FAST) without success. Also with different optimizations of the image from just the basic matlab imadjust to changing to hue scale, contrast changes, brightness, denoising.

(i have higher resolution available)
Is there anyone who can send me in the right direction?


texts: Relation between order and stability in IIR filter

texts: What is the effect of increasing order of IIR filter? does it also effects stability? If we have an IIR filter of order 6, now we change its order to 7, will there be any change in its stability?


texts: Unable to obtain correct correct fourier transform for homework

texts:
Okay so I have this question for my homework which I am asked to find the fourier transform of a signal. However I am unable to obtain the correct answer, the question and my working is shown below.

Question( The answer is the equation of Xp(f) ):

My working(Look from b) onwards):

As can be seen, I am unable to get the answer. But I don't feel that I am wrong.

Thanks.


texts: Convex Optimization in Signal and Image Processing

texts:
In signal processing, convex optimization plays a useful role in problems such as sparse signal recovery and filter design. What other places does convex optimization appear?

For example, in compressed sensing the Basis pursuit Denoising problem, the LASSO problem and the Dantzig selector can be posed as:

\begin{eqnarray}
\min_{x} \ell(Ax-b)+r(x)
\end{eqnarray}

where $\ell(\cdot)$ is and $r(\cdot)$ are appropriate loss and regularization terms, respectively. Moreover, the design of a filter subject to time and frequency constraints often yields a convex formulation.


texts: Is it necessary to scale a signal for quantization noise analysis?

texts:
I am doing a series of tests to analyse the round-off (quantization) noise performance of single and two stage biquad cascades (direct form 1), at different sampling rates. The system I am simulating for this analysis uses 8.24 fixed point arithmetic.

At the moment the expected data for the filter will only range between 1 and -1, and no scaling will be implemented for the time being, to make use of the upper bits. The analysis I am doing uses a white noise signal.

Is it necessary to scale the stimulus up to the full bit depth of the filter, in order to get an accurate measure of the round-off noise of the system?

As I do not expect the filter to overflow in practice due to the massive headroom available, I am not sure if there is a more appropriate amplitude to scale the signal to, that exercises the most bits without causing an overflow.

Many Thanks


texts: Band-pass filtering on whole signal or overlapping chunks?

texts:
I am working with a signal acquired by a pulse oximeter, i.e. a device that records the change of light intensity reflected by a specific tissue depending on its blood perfusion.

Since I am interest in the heart rate whose physiological frequency is in between let's say 30 beats per minute up to 300, I would like to bandpass filter my signal (especially high pass to remove baseline wandering).

My goal is to extract the heart rate in 10 seconds long windows. Should I apply frequency based filtering (bandpass) on the whole signal on on each 10 second chunk separately?

Many thanks :-)


texts: Viterbi algorithm in HMM (Speech processing-oriented)

texts:
Currently, I'm following a tutorial about Viterbi which uses 12 time steps, and as an example, it gives the last 3 MFCC coeffs per time step:
https://arxiv.org/pdf/1908.03143.pdf
In the page 3 (E. Viterbi Extraction, 1. Recursion) they say that the viterbi cost in t=2 when taking state 2 and 3 are -7.1013 and -8.3930, respectively. I already did the math on my own, but I cannot get those figures. My math looks like this:
t=2

delta_2(2)
G=0.47
Norm distribution:=1.43
a_22=0.1
delta=-0.039 (paper=-7.1013)

delta_2(3)
G=0.82
Norm distribution=0.97
a_23=0.4
delta=-0.14 (paper=-8.3930)

Could you explain tell me what operands is the paper using to get those results?
Thanks!


texts:
I am working on speech segmentation using gammatone filters.

I can't understand the variable named GTord to calculate wts(weight) in the fft2gammatonemx.mat file.

This code can be downloaded form the following link.


texts: PyWavelets CWT: normalization? Vs Scipy?

texts:
Related. The equation being implemented normalizes by sqrt(1 / scale):
$$
C_{a, b} = \frac{1}{\sqrt{a}} \sum_k s(k)\left( \int_{-\infty}^{k+1} \overline{\psi \left(\frac{t-b}{a} \right) }dt - \int_{-\infty}^{k} \overline{\psi \left(\frac{t-b}{a} \right) }dt \right)
$$
so why does pywt._cwt do * sqrt(scale)? Also, how is it normalizing (L1, L2, etc)?

Edit: After reviewing Scipy's cwt, I realized it's implementing exactly what I described as "ideal" in the answer, thus it's same as comparing the two (except a few obvious details). I don't know in which scenarios pywt's algorithm is better, but generally - easy win for Scipy. I've opened a PR to address pywt's key flaw.
Edit2: Found an apparent edge of pywt's over scipy's in the least expected place: low scales. Addressed here.
Edit 3: after fixing the low precision in pywt, I actually found pywt superior to scipy in all of a variety of synthetic signals, but squeezepy's always beat both. Tests here, with more coming.


texts: What are the characteristics of a "good" smoothing convolution kernel?

texts:
At work we were smoothing a signal by convolving with either

f1=[0.2000 0.2000 0.2000 0.2000 0.2000]

or

f2=[0.1111 0.2222 0.3333 0.2222 0.1111].

A colleague noticed that f1 smoothed "stronger" than f2 and suggested a new filter:

f3=[0.2727 0.1818 0.0909 0.1818 0.2727]

His reasoning was that this should smooth even "stronger" than f1, and therefore be better.

My answer to this was that

if he wanted "stronger" smoothing he should instead increase the
size of the filter
a good smoothing filter should always approach zero at the start and beginning

My motivation for 2. was Gaussian filters which are often used for noise reduction in image analysis.

Is 2. correct?

Also because of the periodic nature of DFT does not f3 have the same frequency response as

f4=[0.0909 0.1818 0.2727 0.2727 0.1818],

which in turn should have a very similar frequency response as f2?

Edit: I followed Jim Clay's suggestion and zero padded and the result shows that f3 has terrible stop band ripple while f2 is quite OK in  this respect:

Thanks in advance for any answers!


texts: Respiration (breathing) signal movement artifact removal

texts:
Situation: I have breathing data of participants who have done different things during the study which caused their breathing change; watching mindless video to which resulted in unconscious regular baseline breathing; attending to a pacer with causes slow-paced breathing in range of 5 to 9 breath per minute; performing a stressor task which cause breathing to become fast and irregular.
Goal: I need to extract breath per minute (BPM) and breathing irregularity (using FFT).
Challanges. Participants' movement caused the signals look noisy . Note: this is a baseline data which supposed to be regular.  I need to remove the artifacts related to movement but I don't know how. Why is this important? My BPM values can be wrong and the FFT gives a large power to frequencies very close to zero.
File examples: http://stanford.edu/~parism/HPC_physio_split_undownsampled_256_example/
These are files from a person in the treatment group. The sequence of the columns in the file is as follows:
'Time','BVP', 'EDA', 'Temp','ABD', 'CST','Label'
The treatment group received the breathing pacer intervention during pre-, stressor, and post- block2. That means the pacer created vibration patterns at frequency of 6breath per minute (for this participant) to breathe with. During the pre- and post- stressors, the participant is not experiencing any cognitive tasks. Therefore they are very likely to synchronize their breathing with the pacer. During the the stressor2 tasks, they are less likely to do so. The pre- post- and stressor 1 blocks are similar to those in block 2. The only difference is that the participant is not receiving any intervention. Therefore they are less likely to do slow-paced breathing.
During the baseline the participant is not receiving any vibrations. They are just breathing at their resting heart rate. During the meditation phase, the participant is listening to an audio to pace to practice slow-paced breathing. We derived the pace of the pacer (in this example 6) from the last 30 seconds of this file. During the Practice, the participant is breathing with the pacer for about 90 seconds to ensure that they are comfortable with the pacer's pace.
Thank you in advance for help.


texts:
I have trouble accepting the merits of zero padding in the frequency domain to give more points in FFT. Wonder if anyone else has similar thoughts.

The mathematical 'proof'for the validity of zero padding in the time domain shows that the original FFT points coincide with the interpolated points from the zero-padded time signal where the frequency bins correspond, but as far as I can tell, this in no way proves that the interpolation is correct or even meaningful.

When a section of a time history of length T is selected from which to produce an FFT, it is implicitly assumed that the section repeats from the beginning to the end of time so the resulting FFT has bins at frequencies of n/t only for integer vales of n (otherwise the sections would not repeat perfectly). Therfore, if more FFT points are required, the sensible/corect thing to do is stuff zeros between the FFT bins, which could also be achieved by concatenating several of the time sections before producing an FFT. Not very useful though, I admit.[Essentially, as far as 'the FFT is concerned'

If the time history is a very short transient, and otherwise the signal is zero, or very close to zero, then zero padding may actually (dare I say it!) increase the resolution because it adds information to the signal.


texts:
I am studying computer vision and have some trouble with difference of Gaussian filter.

We apply Gaussian filters with different values of sigma on original image then subtracting from them.

However, Gaussian filter blurs image, so some edge might not be identified.

Why could we use DoG?
How effective is DoG?
Which type of images work best for this filter?


texts:
I am currently studying BPSK demodulation. Most probably my question  very basic but i am having difficulties to understand the case of real-time bpsk demodulation. Basically, all the examples (matlab, theory books etc) assume i have the whole signal at the receiver with frequency and phase offset in which they apply frequency and phase offset estimation and later symbol and timing recovery. I find it difficult to realize this scheme in a real-time fashion, in which for example I constantly receive samples from antenna in a buffer.

How can i start to perform bpsk demodulation without isolating the signal since the the timing recovery is performed latter in the examples i have checked?

For sure I am missing something or confusing the concepts.
Can you please provide a toy example of such methodology or point me to a usually technique to perform in a real-time implementation.

Kind Regards,
J


texts: approach to differentiate noisy data with steep ramp

texts:
I'm trying to write some image processing code in python to differentiate between two types of images (we'll call them set Blue and set Amber).  I have run an algorithm I wrote that results in the data graphed below for a sample from one image from each set.  Although the absolute scale of the data varies, the Blue image always seems to have that characteristic steep ramp somewhere in the middle of the data.

Programmatically, what would be the best way to find such a steep, high ramp in this noisy data?  I'm looking for a binary answer: is this ramp present.


texts: What's an extremely efficient way of detecting when a user has stopped talking into a microphone? When I use systems like Siri it can detect when I've stopped talking almost immediately, even when there's background noise. My initial guess was to get the average volume of the background noise first but it seems there isn't much time for that as Siri starts listening straight after the button is pressed. The method doesn't have to be accurate in what is being said, just recognize that something is being said. What algorithms should I look into?


texts: Struggling to find a good definiton for Gabor-Descriptor

texts:
I am attempting to implement the Gabor Descriptor based on the following paper Image Copy Detection Using a Robust Gabor Texture Descriptor. It is the best paper that I have found on the subject. It is not perfect, as it has some ordering issues with some equations and paragraphs that only make sense after later sections. No biggie, it is only a matter of time consumed to decipher the intent.

What is stopping me right now, is that one of the parameters is never defined in the paper. It first appears in $(1)$ of Section 2. There we have the following factor: $e^{2\pi jWx}$

$W$ is later assumed to be 1 and $x$ is the parameter of the function, but $j$ is never defined (though it is used again in several subsequent equations, especially in section 3.1, of most interest is $(11)$).

So I am seeking either a definition of $j$. A nice bonus would be a better paper (or book) defining the Gabor Descriptor.


texts: Are there any good texts on EEG analysis geared towards programmers

texts:
I just have a quick question. I'm a second year computer science major with a background in C# and C++. I'm interested in studying neuroscience after graduation, and I've been researching some subjects on my own in my free time. I'm thinking of purchasing a Neurobit Optima 4 and writing some applications for it (specifically I want to convert unspoken speech into commands an application can understand and execute), but while I'm still in the research stage, I was wondering if anyone knows about any text books or websites that discuss the analysis of EEG data or cover topics such as Discrete Wavelet Transforms that offer programming examples?

Thanks in advance to anyone who can help


texts: How to adjust receiver gains to avoid saturation and quantization noise to optimise post digital processing?

texts:
I am using a Hack RF One as SDR and the software GNU Radio to receive and process signals emitted from a drone. Given that the drone is moving and is emitting signals from a wide zone, received signal strengths vary dramatically : if the signal is too large, it over-ranges the ADC input and if the signal is too small, it gets lost in the converter's quantization noise.

At the reception, I have three different gains : RF gain, IF gain and BB gain. RF gain can be set to 0 or 14dB, IF gain from 0 to 40dB by 8dB steps and BB gain from 0 to 62dB by 2dB steps. At the transmission, I keep the transmitting power constant.

For now, my algorithm to manage the different values of gains is the following : Every x seconds, I look at the received digitised signal peak-to-peak value $V_{pp}$ (I take the maximum value V_pp for real or imaginary received signal) and I try to maintain this value into a range such that $V_{pp,lim1} < V_{pp} < V_{pp,lim2}$ , to avoid quantization noise and saturation. To do so, I simply increase or decrease the gain in function of the value $V_{pp}$, starting with IF and BB gains to finish with the amplifying RF gain.

The problem is the following : My algorithm is not optimised. Given that the possible changing steps are not linear and different for every type of gain (14dB for RF, 8dB for IF and 2dB for BB), I sometimes fall into situations where my gains are continuously changing between two situations and do not manage to stabilise even if I keep the distance constant between emitter and receiver.

The question is : how can I manage to have the more constant output amplitude so that my dynamic range is optimised for the ADC?

Constraints :

Gain steps restricted : 14dB for RF (0 or 14dB), 8dB for IF (from 0 to 40dB) and 2dB for BB (from 0 to 62dB)
Order of changing gains : "Increase or decrease the IF and baseband gain controls roughly equally to find the best settings for your situation. Turn on the RF amp if you need help picking up weak signals" (source : https://github.com/mossmann/hackrf/wiki/FAQ )


texts: Using matlab (or some other tool) to perform convolution?

texts:
I have an homework assignment in my signals and systems class involving various tasks having to do with signal analysis, but my main question is this:
I am given a system described by the differential equation:

$$a_1 y'(t)+a_0 y(t) = b_1 x'(t) + b_0 x(t)$$

I am given 15 values of the response function and am able to graph it in Matlab using the plot function with 2 vectors.

I have been able to find the impulse response $h(t)$ of the system. To my understanding, one can find the output $y(t)$ of any LTI system to an input signal $x(t)$ by convolving that input signal $x(t)$ with the impulse response $h(t)$ of the system.

However, my input signal $x(t)$ and impulse response $h(t)$ are in 2 different formats, as I have the analytic (as a decaying exponential function) form for my impulse response $h(t)$.

How do you all suggest I go about convolving the two?
Thank you very much.


texts: FFT requirements of real time signal from sensors

texts:
I have an electrical current sensor which generates measurements every second. I want to calculate the FFT of this signal. Since my real-time values are received every second, I think that the fastest I can go with the FFT sampling period is also 1 sec. In that case, what I am basically doing is that I collect X number of samples in a buffer and I calculate the FFT. I then store the new values as they arrive at the end of this buffer and repeat the FFT calculation.
Q1: is this a correct setup?
Q2: is there a minimum requirement for the buffer (FFT window?). I have now set it up to process 10 samples.
Q3. what is the maximum number of frequencies that can be detected in this scenario?


texts: Pitch detection algorithms "give up" after very little

texts:
I'm sorry if pitch detection has become a stale topic here, but I'm really interested if anyone has any advice on this topic. I'm looking for the best pitch detection algorithm for stringed instruments, but I think this question will turn into "What else needs to be done to most accurately and reliably detect a pitch of a stringed instrument?".

So basically I applied all algorithms from https://github.com/JorenSix/TarsosDSP/tree/master/src/core/be/tarsos/dsp/pitch and they all differ, but they all have one thing in common, on any device I try, the algorithm reports -1 Hz after around a second of a string on an instrument being played.

Basically the magnitude needs to be really high in order for the algorithm to detect anything. Now, obviously it's nothing on my part since I literally just copied the exact code and got those results. So there are obviously methods of still detecting a pitch in low magnitudes ( other applications, not sure what they use, can detect the pitch in the same situation for around 4-5 seconds which is a lot longer then these algorithms ), but I'm not sure what they are.
I'm not even talking about the fundamental being weak here, since the algorithm detects nothing.

Am I missing something, or is it the more likely option that something else needs to be done other than just applying a PDA to a sound buffer and if so, what is/are those things?

Thanks!


texts: Alias-free digital nonlinear filter design

texts:
@Jazzmaniac has a good answer to the question of how to design an alias-free digital nonlinear time-invariant filter here: https://dsp.stackexchange.com/a/28787/18276

Basically, according to that answer, a digital nonlinear time-invariant filter is alias free if and only if it commutes with subsample translations. Meaning that it doesn't matter whether you filter and then translate, or translate and then filter. Sinc interpolation is required for perfect subsample translations, but of course you can always use a finite interpolator that is good enough.

This question is to elaborate:

How can we see the link between subsample translation invariance and aliasing?
Is there any easy way to see what these filters look like?
Do the filters have some standard form they can be put in?
Do we know what the alias-free version of the monomials look like? (i.e. the alias-free version of $y[t]=x[t]^n$ for some positive natural number $n$)
Are there any good references or published works on the topic of alias-free nonlinear filter design?


texts: How to get rid of noise and oscillations using Kalman filtering

texts:
I have not studied signal processing at all, so please forgive any ignorance in the following discussion.

I have some noisy position measurements that I've been trying to smooth. I've been attempting Kalman filtering but getting either hf noise or lf oscillation depending on the constants I put in. What should I do?

The full story:

I've used a program which is basically like this (I read briefly about how the Kalman filter works and made my own version):

for z_measurement in samples:
    expected.r = old_estimate.r + old_estimate.r * delta_t
    expected.v = old_estimate.v + old_estimate.a * delta_t
    error = z_measurement - predicted.r
    new_estimate.r = old_estimate.r + gain.r * error
    new_estimate.v = old_estimate.v + gain.v * error

    old_estimate = new_estimate

This worked fine for constant acceleration, but when I have a slowly changing (uncontrolled) acceleration (drag which appears slowly decrease) as another state variable, I had a trade off. As I lowered the position gain, I got rid of high frequency noise, but I got even worse low frequency noise which overwhelmed the signal in the acceleration. The position gain seemed to act like shock absorbers, but let through too much high frequency noise.

I've been trying to learn real Kalman filtering to see if that could help. I do not have a control system, so I'm ignoring B and u. It seems to turn into a computer program like this:

for z_measurement in samples:
    x_prediction = A_update * x_old_estimate
    P_int_covariance = A_update * P_old_covariance * A_update + Q_process_error
    K_gain = P_int_covariance * H_measure * (H_measure * P_int_covariance * H_measure + R_measure_error)**-1
    x_new_estimate = x_prediction + K_gain * (z_measurement - H_measure * x_prediction)
    P_new_covariance = (Identity - K_gain)* P_int_covariance

    x_old_estimate = x_new_estimate
    P_old_covariance = P_new_covariance

This works fine for calculating averages, but looks non-trivial to define P, Q, and R right for a real system.

From what I now understand of Kalman filtering:

A is the prediction model of the system. It corresponds exactly to my previous program:

expected.r = old_estimate.r + old_estimate.r * delta_t
expected.v = old_estimate.v + old_estimate.a * delta_t

H is a meaningless function used to access the measured parameter.

expected.r

Q and R are error matrices that define the expected noise/error at each stage, and P defines how error of one state variable increases the error of other variables.

However Q and R are constants, and P and K_gain quickly converges to constants when Q exists. In fact K_gain is the only useful matrix (the others are only used to calculate the eventually constant K_gain).

It seems to me that rather than using dark arts to guess Q and R, you can do it directly by playing with K_gain until it works.

Which a few days later leads me back to my original program.

...

Will persisting and correctly defining Q and R, (or K directly) actually give me gain constants that get rid of my noise and oscillations, or would I be better off trying non-linear gain functions. Alternatively should I put up with the high-frequency noise and use a separate low-pass filter afterwards, but then would it be better to do simple low pass filtering and totally forget the Kalman filtering?

Are there any other filters I should try? I'm afraid that linear filtering will loose too much signal. I tried some quadratic filtering and ended up with oscillations with periods related to the length of the filtering window.


texts:
I have some 4 polynomials  like this. these equation is made by polyfit() from   MATLAB tool.
eq1) 3.1734x^3 -5.8952x^2 +3.8194x -0.0377
eq2) 2.1489x^3 -3.9026x^2 +2.8169x -0.0160
eq3) 1.0796x^3 -1.9013x^2 +1.8500x +0.0008
eq4) x

then I want to make these 4 polynomials to one polynomial But I don't know how to apply this concept to my 4 polynomials .
Update :
Here is referencing.

Actually, I want to apply above concepts to in my case.
How can I get a (H^T H)^−1 H^Ty from above equations?


texts: inverse discrete fourier transform with plain python

texts:
I am trying to calculate inverse discrete fourier transform for an array of signals.

I am using the following formula:

$$ x[n] = \tfrac1N \sum\limits_{k=0}^{N-1} X[k] \, e^{j 2 \pi k n/N} $$

And my python code looks as follow.

def IFT(array):
    array = np.asarray(array, dtype=float)
    # array length
    N = array.shape[0]
    # new array of lenght N [0, N-1]
    n = np.arange(N)
    k = n.reshape((N, 1))
    # Calculate the exponential of all elements in the input array.
    M = np.exp(2j * np.pi * k * n / N)
    return 1 / N * np.dot(M, array)

y = 2*np.sin(2*np.pi*f1*t+0.2) + 3*np.cos(2*np.pi*f2*t+0.3) + noise*5
IFT(sc.fft(y))

array([ 3.42732136e+00+0.00000000e+00j,  4.81582993e+00-4.10374772e-16j,
    5.86456023e+00+3.88824673e-16j,  4.07942919e+00-1.48609552e-15j,
    5.25077594e+00+6.70968395e-16j,  6.45823471e+00-1.22977116e-15j,
...
sc.ifft(sc.fft(y))

array([ 3.42732136-8.59756710e-16j,  5.34401724+4.97379915e-17j,
    5.46939384-9.87654403e-16j,  3.31504852-4.17443857e-16j,
    6.52888175+6.39488462e-16j,  6.90804001-3.10862447e-16j,
...

but if I compare array returned from Scipy.ifft with the one returned from my own function IFT, I get completely different array. Am I missing something?


texts:
I am reading the book "Multiple input describng functions and nonlinear system design" written by A.Gelb and W.E.Vander Velde.

At some point it says:

  Single-valued characteristics are termed memoryless; multivalued characteristics are said to possess memory.

I am a bit confused about the meaning of the 'memoryless' term. I thought that memoryless meant a function that depends only on the value at that time instant and not at previous instants of time.

What am I missing?


texts: How to find period/envelope that is larger than sample size?

texts:
Mercury's distance from the solar system's barycenter (in kilometers)
can be approximated as:

5.9115960588705115e7 + 1.1573608483842954e7*Cos(2.086944367456105 - 0.0029751428085695573*t)

based on 8 years worth of hourly "samples" from HORIZONS. (t is in
hours; I forget what value corresponds to t=0, but it should be
irrelevant to my question).

The residuals after this approximation look like this:

I could add additional Fourier coefficients, but there appears to be a
period or envelope that is larger than the sample size.

Standard Fourier analysis will never find this period, and continuous
Fourier analysis is fairly inefficient.

How can I find this period/envelope?

Perhaps more to the point: what's the simplest function that does a
"fairly good" job of approximating this data?

The graph shows a pattern, so there "must be" such a function?


texts: FM Modulation Index and Frequency trippler

texts:
Suppose I have an FM signal with modulation index mf which is passed through a frequency tripler, then what will be the modulation index of output waveform ?.

Thanks in advance....


texts: How do I find the transfer function in the frequency domain?

texts:
I was doing some exercises with transfer functions, they were always under the form of $H(z)$ and $H(e^{jw})$ for the frequency response. Today I have found one with $H(f)$. I would like to ask if my solution to the problem is good ?
Let $y(n) = -x(n)$ where $y(n)$ is the output and $x(n)$ is the input. Find the transfer function $H(f)$.

Here is my approach to the problem:

$y(n) = -x(n) => H(n) = \frac{y(n)}{x(n)} = -1$

We apply the Fourier Transform

$H(f) = F\{H\} = F\{-1\}= \int_{-\infty}^{\infty}e^{j2\pi f t}dt = -\delta(f)$

Since $\delta(f) = 1$ we conclude that $H(f) = -1$


texts: Low pass and High pass filter Coefficient

texts: Is there any way to tell whether a filter is high pass or low pass by observing only it's time domain samples or coefficients?


texts: Avoiding "RuntimeWarning: invalid value encountered in log10" when converting FFT data to dBFS

texts:
I've attached some code below that I'm having some issues with.  Basically, I need to write a function to get the dBFS value of a signal at a specified Hz value, at a given channel in a .wav file.  For a number of reasons, I need this to work on both 16 bit integer and 32 bit integer formats.  Since SciPy's .wav io module supports 16 bit and 32 bit integer, I'm hoping that I could just convert either to 32bit float first, then perform the FFT and dBFS conversions.  For example, if you have a stereo test file that has a 440 Hz tone on channel zero, the function below would be called by db_val = check_db_at_freq_channel(test_file, 440, 0) where test_file is just a file path.

I have a test file that was exported as both 16 bit int, and a copy at 32 bit int, when I run this function on the 16 bit file, it's fine, but when I run it on the 32 bit file, I get RuntimeWarning: divide by zero encountered in log10.  Obviously, there are 0's being passed to the log10 function to convert to dBFS.  I'm wondering if there is a way I can avoid this?  Why does this only happen to 32 bit int converted to 32 bit float?  Is my method of converting to 32 bit float incorrect?

import numpy
import scipy.io.wavfil
import scipy.fftpack

def check_db_at_freq_channel(input_pcm_file, hz, channel):
    data_sample_rate, data_pcm = scipy.io.wavfile.read(input_pcm_file)

    data_len_rounded = round(data_pcm.shape[0] / float(data_sample_rate))

    if data_pcm.dtype == 'int16':
        max = float(2**15)
    elif data_pcm.dtype == 'int32':
        max = float(2**31)
    else:
        raise TypeError('data_pcm.dtype {} != {} or != {}'.format(data_pcm.dtype, 'int16', 'int32'))

    # Convert Integer data to floating point.
    data_pcm = data_pcm.astype(numpy.float32, order='C') / max

    # Check for a Mono Input
    if len(data_pcm.shape) == 1:
        data_pcm = data_pcm[:, None]

    data_fft = scipy.fftpack.fft(data_pcm[:, channel], n=int(data_len_rounded * data_sample_rate))

    # Convert to dBFS
    data_db = 20 * numpy.log10(2 * numpy.abs(data_fft) / float(len(data_pcm)))

    # Get Frequency Bins
    data_freqs = scipy.fftpack.fftfreq(data_fft.size, d=(1 / float(data_sample_rate)))

    # Get Index of requested Hz value.
    data_index = numpy.where(data_freqs == data_freqs[(numpy.abs(data_freqs - hz)).argmin()])[0][0]
    return data_db[data_index]

if __name__ == '__main__':
    test_file = '/path/to/some/file.wav'
    val = check_db_at_freq_channel(test_file, 440, 0)
    print val

I'm sure there is more information I could provide, so please let me know if I'm missing some crucial information?


texts: What are the limitations of FIR filters?

texts:
I know that for type II FIR filter it adds a zero at $z=-1$ so it cannot design a high-pass filter.

My question:

  what type of limitations the other types have (type I, III, IV)?


texts: Is there any way how to compute convolution matrix for Nearest Neighbor (bicubic, bilinear) image scaling (upscale/downscale)?


texts: Building a Low-Pass FFT filter for a noisy current pulse signal

texts:
I have some (well lots) of data signals which are measurements of current pulses. The current pulses are the result of spark breakdowns (20 kV + 700 pF capacitor so quite energetic) and my problem is that noise, and displacement current signals are clouding the underlying current pulse.

The noise and the displacement current signals are quite high frequency. The actual pulse, is much lower so I am wanting a low pass filter. I use Origin Labs and in there I can apply a low pass FFT filter and I find that for the most part, a cut off of about 7 MHz does the trick for some of the more well defined pulses, sometimes I have to use something higher like 15 MHz.

I have a lot of measurements and would like to speed this process up by getting Matlab to do it for me.

The data files should all be the same length and all the same resolution (A cursory looks says each file has 9900 points, with a time step of 4e-10 seconds, so about 4 uS of data).

I just don't have a clue where to start with this in Matlab. I don't need anything fancy, I merely want to pull out an approximate value of the current. I have tried something simple like performing the FFT and then making all values above a certain frequency = 0 then doing the inverse FFT but that appears to do nothing at all!

I can't post a picture of the signal, apparently I need some reputation on here or something first. But I may be able to host it on my Flickr page if needs be.


texts: What is the difference between positive matrix coefficients and negative matrix coefficients of an audio?

texts: I have turned an audio file into an one dimensional array by using audioread function in matlab and found several positive and negative fractional coefficient values.What is the basic difference of this positive and negative sign in the matrix?


texts: Moving average frequency response over an image

texts:
I'm studying image denoising by linear filtering with cross-correlation, in particular with a moving-average kernel (K x K kernel of all equal elements which sum is 1).
For clarity, I'd like to refer to 1D moving average filters (and the 2D extension is just done by using 2D Fourier transforms):
I read the dsp SE answer at this link that finds the magnitude of the frequency response of a moving average filter, but that post uses a discrete time Fourier transform, whereas I've seen in a book the use of the discrete Fourier transform: the only difference is that the discrete Fourier transform version is obtained by sampling the discrete-time Fourier transform $H(\omega)$ in the points $\omega_k = \frac{2\pi \cdot k}{N}$.
The book I'm reading also states that the discrete Fourier transform has "meaning" only when $k$ is such that $k \in [-\frac{N}{2}, \frac{N}{2}]$ (and of course $k$ is an integer).
I don't understand how to interpret the sequence given out by the DFT with respect to the frequency response of that filter and why the DFT has "meaning" only if $k \in [-\frac{N}{2}, \frac{N}{2}]$ and not $k \in [0, N-1]$. I also suppose that N is the size of the 1D moving average filter, but I'm not sure.
EDIT: moreover, how does the size of the moving average filter relate to the frequency response?
Thanks in advance.


texts: What is the sequence type if ROC is an annulus in the z-plane

texts:
if:

$|z|>|\alpha|$ is causal and right-sided

and:

$|z|<|\alpha|$ is anti-causal and left-sided

then, what is the annulus/donut-ring ROC?

$|\beta| < |z| < |\alpha|$

non-casual?  finite-length?  double-sided?


texts: How does PSOLA pitch-shift work in real-time?

texts:
How does the PSOLA pitch-shifting algorithm manage to remove or add audio frames in real-time without creating gaps?

Wouldn't extending the "windows" (it's like in FFT windowing) to longer than the audio buffer create asynchronity in the buffering? Similarly compressing the windows would lead to the need to "read new audio in advance" in order to not leave silence.

Or what's the idea?

I guess there's some clever math (ratios?) in order to know how to fill and remove windows so that they still match up reasonably in the overlap-add process.


texts: Adaptive Wiener Filter Coefficients Calculation

texts:
I want to extrapolate a signal X of length 11, using the weiner filter coefficients W of length 7. The procedure I am using is as follows:

Compute the autocorrelation matrix upto lag 8 .
Using Levinson recursion, invert the autocorrelation matrix A.
Multiply the matrix of cross-correlations with the inv(A) to get W
Obtain Extrapolated Sample=Sum(W.*Signal)

My questions is that, if now I have a new signal Y of length 15 as:
Y=[X (4 new samples)]

So the Signal Y has first 11 samples of X and 4 new samples.

Now I want to compute weiner coefficients of this signal, given that I have already computed those for the signal X, can you recommend any possible approach to 'update' the filter co-efficients W given the 4 new samples, without having to do the whole weiner filter computation again thus saving some computational time?

Edit 1:

I have written the code for LMS Algorithm to iteratively 'adapt', when a new sample arrives, the filter co-efficients which were initially derived by Weiner Prediction.

The result is not same as the Weiner coefficients derived on the whole input.

The code is:

    `FilterOrder=7;

Window=7;

Filter=zeros(1,FilterOrder);

x = -20*%pi:0.1:20*%pi;

m=length(x);

StepSize=2.3e-4/1000000;

data=[cos(2*x(1:floor(m/2))) cos(3.3*x(floor(m/2)+1:m))];

Filter=WeinerCtrace(data(1:Window+1),FilterOrder);   // Initial Co-efficients

for i=1:50

Input=data(1+i:Window+i);               // Sliding Window of Filter Input

DesiredOutput=data(Window+1+i);         // New sample value

ActualOutput=Input(Window:-1:1)*Filter';

Error=DesiredOutput-ActualOutput;

while(1)

    NewFilter=Filter+StepSize*Error*Input;     // Gradient Descent

    if(sum((NewFilter-Filter).^2)<1e-20)

        break;

    end

    Filter=NewFilter;

end

Filter=NewFilter;

end
WCoefficients=WeinerCtrace(data(1:Window+i+1),FilterOrder)

Now, according to my opinion the values of WCoefficients and Filter should match as the WCoefficients are computed by applying Weiner Prediction on all the arrived data, while Filter is computed iteratively on introduction of every new sample.

Edit 2:
I have also implemented the RLS algorithm code given below, but the output of RLS still does not match the output of Weiner Prediction Coefficients for the same window:

FilterOrder=11;
Window=11;
t=0:1:1000;
f=linspace(.5,5,length(t));
fs=100;
data=cos((%pi/fs)*(f.*t));
[Filter,P]=WeinerCtrace(data(1:Window+1),FilterOrder);
w=1;
plot(data,'-r');
for i=1:500
    Input=data(Window+i:-1:1+i)';           // Sliding Window of Filter Input
    DesiredOutput=data(Window+1+i);         // New sample value
    ActualOutput=Input'*Filter;
    Error=DesiredOutput-ActualOutput;
    K=(P*Input)/(w+(Input'*P*Input));
    P=(P-(K*Input'*P))/w;
    Filter=Filter+(K*Error);
end
inp=data(i+1:Window+i+1);
WC=WeinerCtrace(inp,FilterOrder)
inp=data(i+1:Window+i);
for j=1:100
   NextValue=inp(11+j-1:-1:j)*WC;
   inp=[inp NextValue];
   plot(Window+1+i+j,NextValue,'r+')
end
inp=data(Window+i:-1:1+i);
for j=1:100
   NextValue=inp(1:Window)*Filter;
   inp=[NextValue inp];
   plot(Window+1+i+j,NextValue,'b*')
end

Can someone point out what am I doing wrong in the code or in anything else ?
Any suggestions/idea is welcome. Thanks!


texts: Intuition about tag pose estimation accuracy

texts:
I have some difficulties to have a correct intuition about expected pose accuracy when dealing with planar pose estimation (e.g. pose estimation from AprilTag detection) and perspective camera model.
Assuming ideal conditions (e.g. simulated data), I consider also that the tag corners can be extracted with a good accuracy, e.g. < 1px.

Given two physical tags projected onto the image plane with the same size, oblique view (tag parallel to the image plane), can we assume the expected pose error is the same regardless of the working distance?

Since for tag detection, what matters is the size of the tag in the image, and for pose estimation what matters is precise corners location extraction, I want to put a minimal tag size in the image to choose other factors like physical tag size, camera focal length, working distance, ...
If 1. is true, this means that for two tags projected with a 100 px size in the image, if we have a translation pose error of 1mm at 1m, we could assume to have 1mm translation pose error at 2m if we choose appropriately the physical tag size to ensure a projected tag size of 100px.
My intuition for 1. is that it is not true, and somehow the translation pose error is dependent to the working distance.

For a fixed working distance, if a tag is projected onto the image plane with a 100px size, what is the impact of the projected tag size wrt to the translation pose error?

For instance, if the size of a tag is 100px in the image and the translation pose error is 1mm, if we double the size of the tag in the image to be 200px by playing with the focal length or by increasing the physical tag size, can we expect to reduce the translation pose error by the same factor (i.e. 0.5mm)?
For sure bigger tag size should improve the accuracy of the pose estimation, but I am not sure it scales like that.

By pose estimation, I mean the translation ($t_x, t_y, t_z$) + orientation ($3 \times 3$ rotation matrix) for rigid body transformation.
Also called PnP pose estimation, like pose from homography for planar object or EPnP by Lepetit et al.
For perspective projection:

normalized image coordinates
$$
x = \frac{X_c}{Z_c} \\
y = \frac{Y_c}{Z_c}
$$
to the image coordinates
$$
u = x \times f_x + c_x \\
v = y \times f_y + c_y
$$

For focal length in pixel, I have:
$$
f_xpx = \frac{f_xmm \times \text{image_width}}{\text{sensor_width_mm}}
$$

This intuition would be very useful to accordingly choose the physical tag size, the focal length, the image resolution to ensure or at least maximize the probability to have a given translation pose error.


texts: Plot frequency tiling wavelets/curvelets

texts:
Is there a convinient way to plot the frequency tiling of for wavelets/curvelets? For example the input would be the number of scales $j$ and the output would be something like this:

Preferably in python. Thanks for any help!


texts: Complex Data type not accepted in Simulink

texts:
I am having an issue with the interaction of the Matlab function block in the Simulink with my model block. Below you can also find the picture.
I have created a Matlab function with three inputs and 1 output. Since in the MatLab function block, I have solved a differential equation, it has complex expressions in the form of for example.

(exp(sqrt(-a/b)))

This generates the output of complex data types from the function block. When passing this to the integrator which is the input to my plant, I can not run the Simulink due to the error

    "Cannot pass the complex value to non-complex location"

I tried changing the data types of the integrator, then the same thing happens to other blocks in the Simulink.
I also tried using absolute values, which of course gives real numbers, but turns out to be a very large number and generates high magnitude. I really need help in solving this issue.
Can anyone help me in this/

Thanks in advance.


texts: How to Count the number of People in a room using CCTV Camera feed?

texts:
I am trying to find out how can I count the number of people in a room using the feed coming in from a CCTV camera fixed in one of the top corners of the room. The number of cameras can be 2 at max but 1 for now. The objective is to only be able to tell how many persons are present in the room, in real time. The precision of it is not too important, for e.g. the system could suggest a range like "there are more than 5 people right now".

Upon browsing and researching, I came across a lot of very complex algorithms and terms related to Computer Vision and Image Processing that I have not understood at all like OpenCV, HOG, Blob Detection/Tracking, Foreground/Background Subtractions etc.

I am a design student. I do not have a background in programming. But, about a week back I got introduced to Processing. So, if some could help me out here with some tutorials/references/code to have it work in a language like Processing for prototyping purposes.

Thanks in advance.


texts: Detecting and isolating part of an image

texts:
I'm working with cross-sectional CT scans of the leg using matlab's image processing toolbox.  Part of what I'm attempting to do is to automatically isolate the leg in any image, which requires removing any extraneous objects that are present in the image.  So far my code is able to take out most objects, which works for the majority of my images.  However, some of the images have an object that is flush with the leg, which my code isn't able to remove.

Here's an example of the problem: The first image shows the original image, and the second one shows the "filtered" image, after it has gotten rid of extraneous objects.  But as you can see, there is still something outside of the leg cross-section that I would like to get rid of.

I've thought of using something to detect ellipses, but unfortunately some of my images are not very good homogenous shapes (like the one below).

And here's the current code I have:

% Read input file
inputfile = dlmread(filename,';');

% Normalise input file (0 to 1) & show original image
I_original = mat2gray(inputfile,[min(inputfile(:)) max(inputfile(:))]);
figure; imshow(I_original)

% Detect leg
BW1 = im2bw(I_original,.2);
BW2 = imfill(BW1,'holes');

% Remove misc. objects around leg (i.e., stray objects <5000 pixels)
BW_final = bwareaopen(BW2,5000);

% Generate filtered image
I_filtered = I_original;
I_filtered(imcomplement(BW_final)) = NaN;
figure; imshow(I_filtered)

Any suggestions on how to fix this would be appreciated!  Thanks!