texts: Removing halo effect in image composition: Google Meet's solution

texts:
Wanted to understand how google meet is removing halo effect when composing their image. They describe their method briefly in their blog as:

"The blur shader simulates a bokeh effect by adjusting the blur strength at each pixel proportionally to the segmentation mask values, similar to the circle-of-confusion (CoC) in optics. Pixels are weighted by their CoC radii, so that foreground pixels will not bleed into the background. We implemented separable filters for the weighted blur, instead of the popular Gaussian pyramid, as it removes halo artifacts surrounding the person. The blur is performed at a low resolution for efficiency, and blended with the input frame at the original resolution."

https://ai.googleblog.com/2020/10/background-features-in-google-meet.html

Am facing a similar issue where background color from original image is coming into the new composition as shown below creating a halo effect:

Am familar with guassian pyramids but not sure how it helping in this case and how seperable filters have an impact. Can anyone explain how to solve this problem?


texts: Can anyone explain me this MDFT polyphase filter bank?

texts:
I found a very interesting piece of code for MDFT polyphase filter bank here.
Unfortunately, there doesn't seem to be a paper describing the theory. Does anyone know some reference for the code?
I'm especially interested in these 3 topics:

What are the data in the channels exactly? Are they supposed to be real, imaginary or complex?
The code computes only half of the number of bands. Is that due to real-valued signals used?
The result of the synthesis stage is build as a channel-wise difference of the outcome of the two synthesis filter banks. Why is it done like that? I can't find any paper describing this idea.


texts:
In my time series data, I have often spikes with regular periods. Sometimes, I get two or three different periodical spike sequences (two electrical noise sources), some with T1 seconds period, some with T2 second period and some irregular and at random times.

Lets say I have two groups of overlapping periodical spikes in my data, one with a period of 8 seconds and another with 6. I have zeroed the data except for the times where there is spikes. So, my data now looks like a train of spikes. How can I find the periodicity of the two and separate the two groups? Cross-correlation didn't help as many are just single sample spikes. I was thinking of FFT. But I can't see anything in the spectra at those low frequencies, nor when I use FFT on original data. My data has 500 Hz. sampling frequency. I do not want to remove them, just to find the periodicity. Thanks.


texts: FWGN model implementation vs explaination (textbook pages attached)

texts:
I came across the FWGN model for multipath channel simulation in the book: "MIMO-OFDM Wireless Comuunications with MATLAB"

Here is an explanation about Clarke/Gans model:

Some code to generate a Chanel using this model is also in the book:
here is some of it:

function [h,Nfft,Nifft,doppler_coeff]=FWGN_model(fm,fs,N)
% FWGN (Clarke/Gan) Model
% Input: fm= Maximum Doppler frquency
% fs= Sampling frequency, N = Number of samples
% Output: h = Complex fading channel
Nfft = 2^max(3,nextpow2(2*fm/fs*N)); % Nfft=2^n
Nifft = ceil(Nfft*fs/(2*fm));
% Generate the independent complex Gaussian random process
GI = randn(1,Nfft); GQ = randn(1,Nfft);
% Take FFT of real signal in order to make hermitian symmetric
CGI = fft(GI); CGQ = fft(GQ);
% Nfft sample Doppler spectrum generation
doppler_coeff = Doppler_spectrum(fm,Nfft);
% Do the filtering of the Gaussian random variables here
f_CGI = CGI.*sqrt(doppler_coeff); f_CGQ = CGQ.*sqrt(doppler_coeff);  % <--- Why sqrt ?
% Adjust sample size to take IFFT by (Nifft-Nfft) sample zero-padding
Filtered_CGI=[f_CGI(1:Nfft/2) zeros(1,Nifft-Nfft) f_CGI(Nfft/2+1:Nfft)];
Filtered_CGQ=[f_CGQ(1:Nfft/2) zeros(1,Nifft-Nfft) f_CGQ(Nfft/2+1:Nfft)];
hI = ifft(Filtered_CGI); hQ= ifft(Filtered_CGQ);
% Take the magnitude squared of the I and Q components and add them
rayEnvelope = sqrt(abs(hI).^2 + abs(hQ).^2);
% Compute the root mean squared value and normalize the envelope
rayRMS = sqrt(mean(rayEnvelope(1:N).*rayEnvelope(1:N)));
h = complex(real(hI(1:N)),-real(hQ(1:N)))/rayRMS;

I have noticed that this implementation multiplies the noise with a square root of the filter response in the frequency domain, why did the writer use the square root of the doppler spectrum ?

A similar representation is also present here.

EDIT:
Another thing, the text doesn't mention the $-\pi/2$ phase shift nor does it implement it in the code. Why is that ?
Is that just multiplication by -j ? If so, why negative ?


texts: Different number of modes while performing the EEMD (Ensembled Empirical Mode Decomposition)

texts:
I am performing an Ensemble Empirical Mode Decomposition (EEMD).
I wrote a MATLAB routine to perform the EMD. I noticed that when adding white Gaussian noise to the input signal, sometimes I obtain a different number of modes, even if the noise variance is not so high. Clearly, if this happens, I cannot sum compute consistent ensemble-averages for each mode.
Do you think this depends more on the nature of the input signal or on my EMD algorithm/routine?


texts: RIPless Compressive Sensing - Proof of Incoherence Sampling Theorem

texts:
It is the first time I'm facing this topic. In particular, I'm studying the RIPless framework of compressive sensing presented by Emmanuel J. Candès  and Yaniv Plan in the article https://arxiv.org/pdf/1011.3854.pdf . The general idea is clear to me, but I cannot prove the Incoherence Sampling Theorem with general sampling distribution. The Incoherence Sampling Theorem is the theorem 1.1 in the linked article (available also in the attached image). Can you help me setting up the theorem's proof please?
Best regards,
aleand


texts:
I have created an IIR design algorithm that generates complex coefficients (there is no symmetry in the poles and zeros). However, the IIRs will be used to filter a real signal. Is there a closed form (analytical) way to convert the IIR to real coefficients. I did think that using the output of the difference equation to solve a system of linear equations might be a known solution?

Another way to put the question: when both complex and real IIRs are acting as a digital filter processing discrete samples, for a given real input they produce the same real output (discarding the imaginary component).

Another way to put the question: Both the complex and real IIRs have the same magnitude response.


texts:
I'm just starting estimation theory for my DSP course and I'm a bit confused about the classic example given everywhere which aims to show that two unbiased estimators can have different variances.

I'm just wondering how they did that step that I have a question mark beside. I understand intuiviely that the average of x[n] will be A but I can't mathematically figure that out with the E[] and also what happens to 1/N. If someone could just explain that step in detail.

Another Question: What's the difference between A(hat) and E[A(hat)], I mean shouldn't A(hat) give you A anyways? Then what's the point of the E[A(hat)]?


texts:
Currently I am using $(128, 64)$ LDPC codes to error correct messages wirelessly sent in Arduino using the SoftwareSerial library. I was advised to use a lower-rate LDPC code and see if that improves my error rate.

What exactly does a lower-rate mean?
Does it mean less parity bits or less data bits?
For instance, would a lower rate be $(128, 96)$ or $(128, 32)$?
Also, would using a lower-rate LDPC code combat well against deletions in the channel or just misread bits?


texts: Acquisition of vibration signal and processing help

texts:
so I've been working on a side project for some time now.

I have rotating shaft that's starting from 15k and goes up to 150k RPM(250-2500Hz), I have the vibration signal of the shaft from transducer and also I have pulse when the shaft completes each rotation (so I can calculate the RPM).

I've been searching the internet for quite some time now reading a lot of theory about dsp and order tracking in general but I simply cannot make it work.

So my questions is, what approach would you use to extract useful information and plot it on a graph using Vibration vs RPM?

(I've been reading something about sampling the vibration signal according to the rotation pulse but I'm just confused is once per revolution enough for the vibration signal, also whats after I have vibration signal and rpm signal)

I will do all the research myself, but i need some help starting out. I would be really happy if someone can write down some general steps I can follow.


texts:
I want to design a receiver for a spread spectrum system. I know that two Pseudo sequence with two different length must be used in the receiver, but I can' t manage this with common receivers(such as integrate and dump and so on...) , can this be done?
Regards.


texts:
Regarding white (uncorrelated) and coloured (correlated) timing jitter.
I know that for free-running oscillators (such as VCOs), various kinds of noise causes the jitter, for example (1/f) coloured noise and white noise...As a result, the jitter is expected to be coloured in oscillators because the phase noise power spectral density will have regions of (1/f^3) and (1/f^2) due to (1/f) and white noise respectively.
However, I am wondering if the timing jitter at the output of PLL is white or coloured?
From one perspective, I can say that PLL acts as a lowpass filter, so it filters out the jitter, as a result: the white jitter becomes coloured. Therefore, we always expect to see coloured timing jitter at the output of PLL.
From another perspective, I can say that PLL is intended to reduce the jitter, so we end up with white timing jitter due to white noise (which is always there). Therefore we expect to see white timing jitter at the output of PLL.
Could you please help me to know if the jitter at the output of PLL is white or coloured?
thanks


texts: impulse response of a system from its step response;confusion


texts: Low pass to low pass transformation coefficient?

texts:
I am unable to solve this question, 10.10 from GATE IN 2004 (a previous year question paper for an exam targeted at engineering graduates in India.)

So I tried to solve the 10.10 by considering the real frequency shift transformation's general form,

I am not getting any answer close to the options! I wonder what I am doing wrong.

So 1) what is the answer to the question 10.10 shown above?

2) how is this formula for the coefficient derived?


texts:
When I try to calculate the $\mathcal{Z}$-transform of  $4\delta[n-8]\delta[n-8]$, I put the statement into the formula of $\mathcal{Z}$-transform from $-\infty$ to $+\infty$, and I get the result $4z^{-16}$, but I can't be sure about it.

I think that the ROC changes when I square the $\delta[n-8]$ location on the number chart. What is the ROC?


texts: Proof of First Difference Property for Fourier Series

texts:
I am having trouble with deriving a proof for the first difference property for the  Fourier Series.

Here is my attempt at the derivation:

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

Fourier Series Representation:

$$
a_k - a_ke^{-jk\omega_0}
$$

Fourier Series:

$$
y[n] = \sum_{k=<N>}(a_k-a_ke^{-jk\omega_0})e^{jk\omega_0n}
$$

I have set up the summation for the Fourier Series, however I have been having difficulty to compute the summation.

The summation should equal this:

$$
a_k(1-e^{-jk\omega_0})
$$

How would I evaluate the summation?


texts: Finding length of period in time domain data

texts:
I have a series of measurements of a signal source, which emits a periodic signal at an unknown interval time of p seconds. Detecting the signal is not easy so I am missing quite a few signals in the data. Data is also noisy so there are errors in the data of up to +/- 10% per signal.

Example measurements x might look like this:

72.3, 185.1, 364.2, 570.2, 679.2, 1060.7

The result I am looking for, is the period hidden in the measurments, p = ~100 in this example case and possibly the best offset c = ~70.

Typically I have 4-7 measurements in a series I would like to analyse, so it seems an analytic answer is more appropriate than a sound analysis (FFT).

Ideas I have considered:

Non-linear optimization such that we optimize for x = n * p + c. Levenberg-Marquart should do the trick.
Building a histogram of difference between consecutive measurements and picking the average of the fullest bin.
Floating point GCD https://stackoverflow.com/questions/445113/approximate-greatest-common-divisor

But I am very unsure whether I might have missed an obvious solution from the sound analysis camp (autocorrelation, Harmonic Spectrum Product, DFT, e.g. https://stackoverflow.com/questions/4716620/algorithm-to-determine-fundamental-frequency-from-potential-harmonics).

So I am turning to the wisdom of SO. How would you go about solving this problem most elegantly? Library suggestions are fine (C++).


texts: Temporal window $\{v(t)\}$ of Welch estimator

texts:
The Welch estimate [1] of PSD (power spectral density) is determined as:
$$\hat{\phi}_W(\omega)=\frac{1}{S}\sum_{j=1}^S \hat{\phi}_j(\omega)$$
where
$$\hat{\phi}_j(\omega)=\frac{1}{MP}\left|\sum_{t=1}^M v(t) y_j(t) e^{-i\omega t}\right|^2$$
is a 'windowed periodogram' corresponding to $y_j(t)$ and
$$P=\frac{1}{M} \sum_{t=1}^M |v(t)|^2$$
denotes the 'power' of the temporal window $\{v(t)\}$.

What is, for the Welch estimator, a common choice of temporal window $\{v(t)\}$?

[1] Welch, Peter D. "The use of fast Fourier transform for the estimation of power spectra: A method based on time averaging over short, modiﬁed periodograms." IEEE Transactions on audio and electroacoustics 15.2 (1967): 70-73.


texts: How is it possible to find the Fourier transform of unit impulse function?

texts:
Since Fourier transforms are applicable to only periodic functions, and unit impulse function{..0,0,1,0,0..} doesn't seem periodic, is this possible?

Is it like we are considering unit impulse function to be periodic in the range $(-\infty,+\infty)$?


texts: How to convert floating point code to fixed point?

texts:
I am working on converting a floating point MATLAB code into fixed point C code. The code is to be run on a DSP platform, the specifics of which are yet to be decided.

I'm new to floating point to fixed point conversion and am facing quite a few challenges.

My questions are:

What is the best way for me to start and where should I start, because the topic is quite confusing.
My MATLAB code is basic filtering code; there's FFT, windowing followed by IFFT. Windowing seems simple enough as its multiplication, but I'm totally lost when it comes to FFT and IFFT.

Thanks!


texts: What exactly is a connected componnent in an image?

texts:
The following is a paragraph from "Digital image processing, 4th edition, Gonzalez and Woods".

Let S represent a subset of pixels in an image. Two pixels p and q are said to be
connected in S if there exists a path between them consisting entirely of pixels in S.
For any pixel p in S, the set of pixels that are connected to it in S is called a connected
component of S. If it only has one component, and that component is connected,
then S is called a connected set.

I do not understand the last sentence: How can S have one component and that component is not connected??
Another question: In a binary image, can S be a connected component and have both 0 and 1 pixels?
By the way, the concept of component is not define precisely in the book.
Update:
In the book, a region is defined as a connected set. The following figure is an example of two adjacent regions (So, $R_i$ and $R_j$ are both connected sets.)

Thanks.


texts: Continuous phase for phase delay calculus in FIR filters

texts:
I would like to estimate the phase delay accurately for any random FIR filter.

The definition of the phase delay is the continuous phase divided by the angular frequency (with a sign change). That means that you can't simply use the wrapped phase, between $-\pi$ and $+\pi$ you can get with a FFT to obtain the phase delay estimation. At least, you need to use an unwrapped version of the phase.

For example, with a linear phase FIR filter, the phase delay is supposed to be a constant, so the phase you have to use to do the calculus has to be monophonic and decreasing.

However, by doing some tests in MATLAB, I have been able to see that the unwrapped phase doesn't have this property everywhere. For a halfband lowpass filter for example, there are a few "jumps" in the stopband with a length not related with $\pi$, so they are untouched in the unwrapped phase, which gives me a wrong estimation of the phase delay, featuring jumps as well instead of a constant value.

Indeed, the "continuous phase" I need isn't the same thing than the unwrapped phase, and is associated with the zero-phase amplitude of the FIR filter. I have not found yet a way to get it, and MATLAB with its zerophase function is giving wrong results as well, because it cheats ! If the filter is linear phase, it uses the formula we all know for the phase delay. If it is a FIR linear phase transformed into a minimum-phase filter for example, then the phase delay displayed features again this low size jumps.

I'm thinking about doing something like detecting the jump length, assuming the phase is supposed to be smooth everywhere, and using the derivative at the sample before the jump to do something which might look good...

But I would like to know if someone knows a rigorous way to get the continuous phase.

EDIT : here is an example. You can find there the phase for a FIR linear phase filter, wrapped and unwrapped. As you can see on the unwrapped, some phase jumps are still here...

EDIT 2 : my problem can be redefined this way. Most of the time, any FIR filter can be studied with its frequency response H($\omega$) = |H($\omega$)| $e^{j \phi( \omega)}$ with |H($\omega$)| the magnitude, always positive or zero, and $\phi(\omega)$ the wrapped phase.

There is an alternative notation : H($\omega$) = A($\omega$) $e^{j \theta( \omega)}$ with A($\omega$) the amplitude or zero-phase amplitude and $\theta( \omega)$ the continuous phase representation, still between -$\pi$ and $\pi$. Apparently, it features only 2$\pi$ jumps, and can be fully continuous with a standard unwrap algorithm. That's because A($\omega$) can be positive or negative. Each time there is a zero in the FIR filter, A($\omega$) changes its sign. That's the zeroes which are causing the lowest jumps. Since A($\omega$) contains the sign information, the low jumps are no more present in the new phase representation $\theta( \omega)$.

So, what I need now, is in fact a way to calculate accurately $\theta( \omega)$, maybe by calculating first A($\omega$). I might detect the low jumps easily and change the sign of |H($\omega$)|, then use it to get the remaining $e^{j \phi( \omega)}$. But there is maybe a better way of doing this, and I'd like to know if someone familiar with this notation has already done that.


texts: CT corrupted by Poisson noise, weighted least squares, how to calculate in detail

texts:
I've trained a convolutional neural network to recognize ellipses. I took random generated ellipses as ground truth images and applied radon and inverse radon transform for the noisy images.

Now I want to add Poisson noise to the sinogram before applying the inverse radon transform.
For the reconstruction, the paper I'm following suggests to replace the data-fidelity term in

${min}_x \frac{1}{2} || Hx-y||^2_2$

with weighted least squares. (Here, x is the input image and y is what we are measuring).

It goes on with: "Let $\mu$ represent the distribution of linear attenuation coefficient of an object and $[A \mu]_m$ represents their line integral. The mth CT measurement, $y_m$ is a Poisson random variable with parameters

$ p_m \sim Poisson( b_m e^{-[A \mu]_m} +r_m)$

$ y_m = -log(\frac{p_m}{b_m})$

where $b_m$ is the blank scan factor and $r_m$ is the readout noise."

The paper then suggests to use these $p_m$ to build a diagonal weight matrix $W$ to get

${min}_x \frac{1}{2} || W^{1/2}Hx-W^{1/2}y||^2_2$.

But what exactly is $[A \mu]_m$? Where do I get $A$ and $\mu$?
In a linked paper, it says

$[A \mu]_m=\sum_{j=1}^J a_{mj} \mu_j, m=1, \dots , M$, where $A=\{a_{ij}\}$ is the system matrix and M and J is the the number of projections and pixels.

But again, what exactly is the system Matrix $A$, where can I find it?

Here are the papers I'm referring to: number 1 (page 12 (1451), part B) and number 2 (page 3 (259), part B).

Any help is highly appreciated, thank you very much.

Edit:

Thanks to @A_A, I now have an idea of how $A$ looks like. But I still don't really know how to calcalute $p_m$. Would it be possible to get $p_m$ from $y_m=−log(\frac{p_m}{b_m})$, that means $p_m=b_m e^{−y_m}$? But how exactly would I determine $y_m$; let's say my image $x$ is from $\mathbb{R}^{512×512}$ and performing a radon tranformation gives me a sinogram $Hx \in \mathbb{R}^{512×32}$. Then $W \in \mathbb{R}^{512×512}$ and there are $512$ values of $p_m$. How would I go on from there? And what should I choose for the blank scan factor?

Thank you very much.


texts:
I went through this material on Sampling theorem. http://www.wescottdesign.com/articles/Sampling/sampling.html

It uses a powerline signal example and concludes that if a signal is cyclic and repeating over a period N then you could sample the signal at lesser than N samples per second.In the example he shows for a 60Hz power signal he can sample and recover the signal by sampling at 19 Hz. He uses an expression

Ts = (M + P/N )*1/F where M>0 and N>0 where p is not equal to 0. I haven't understood it. Can anybody here tell me how it is done.


texts: How to determine the window size and weights in Weighted Moving Average (WMA), given desired cut-off frequency?

texts:
I am trying to smooth my discrete-time data points using the method of WMA.

Currently, I am using n as the window size and the weight array, {n/(n(n+1)/2), (n-1)/(n(n+1)/2), ... , 1/(n(n+1)/2)}.

If the y-value of each point is irrelevant, I can just simply randomly choose my size n.

However in my case, I hope to reserve the original values of the data points to the best extent. Thus, I cannot choose a big window that averages everything to flat.

My cut-off freq. is 3Hz and the sampling rate is 50Hz.

How may I choose the size of the window n?

Thanks in advance!


texts: I'm just curious if this could be a way of transmitting stereo?


texts: What is the advantage of weighted median filter over median filter?

texts:
I could not find any proof or comparison of weighted median and median filters. Yes the more occurring pixel contributes much but what should be the criteria of choosing weight function. And any explanation of cases where weighted median is strongly recommended to be used.

Median Filter replaces pixel value c with p where p is the median of pixel values in neighborhood of c

In the case of weighted median there are N $\left[ I_1,I_2,..,I_N \right]$ neighbor pixels,for each pixel there is also weight. Weighted median of that neighborhood is $k^{th}$ pixel  where $k$ is the minimum integer with $\sum\limits_{i=1}^k w_{i}\geq\frac{1}{2}\sum\limits_{i=1}^N w_{i}$


texts: Generation of noise floor file for estimating signal-to-noise ratio of a wave file

texts:
I am trying to estimate the signal-to-noise ratio of a wave file (The wave file is a recording of a conversation in a room). I found examples where the Matlab scripts compare the wave file data to a noisy wave file. This noisy wave file is generated by either mixing Gaussian noise into the actual recording or they have mixed other sounds into the wave file and estimate the SNR.

How do I determine the noise floor for calculating SNR of a wave file? The reason for estimating the SNR of the recorded wave files is to determine if the speech content recorded in the file is useful or rendered by useless due to noise in the background.


texts: I have an image source emitting yellow light. Of course, when taking a picture with the light, the image has yellowness overall. How can I remove that color of light from the image? I have another picture of only background with the yellow light. Is there any way to subtract the image from the former one? Thanks


texts: Calculating the inverse filter for the (exponential) sine sweep Method

texts:
I am currently working on my Bachelor-Thesis about Real-Time convolution and Impulse Response Measurements. After reading different papers about the (exponential)sine sweep method I didn't find an answer on how to calculate the inverse filter for deconvolving the impulse response.

In the papers I read, it is described as the Time Reversal Mirror and after that some kind of scaling.

Could someone explain, how to calculate the inverse filter for a given sine sweep?
If you could add an example, or an algorithm it would be appreciated


texts: Blocking out Periodic Background Motion for Background Subtraction

texts:
I have a motion detection project that relies on background subtraction.
I have noticed some frequent movements on a specific point which been found as an air conditioner blades. Away from manual removal of this spot, am thinking of a signal processing way to ignore such a frequent movement that occurs every fixed while.


texts: What is the instantaneous frequency of this signal

texts:
Suppose we have the signal

$x(t) = \cos(\pi t) + \cos(\pi t^2) +  \cos(\pi \cos(\pi t))$

How can I find the formula which gives the instantaneous frequency $f(t)$?


texts:
Hello, this is my first time actually asking in stackexchange. I am a computer engineering student and currently i am doing a linear system course (i don't really know how this is equivalent in engineering course labeling as my major is apparently in faculty of computer science but it's related a bit toward signal processing), i hope i wasn't in the wrong category

So I was to find the fourier transformation of the graph in the picture, and i need to plot the graph in matlab as well. I was allowed to look into the table but I couldn't find it hence I used brute force(integrals) to find the $X(\omega)$ of the signal, which i ended up finding but still there's $e^{-\omega.j}$ stuck which confuses me as i believe the plot should be 2 dimensional only (toward x and $\omega$, not toward j). can somebody help finding any faults/things i missed here?


texts: Using under-sampled data, what determinations can be made about the Nyquist rate (correct sampling rate)? If my instrumentation limits me to sampling data at a fixed but insufficient rate what, if anything, can be determined from that data about the sampling rate that would be required to properly represent the signal? Are there signal analysis techniques that would provide any indicators?


texts: Two basic questions related to complex Fourier series

texts:
Doing excersies from Richard Hammings book about digital filters I've got two questions about them:

1) Fourier expansion of $g(x) = \sin^5(x)$. Provided answer is: $\sin^5(x)=5\sin(x)-20 \sin(3 x)+16\sin(5 x)$. Which is obviously contradicts well-known solution. Is it mistake in a book or author meant something another?

2)The second excersice which confusing me is expansion in compex notation of $g(x) = \exp^ {\alpha x}$. I got the following form of coefficients: $c_{k} = {\frac {1} {(2\pi)}} (\exp^{\alpha\pi}  - \exp^{-\alpha\pi}){\frac {(-1)^k} {(\alpha-ik)}}$. These coefficients looks a little bit frightening to me and I don't know how to check them... Any ideas how to validate solution?

Thanks in advance!


texts: Finding the Wiener filter transfer function

texts:
I am trying to understand the mechanism of finding the transfer function for a Wiener function.

|Rxx(0)   Rxx(-1) ...... Rxx(1-N)| | h(0) |   | Ryx(0) |
|Rxx(1)   Rxx(0)  ...... Rxx(2-N)| | h(1) | = | Ryx(1) |
|......   ......  ......  ...... | | .....|   |....... |
|Rxx(N-1) Rxx(N-2) ...... Rxx(0) | |h(N-1)|   |Ryx(N-1)|

Rxx is the autocorrelation of my input signal h is filter transfer function and Ryx is crosscorrelation of the input and output signal. My question is how to come up with the h. I mean i have two unknowns in this equation cause i dont know h and I dont know the y output signal therefore i cant calculate the crosscorelation Ryx.

Is there something that I need to assume in order to get the h??

Thanks in advance for the help.


texts: Image thresholding while retaining "underneath" contents

texts:
I have sample images, and I need to extract certain features that depend on color. Images are more like line art, contours, and consist of various line forms, and several colors.

I can extract specific features through thresholding, but if lines intersect I always get discontinuities (holes) that are not acceptable. As example I prepared this:

I have image with two "lines":

I'll threshold to remove black, but underneath line (which of course doesn't exist as information in bitmap representation) gets discontinued:

while I want it like this:

which I'll later equalize, and get wanted context.

I used image processing program, and would appreciate some tip how to do this in Gimp or Photoshop, but any answer is welcomed like Python/ndimage, Matlab/Octave...


texts:
I want to make a 2D gaussian Blur coeffients.
Now I am making 1D gaussian Blur term as following.

double Cmfc_test5Dlg::Guassian(int x, double sigma)
{
        double c = 2.0 * sigma * sigma;
        return exp(-x * x / c) / sqrt(c * 3.141592f);
}
double Cmfc_test5Dlg::GuassianTerms(int kernalSize, double sigma, int *terms)
{
        for (int i = 0; i < kernalSize; ++i) {
                terms[i] = Guassian(i - kernalSize / 2, sigma)*1024;
        }
        return 1;
}

But I want to make 2D instead of 1D. What should I do ?


texts: Why discrete cosine transform may not maintain locality

texts:
In paper Convolutional neural network for speech recognition, they say

I didn't understand the highlighted sentence.


texts:
I consider a signal of length $N = 2^n$ for some $n$. I want to derive two signal from it, one containing only the odd frequencies and one only the even frequencies. Each of these signals have length $N/2$.

I use this code in MATLAB:

n = 3;
N = 2^n;

signal = ifft( rand(1,N) );

for i = 1:length(signal)/2
    sig1(i) = (signal(i) + signal(i+N/2)) ;
    sig2(i) = (signal(i) - signal(i+N/2)) ;
end

stem(0:N-1,  abs(fft(signal)),'k');
hold on
stem(0:2:N-1, abs(fft(sig1)), 'b*');
hold on;
stem(1:2:N-1, abs(fft(sig2)),'rs');

What I should get are two signals, each one of length $N/2$. One containing only the even frequencies and the other one only the odd ones. The way I proceed can be seen either as the first step of the butterfly algorithm in the FFT, or, by using a FIR filter approach, by applying two different filters to my original signal.

However, the signal containing the odd frequencies is always off and when I compare the FFTs they do not match. Why? What is the explanation? I am a bit puzzled by this result.


texts: How to smooth (or interpolate) phase of FFT and reduce data points

texts:
I am writing some code for audio analysis, and have currently got two signals with FFT performed on them.
I get the phase of my complex array by using:

ang = Math.atan(complex.im/complex.re)*180.0/Math.PI;

I then 'format' for wrapped phase:

if(complex.re < 0.0 && complex.im == 0.0){ang = 180.0;}
            else if(complex.re < 0.0 && complex.im == -0.0){
                ang = -180.0;}
            else if(complex.re < 0.0 && complex.im > 0.0){
                ang += 180.0;}
            else if(complex.re < 0.0 && complex.im < 0.0){
                ang += -180.0;}
            phase.add(ang);
        }

As I have converted this to degrees already, I then subtract channel 1 phase from channel 2 phase to give me the phase difference:

double phaseDiff = (((double)chan1phase.get(i)) - ((double)chan2phase.get(i)));

Finally, I add a method for keeping wrapped phase whilst subtracting the two phases:

if (phaseDiff < -180){
            phaseDiff += 360;
        }
        if (phaseDiff > 180){
            phaseDiff -= 360;
        }

This works really well currently,  however there are too many data points for my application to respond quickly. I am working with 16k or 32k FFT size, and that's a lot of data to plot and redraw quickly when I manipulate my data. I also occasionally get one or two data points throughout the whole plot which are noisy or differ from the expected path of travel, which I would like to get rid off.

I have already used a smoothing function to display my magnitude vs frequency, and this responds really quickly.  However I am not confused on how best to smooth phase.  I need to reduce the data points to approximately 1000 points over the audible frequency range (20Hz - 20kHz).

However I cannot just use the same method as I used for magnitude because of the wrapped phase.  Would I need to average the data points within an octave (or preset band) prior to wrapping the phase?

Or am I better disregarding some points and interpolating the data?

Any guidance would be appreciated. Apologies if there is too much actual code here, I realise this is a DSP site and not programming site, but thought it useful to see exactly what I am doing (or where I have gone wrong!).


texts: What is the region in the middle of expected input range that is considered indeterminate called?

texts:
In using something like voltage levels to encode a binary signal, there's a region between the two states of the line that is considered unclear and belongs to neither state.
Example:

From 0v to 2v represents State A.
From 2v to 3v is unknown/no change.
From 3v to 5v represents State B.


texts: Why is the lowpass-filter coming right after the local oscillator when mixing an RF?

texts:
In the book, instead of having a band- or lowpass-filter before mixing, it's coming right after mixing, which makes sense, considering there's gonna be a high-frequency component, which has to be filtered out.

But the lowpass-filter is called RF Image Rejection Filter, which irritates me, since that would be a band-pass instead and not something done after, but before mixing.

Curiously, afterwards there's an IF Band Selection Filter, which is meant to filter images?


texts: Carrier frequency offset estimation for QPSK and asymmetrical spectrum

texts:
I am working on estimation of carrier frequency offset for QPSK data from a satellite. From my understanding, there are two main approaches: either remove data from the carrier (by taking the fourth power), or with band-edge filtering, or some other method of measuring difference of energy content in positive and negative parts of the spectrum.

In my particular case I have the signal converted to base-band (and with some offset). I'm now trying to estimate that offset. I can correctly estimate offset by taking the fourth power of the signal, and then running an FFT on that signal. However, I'm struggling with band-edge filtering, and it seems that the issue is not my implementation of the filter, but rather, the signal itself. While the algorithm works like charm on synthetic QPSK data, when I run it on some real satellite data, it is not able to compensate for frequency offset. I tried to find the cause of this behavior, and I was able to find that the signal spectrum is asymmetrical, and negative frequency content is having more energy than positive, as shown in the figure below (figure shows FFT of signal with frequency offset removed). What I do not understand why there is such a difference in the energy in the positive and negative parts of the spectrum, and I would appreciate if somebody could provide me some insight into this.


texts: Why must the order of a Band-Pass and Notch filter always be even?

texts:
My professor mentioned that the order of a band-pass and a notch filter must always be even, when showing an example of designing a digital filter using the bilinear transformation.
Then he also mentions that the MATLAB code ellipord returns half the actual order, so I figured the two statements must be connected somehow. I can't ask him since it's currently 3 AM and I couldn't find anything alone as to why these two statements are true.
Any thoughts? Thank you!


texts: Measuring the open loop transfer function in closed loop: what's the better approach?

texts:
Considering the closed loop system; $C$,$G$, and $H$ all linear and stable transfer functions,

If I chose to excite $\bf r$ and measure $\bf e$, I get the Sensitivity Function, $S$
$$S=\frac{1}{1+CGH}$$
If I however excite $\bf r$ and measure $\bf y$, I get the Complimentary Sensitivity Function, $T$

$$T=\frac{CGH}{1+CGH}$$

If $G$ or $C$ contains integrators then $S$ tends to be high pass and $T$ low pass.

So my question: In terms of signal to noise ratio on $\bf r$ and $\bf y$, what is the better choice in determining $G$ from the closed loop measurements?

$$G=\frac{1-S}{SCH} \quad \text{or}\quad G=\frac{T}{(1-T)CH}$$

It seems in one situation information is attenuated at low frequency and in another at high frequency. So for practical purposes would one method have advantage over another depending on whether noise dominates the input or output signals measured?


texts: What is the delta parameter in $\tt scal2freq$?

texts:
I am running complex morlet (cmor1-1.5) wavelet transform. I want to have the transformation for the range of $[1,150]\textrm{ Hz}$ with a step of $1\textrm{ Hz}$.
I want to use scal2freq Matlab function to convert scales to pseudo frequencies but I don`'t know how to define the delta.


texts: Represent DFT coefficients with respect to Continuous time-Fourier series coefficients

texts:
Does anyone know how to represent the Discrete Fourier transform (DFT) coefficient, $X[k]$, with respect to the Continuous time-Fourier series (CT-FT) coefficient, $X_k$? I come to the conclusion as $X[k] = NX_k$. $\\\\$
As we know Fourier series is for a periodic signal. So DFT coefficient is just a sampled version of the Fourier series coefficient. Let $P$ be the period of CT signal $x(t)$, and $N$ be the sampled period of $x[n]$. We sampled $x(t)$ by $T=P/N$ as sample period. From $$x[n] = x(nP/N)\\=\sum_{k=-inf}^{inf}X_k e^{2\pi*k/P*(nP/N)}\\ =\sum_{k=-inf}^{inf}X_k e^{2\pi*kn/N}$$
Since for DFT, $$x[n] =1/N\sum_{k=-0}^{N-1}X[k] e^{2\pi*kn/N}$$, we can say that $X[k]=NX_k$ for $k=0,1,...,N-1$? $$\\\\$$Is my interpretation correct?


texts:
please can someone help me to define a method that allows me to estimate the power of noise in any signal?
the signal is received by usrp and the problem that it is variable all the time in the FM band so the noise is variable also with frequency and time

thanks in advance for any help


texts: How to use FIR with Kaiser windows for 2D image

texts:
I am trying to use FIR filter (opensource codes from iowa hills software) as low pass filter, kaiser window, to filter 2D image.

Does someone can guide me that how can I do that? I am able to obtain FIRCoeff() as filter coefficients. Not sure how to use it on a 2D image.

My goal is to filter high-frequency noise in my 2D image.

Thanks.


texts: Duration of unknown rectangular pulse with additive white Gaussian noise

texts:
Problem.

There is a discrete signal $f[i]$ (example below).

It is known, that $f[i]$ have a form of rectangular pulse with additive white Gaussian noise.

$f[i] = s[i] + n[i]$,
$s[i] = \alpha(\theta[i - i_{1}] - \theta[i - i_{2}]) + c$,
$i_{2} > i_{1}$,
$i_{1} > N$

Where
$\theta[i]$ is a Heaviside step function,
$n[i]$ is an additive white Gaussian noise,
$\alpha$ is a height of rectangular pulse,
$i_{1}$ is an index of the first sample of rectangular pulse,
$i_{2}$ is an index of the last sample of rectangular pulse,
$c$ is constant level of signal,
$N$ is adjustable parameter.

All parameters may have large range of values.
It is required to find value of $(i_{2} - i_{1})$ (duration of rectangular pulse in samples).

Possible solutions.

At the moment, I have tried two ways to solve this problem.

Low pass filter with threshold.

As first attempt, I have used simple scheme with low pass filter and threshold.
1. Apply FIR low pass filter with cutoff frequency equal to $0.05f_{sampling}$.
2. Estimate mean $m$ and dispersion $\sigma^{2}$ of filtered noise from first $N$ samples of the signal.
3. Set threshold $t = m + 3\sigma$.
4. Estimate $i_{1} = \min_{i}(f[i] > t)$.
5. Estimate $i_{2} = \max_{i}(f[i] > t)$.

Pros:
1. This algorithm is simple.
2. It is easy to write fast implementation.

Cons:
1. It is hard to estimate efficient value of filter's cutoff frequency. On the one hand low value can corrupt the form of short pulses. On the other hand large value decreases effect from filtration.
2. Algorithm isn't using all information, we have about the signal.

Regression analysis

As the second attempt, I have tried to approximate input sequence of samples with the function $s'[i]$.

$s'[i] = \alpha(\theta'[i - i_{1}] - \theta'[i - i_{2}]) + c$,
$\theta'[i] = \frac{1}{1+e^{-\frac{i}{\beta}}}$, where $\beta$ is a small parameter.

For approximation I have used the method of least squares with gradient descent for minimizing cost function.
1. Set initial values for $\alpha$, $c$, $i_{1}$, $i_{2}$.
2. Perform gradient descent.
3. Set threshold $t = c + 0.5\alpha$.
4. Estimate $i_{1} = \min_{i}(f[i] > t)$.
5. Estimate $i_{2} = \max_{i}(f[i] > t)$.

Pros:
1. This algorithm gives results with good precision.
2. It works for wide range of durations.

Cons:
1. It is very slow.

Question.

After all, I am not satisfied with the precision of the first algorithm and with the speed of the second one.
How would you solve this problem?
Is there any classical solution, that I failed to find?
Ideas, links, any feedback will be much appreciated.
Thank you.


texts: Why does the unit step function not have infinite poles?

texts:
Let's say I have a transfer function which is a unit step function.

$H(s) = \int_{0}^{∞}e^{-st}dt$

But when we write,

$H(s) = 1/s$ it is only true when $Re(s) > 0$

So after we derive the Laplace Transform for the unit step, we forget all about how we derived it and how $H(s) = \infty$ for all $Re(s) \leq 0$

What makes the pole $s=0$ so special. It does not lie in the ROC like every other point in the left half plane, so why is it the only pole for our system?

Shouldn't the system have infinite poles then on the left half of the s-plane? I guess the more generalized question would be isn't every point outside the ROC of a transfer function its pole?

EDIT:

If you can accept that the above proposition is TRUE then consider the following contradiction.

Consider a simple RC filter whose transfer function is

$H(s) = \frac{1}{s+1}$

This system is said to have 1 pole at $s=-1$

Applying the inverse Laplace transform, we now the corresponding time domain function

$h(t) =  \exp(-t)$

But we know that Laplace Transforms for exponential such as $\exp(at)$ is only defined when $s>a$

In our case the Laplace transform could only be defined for $s>-1$. Therefore, to say that there is only one pole at $S=-1$ would be incorrect as everything to the left of $s=-1$, including the line at $Re(s)=1$ would also be undefined and out of the ROC.

So the question again becomes why do we, when solving such systems only consider them to have ONLY one pole at $s=-a$?

Is that not an incomplete answer?


texts: What is the difference between a sampled time system and a discrete time system?

texts:
I am trying to evaluate whether I should control a system in simulink using sampled data system or discrete time system.

The discrete model is as follows:

The sampled time system is as follows

What is the functional difference between these two and which approach is preferred in realistic modelling and control?


texts: Output of encoder RS-code: analyze the results

texts:
I found some simulation results of RS-encoder. In the description are written the following:

“When the program implementation is run, the clock is set to high i.e.
‘1 ’ and reset is set to low i.e. ‘ 0 ’ and then when the circuit is
run for several clock cycles for about 10000ns . The program always
begins at the positive edge of the clock. It is checking the generator
polynomial and the place where generator polynomial has coefficient is
‘1’ and rest are ‘ 0 ’ in the 8 bits polynomial. For loop is used
for 254 times and a table is created which gives 0 - 255 decimal and
its equivalent binary”

[from pdf p 51 ] It is an mplementation of (255,245) Reed-Solomon Code.
My question are how to read the such results of simulation the RS encoder and could someone explain to me the picture below?


texts: What methods can be used to identify and remove echo from an audio system?

texts:
Background

I am designing a system that will have a single small microphone and speakers for use in a phone type setting. Easiest example I can give is a Skype conversation where you are using your computers speakers and a desktop microphone.

I am worried about the audio from the speakers getting picked up by the microphone and sent back to the original person. I used to hear this happen all the time in the early days of VoIP conversations, but hardly hear it any more.

My assumption is that groups have come up with ways to cancel out the echo, but how do they do it?

Approaches

My first thought was to just simply subtract the signal being sent to the speakers from the microphone signal, except with this method you have to be concerned with the delay. I am not sure how to determine what the delay is with out some sort of pre-calibration, which I would like to avoid. There is also the issue of how much to scale the signal by before subtracting it.

I next thought about doing some sort of correlation between the speaker signal and the mic signal in order to determine the likelihood of the mic signal being an echo as well as being able to determine the actual delay. This method was able to work alright when I was playing with some recorded signals, but there seemed to be far to large of latency in computing the correlation to be useful in real-time system. Also the adjustable volume on the speakers made it difficult to determine if something was actually correlated or not.

My next thought that there must be someone on the internet who has done this before with success, but didn't find any great examples. So I come here to see what methods can be used to solve this type of issue.


texts:
I have just recently started doing fourier transforms and I'm a little confused.

Can someone walk me through in detail how to calculate the Fourier transform of

I'm not looking for answer, just an explanation of how to go about doing it.


texts: Pitch perception - Why does our ear not directly detect the missing fundamental frequency?

texts:
My motivation for this question is related to biological phenomenon of our inner ear, so I initially posted in the biology community, but I suspect the answer has a DSP explanation, so I figured this might be a better place to get an answer.

I'm learning about pitch perception in an Intro to Music class right now, and learned about the case of the missing fundamental.

In the main image in that wikipedia page, it seems like in the bottom graph, with the fundamental frequency and its second harmonic removed, the wave is still very periodic at 100 Hz.  Since the Organ of Corti has some area which should be excited when there's a sound wave of frequency 100 Hz, why does this soundwave, which seems periodic at 100 Hz, not directly excite that region of the organ?

(like, won't there be high air pressure every 0.01 seconds, which will sway that organ in some direction, and thus excite that region which is "resonant" for sounds at that frequency?)

Maybe another way to phrase the question: why does the top signal have a signal with frequency of 100, but the bottom signal does not have a part with frequency 100?  It seems to me that the bottom signal also has a part with frequency of 100 Hz.


texts:
I am trying to filter crawled images with their image quality.
By 'high quality' I mean high resolution, not aesthetic score or perceptual score.

However I found that some images have very high pixel resolution (e.g. 4000px  * 4000px) but their actual quality look like (200*200) image is stretched by 20 times. I would like to measure the level of detail.

From wikipedia I learned spatial resolution is what I am looking for. Two images below are of the same size (the same number of pixels). But the description of spatial resolution sounds ambiguous:

  In effect, spatial resolution refers to the number of independent
  pixel values per unit length.

How do I measure the independence between pixels? What metrics exist?
I guess If I run 2D DFT and there is high value in high frequency region, then the image carries more details?  Are the images with salt-pepper noise considered to have low spatial-resolution?


texts: Examples of linear/logistic regression applications

texts:
I was wondering about super simple applications of linear or logistic regression to signal processing (image processing specifically)?

I'm a math guy that's been asked to explain some mathematical methods to signal/image processing people, and I'd like to be able to use a couple simple examples that are related to their field, but I know little about image processing. So, I'm not looking for anything complicated (I don't know the subject, so the simpler the better; I'm just hoping to find something to demonstrate the applicability of these algorithms).

Thank you for your help!


texts: Optimized 2D wavelet transform using FFT

texts:
I'm currenty aiming to optimize my fast wavelet transform (FWT) algorithm for 2D signals (images). It works as follows:

one iteration of 1D FWT does convolution of 1D input data with a selected 1D filter (lengths from 2 to approx. 60) and downsamples the result
algorithm for 2D transform does 1D FWT across all rows and then all columns of the input image
it iterates if more levels are desired

The transform is a part of interactive application that demonstrates wavelets and their use. It works fairly fast and usually responds in real time to user's interactions. But if the filter is very long some performance issues occur. I've read that using Fast Fourier Transorm (FFT) instead of convolution is effective for long enough filters.

I've already implemented the 1D FFT, but the question is how to use it for maximum efficiency? Should I transform the input data before single 1D FWT, then perform convolution (which corresponds to multiplication in frequency domain), and then transform the data back using inverse FFT? Also, how is the multiplication done exactly? For example, the input data of length 256 and filter of length 4 are both transformed using FFT and then only the first 4 values of input data are multiplied before transforming the data back? I'm struggling a little bit on the details and would very much appreciate any insight into this.

EDIT:
I've figured out that in my case I'm after circular convolution, therefore the filter should be zero padded so that its length is the same as length of the input data. But my question about efficiency still holds. How should I use FFT for FWT computation in order to be beneficial?


texts: Is u[-n] defined from negative infinity to zero as it is folding of u[n] or from negative infinity to -1?

texts: Folding of unit step function and definition of its boundaries.


texts: Why is a circular mask appropriate for Fourier filtering rectangular images?

texts: Suppose I apply 2D DFT to an image with dimensions $H{\times}W$ where $H \neq W$, then shift the DC component to the center. Why does a circular mask capture the lowest frequency components, i.e. why is it not an ellipse given that the image is rectangular? My concern is that for rectangular images, the K lowest frequencies might be arranged in a non-circular pattern.


texts: Error Probabilities over Generalized K Fading Channel

texts:
How do I integrate the average probability of error for generalized-k?
How do I plot the results


texts: How to check whether a continuous signal is periodic or not?

texts:
How to check if a continuous signal is Periodic or not?

My notes says
$\cos(\frac{3}{2}\pi t)$ is periodic because $T=4/3$.

And $\cos(\frac{3}{2}t)$ is not periodic as $T=4\pi/3$.


texts: Question on covariance matrix of 2 spatial signals

texts:
Every time I think I have understood the covariance matrix, someone else comes up wih a different formulation.

I am currently reading this paper:

  J. Benesty, "Adaptive eigenvalue decomposition algorithm for passive acoustic source localization", J. Acoust. Soc. Am. Volume 107, Issue 1, pp. 384-391 (2000)

and I have come across a formulation I do not quite understand. Here, the author is constructing the covariance matrix between two signals, $x_1$, and $x_2$. Those two signals are from different sensors.

For the covariance matrix of one signal, I know that we can get it by calculating the regression matrix, and then multiply it by the Hermitian of that same matrix, and dividing by $N$, the length of the original vector. The size of the covariance matrix here can be arbitrary, with maximum size being $N\times N$.

For the covariance matrix of two spatial signals, if we place the first signal in the first row, and the second signal in the second row of a matrix, then multiply by its Hermitian, and also divide by $N$, then we get a $2\times 2$ covariance matrix of both spatial signals.

However, in this paper, the author computes what looks like four matricies, $R_1{}_1, R_1{}_2, R_2{}_1$, and $R_2{}_2$, and then puts them into a super matrix and calls that the covariance matrix.

Why is this so? Here is an image of the text:


texts: Is there a transformation filter to decode light signal through Glass Bricks?

texts:
A friend is doing renovations and getting his entire ground-floor street-side wall replaced with glass bricks.  I told him that with all those bricks giving similar distorted views of the same room, and scattering light in similar ways, there must be some statistical technique to inverse filter the light that comes through to clean the signal and see what's behind the bricks---and that he should watch out or at least consider curtains.

Was I right?  Or is this impossible (or NSA level stuff), or can this be done with standard image processing libraries and a little stats?


texts: What is the step response curve of a second order low pass filter? And what if it is set for resonance?

texts:
I am doing a lot of audio synthesis DSP where I need to use low pass filters to shape the decay of an impulse. I understand that a one pole filter fed a discontinuity, say from a steady state of 1's to a steady state of 0's, will decay with a perfectly exponential curve. I believe the decay will be such that the signal will reach an amplitude of $1/e$ at $time = 1/(2*pi*f)$.

This makes conceptualizing one pole low pass impulse modeling very easy. But I am trying to understand how other filter orders will do the same.

I understand that a second order filter can be approximated running two one pole filters in sequence (ie. each will attenuate by 6 dB/oct, leading to a 12 dB/oct curve). If that is the case, then I would expect the step response of a second order filter without resonance to behave the same as a one pole filter and remain exponential, only that much faster.

So perhaps the time to 1/e would be:

$time = 1/(2*pi*f)^2$

Would that be correct?

I asked here about a lower slope filter and no one has replied so I am guessing it is not common knowledge:
A one-pole LPF (6 dB/oct) has a step response to $1/e$ amplitude of $time = 1/(2∗pi∗f)$. What would the response time be of a 3 dB/oct filter?

But I presume the same principle would then apply. A 3 dB/oct low pass filter would have a time constant of:

$time = 1/(2*pi*f)^{0.5}$

And if this is all correct, then we could say the time constants of any non-resonant low pass filter would be roughly:

$time = 1/(2*pi*f)^{filter-order}$

What do you think? Does all this sound correct? If so, there is no difference between low pass filtering with any order of non-resonant filter, as they can all be set up to create the same outcome with different parameters.

Lastly, then the remaining question would be: What does the step response of a resonant second order low pass filter look like, again going from steady 1's to steady 0's? I presume the resonance ruins the precisely exponential decay, but in what manner? Does it create a more compressed curve? Will it resonate creating a wobbling of the output? Will it dip below zero as it tries to settle out?

I tried testing it with a resonant second order LPF but I was just getting almost random maximum amplitudes coming out. Very unpredictable. I'm not sure if I did something wrong or that's to be expected from the resonance.

Thanks for any help understanding all this.


texts: Conditions for representing (perfectly) an analog signal as a digital signal

texts:
Consider the following cases:

Sampling with a frequency of the "signal's central frequency"
Sampling a BP signal with twice the frequency of the signal BW.
Sampling an LP signal with the highest signal's frequency.
Sampling an LP signal with twice the highest signal's frequency
Sampling a BP signal with the frequency of the signal BW.

My answers/thoughts:

Since $f_{center} < f_{max} < 2f_{max}$, by the sampling theorem, it's not (always) possible.
This one is true, but I don't know why.
$f_{max} < 2f_{max}$ - the same as #1.
This is true by the sampling theorem (even though I think it should be $2f_{max} + \varepsilon$, isn't it)?
$BW < 2f_{max}$ so the answer is no, the same as #1.

Can you please validate my answers as well as help me with understanding 2 and 4?

Thanks!


texts: How to process/generate a phase shifted frequency varying sine wave?

texts:
I want to phase shift an incoming sine wave with varying frequency but I am unsure how to go about doing so in practical terms.

A little more info regarding the requirements:
I have an encoder producing a sine/cosine pair with a fixed Peak to Peak but as the speed changes so obviously does the frequency. I want to effectively advance/retard the signal by altering the phase of the incoming signal.

Where I am unsure is how to go about doing this, if I use a look up table (LUT) for fast frequencies this would be ok but at slower frequencies I am going to get a very rough (digitised) signal. I was thinking I could calculate the signal 'on the fly' but again that would require having a LUT ie output = sin (input(amplitude) + offset[amplitude])

I think I maybe going about this the wrong way and there is possibly a simple solution to this?


texts:
I have come to the understanding that if these three properties hold true then the system is a memory system:

1) Time Scaling:

$$y(t)=x(2t)\,,$$

2) Time Shifting:

$$y(t)=x(t+2)\,,$$

3) Integration based system.

I want to ask that do these properties also hold true for invertible systems?


texts: How does the power spectrum of the amplitude envelope depend on its underlying carrier frequency?

texts: when looking at the amplitude envelope of an oscillation (see red trace in Figure below), it seems to me as if the frequency content of the envelope depends on the the frequency of the underlying carrier signal (blue trace). More specifically, it looks as if the fastest fluctuation the envelope can exhibit is related to the frequency of the carrier signal. There should be a straightforward mathematical relation between the carrier frequency and the fastest frequency in the envelope. If I think about the individual peaks of the oscillation as "samples" for the envelope, then the fastest frequency the envelope contains should be carrier_freq/2, but I'm not sure if this is correct. I'd appreciate any help or hints in the right direction.


texts: How to figure out number of multiplications in rational sampling

texts:
I am trying to understand the following:
Consider a system implementing a rational sampling rate change by $\frac{5}{7}$: for this, we cascade upsampler by 5, a lowpass filter with cutoff frequency $\frac{\pi}{7}$ and a downsampler by 7. The lowpass filter is a 4th order Butterworth filter with transfer function
$$ H(z) = \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + b_4 z^{-4}}{1 - a_1 z^{-1} - a_2 z^{-2} - a_3 z^{-3} - a_4 z^{-4}} $$
Assume that the input works at a rate of 1000 samples per second. What is the number of multiplications per second required by the system? Assume that multiplications by zero do not count and round the number of operations to the nearest integer.
I would like to know how to approach this problem and get a general idea. I am taking an online course on my own and there is very little reference material, so I was trying to figure out a good way to approach this problem, but I am stuck with the logic behind it.


texts: Why using the impulse respond of an LTI to characterize its output?

texts:
We all know that every LTI, is defined by its transfer function, so we can determine the output of any system, (using common transforms). It is also known that we can determine the output of any LTI for any given input signal just by having its impulse response (which gives us an output equal to its transfer function). I don't know if I'm following the point here, is it possible to determine the impulse respond of a system without having its transfer function? If so, how is it obtained?
Can you give me a hand with this please?


texts: Why is the digital frequency highest at $\pi$ and what does it mean in terms of analog frequency?

texts:
I can't seem to comprehend why the digital frequency is highest at $\pi$. I know the relationship between the digital and analog frequency is given by:
$$\omega = 2\pi\frac{F}{F_s}=2\pi f$$
Where $F$ is the analog frequency and $F_s$ is the sampling frequency.
Why does the digital frequency increase from $0$ to $\pi$ and then decrease from $\pi$ to $2\pi$?


texts: Generating a sound where end frequency is 1/2 of the start frequency

texts:
I am very very new to signals, and I am trying to generate sounds based on some parameters from a database. So, the database stores the following:

startFrequency
endFrequency
startAmplitude
endAmplitude
duration

I am generating a WAV file based on this information using the following code:

...
double currentFrequency;
double currentAmplitude;

int samplerate = 44100;
int samples = ceil(duration * samplerate);
int* mySampleBuffer = new int[samples];

for(int i=0; i<samples; i++)
{
    currentFrequency = Interpolate(i, 0, samples, startFrequency, endFrequency);
    currentAmplitude = Interpolate(i, 0, samples, startAmplitude, endAmplitude);
    mySampleBuffer[i] = static_cast<int>(INT_MAX * (sin(((double)i * currentFrequency * PI * 2)/(double)samplerate) * (currentAmplitude/maxAmplitude)));
}

writeWAVData("mySound.wav", mySampleBuffer, mySampleBufferSize, samplerate, 1);
delete[] mySampleBuffer;
...

When the currentFrequency reaches 1/2 of the startFrequency, I notice that the sound wave flips (not sure what the correct term for this is). It doesn't seem like this is correct. Could someone help me understand what is going on.

Here is a screenshot of Audacity

For this image, startFrequency is 3380 Hz, endFrequency = 1380 Hz, duration is 0.512 s, and the amplitude is constant from start to finish. I have calculated that at 0.43264 s, the currentFrequency is exactly 1/2 of the startFrequency. In the picture you can see the "flip" happen at about 0.43 seconds.


texts: Taking FFT of a signal with lots of "holes"

texts: I have a time series that is spotty (more 'no sample' than 'sample' at each second, which is the sample rate).  There are obvious trends when viewed visually.  However since there are holes, the FFT has a spike near zero.  Is there anything that I can do about this?


texts: Can cross-c.(x,y) be positive if signals x and y do not share frequencies?

texts:
The question is if the cross-correlation of two signals $x$ and $y$ can be non-zero even if $x$ and $y$ do not share frequencies.

My approach is the following:
The cross-correlation  $\rho_{xy}\left(\tau\right):=x\left(\tau\right)\star y\left(\tau\right)$  can be expressed in terms of a convolution:

$$
\begin{array}{rcl}
\rho_{xy}\left(\tau\right) & = & x\left(\tau\right)\star y\left(\tau\right)\\
 & = & \displaystyle\sum_{t=-\infty}^{^{\infty}}x\left(t\right)\bar{y}\left(t+\tau\right))\\
 & = & \left(\bar{x}\right)\left(-\tau\right)*y\left(\tau\right)
\end{array}$$

i.e. the cross-correlation of $ x\left(\tau\right) $ and $ y\left(\tau\right) $ equals the convolution of $ \bar{x}\left[-\tau\right] $ and $ y\left(\tau\right).$

The convolution theorem  $\mathcal{F}\left(x*y\right)=\mathcal{F}\left(x\right)\mathcal{F}\left(y\right) $ allows us to express the cross-correlation in terms of it's frequency content and replace the convolution by multiplication: $$ \mathcal{F}\left(\rho_{xy}\right)\left[\omega\right]=\mathcal{F}\left(\left(\bar{x}\right)\left(-\tau\right)*y\right) \left[\omega\right]=\bar{\mathcal{F}\left(x\right)}\left[\omega\right]\mathcal{F}\left(y\right)\left[\omega\right] $$
 Due to Parseval's Theorem, signal energy in frequency and time domain corresponds to: $$ \sum_{\omega=-\infty}^{\infty}\left|\mathcal{F}\left(\rho_{xy}\right)\left[\omega\right]\right|^{2}=\sum_{\tau=-\infty}^{\infty}\left|\rho_{xy}\left(\tau\right)\right|^{2}.$$

Hence the energy of the cross-correlation of the signals corresponds in time and frequency dimension. Thus, unless two different signals share frequencies, they cannot interfere. Two orthogonal signals, i.e. $\left\langle x,y\right\rangle =0 $, can have shared frequencies without having a non-zero cross-correlation.


texts: How do I model a system to use with a Kalman Filter?

texts:
So I have an accelerometer, gyroscope, magnetometer and GPS. I would like to use a Kalman filter to optimally measure speed, position, acceleration and orientation. I have done research and I need to model the system mathematically, however this is the part I have got stuck on.

Can anyone give me some pointers on how to proceed here, do I need to try and model the system using differential equations and then derive the parameters for my $\mathbf A, \mathbf B$, and $\mathbf H$ matrices from there?

Any guidance would be great, thanks.


texts:
I run into the following filter that is supposed to do some type of time averaging of $x$

$$y[n]=G\cdot y[n-1]+(1-G)\cdot\dfrac{x[n]-x[n-1]}{T} $$

where

$$G=e^{-2\pi c T} $$

$T$ is a time interval, and the samples of $x$ and $y$ come every $T$ seconds (we can assume $y[0] = 0$).

The definition includes a quantity $c$ that I think acts as some sort of cut-off frequency, but I am not sure.  Can this type of time-averaging be seen as a low-pass filter? If so what type of filter, and how can I relate $c$ to $T$ considering that the samples come every $T$ seconds?


texts: How to filter pulse like jumps in a signal?

texts:
I have a noisy signal with jumps to high value and back to normal for limited time bins (40 for example) which I want to filter to have a smooth signal with no jumps. Here is the graph, the blue one.

I tried moving average filter (n=20), the green one. Also tried window based (kaiser) LPF with cut-off freq=0.01 (I choose it manually) but still the filtered signal follows the jumps.

Also I tried to flatten the signal by using the average of the past n values whenever there is a jump. But how could I find the start of a jump. I need a threshold. Also there is difficulty with determining the end of a jump. I need another threshold.

Is there any way to filter the signal in a way that it doesn't follow
the jumps?
Are those jumps and falls caused by low frequencies, since LPF don't eliminate them? So I should use high pass filter? I am confused.

EDIT: Another graph that shows what I want to eliminate (the gray regions).


texts: Upper Bound for the DFT (FFT) Coefficients of a Bounded Signal

texts:
I have a discrete signal $x[n]$ of length say $1024$, such that :
$$-1 \leq x[n] \leq 1, \qquad \forall n$$
and let $y[k]$ be its DFT.
Is there an upper bound for $|y[k]|$ ?  (i.e. for the DFT of a bounded signal)


texts: Signal matching: How to quantify the difference between two signals of varying frequency

texts:
I have two waves, and I would like to quantify the difference between them.

They are exponential sine waves where the frequency decreases with time.

I'm interested in the difference in decay constant between the signals. I thought maybe I could use some kind of FFT method to get the envelope, but I don't know what to do with the varying frequency.


texts:
I am trying to design a digital butterworth filter for the given specifications..
code is posted below..

rp=3;
rs=15;
FS=1;
wp=0.5*pi;
ws=0.75*pi;
pwp=2*FS*tan(wp/2);
pws=2*FS*tan(ws/2);
[n,wn]=buttord(pwp,pws,rp,rs,'s')
[b,a]=butter(n,wn,'s');
[bn,an]=bilinear(b,a,FS);%error
freqz(bn,an,512,FS);

My question is ,if i design a filter manually i am getting different values for 'bn' and 'an'..
but matlab gives different answer..
can anybody help me...?


texts:
If you do an FFT plot of a simple signal, like:

t = 0:0.01:1 ;
N = max(size(t));
x = 1 + sin( 2*pi*t ) ;
y = abs( fft( x ) ) ;
stem( N*t, y )

1Hz sinusoid + DC

FFT of above

I understand that the number in the first bin is "how much DC" there is in the signal.

y(1)  %DC
  > 101.0000

The number in the second bin should be "how much 1-cycle over the whole signal" there is:

y(2)  %1 cycle in the N samples
  > 50.6665

But it's not 101!  It's about 50.5.

There's another entry at the end of the fft signal, equal in magnitude:

y(101)
  > 50.2971

So 50.5 again.

My question is, why is the FFT mirrored like this?  Why isn't it just a 101 in y(2) (which would of course mean, all 101 bins of your signal have a 1 Hz sinusoid in it?)

Would it be accurate to do:

mid = round( N/2 ) ;

% Prepend y(1), then add y(2:middle) with the mirror FLIPPED vector
% from y(middle+1:end)
z = [ y(1), y( 2:mid ) + fliplr( y(mid+1:end) ) ];

stem( z )

Flip and add-in the second half of the FFT vector

I thought now, the mirrored part on the right hand side is added in correctly, giving me the desired "all 101 bins of the FFT contain a 1Hz sinusoid"

>> z(2)

ans =

  100.5943


texts: Bit reversal on twiddle factors on inverse FFT

texts:
I am currently working on a application which requires an inverse Fourier transform (IFFT) and am using a function library provided by Texas Instruments, in the datasheet they give an example on how to use one of their IFFT functions (shown below).

My question is: whilst I understand the need to perform bit reversal either on the input (decimation in time for an FFT) or the output (decimation in frequency for an FFT), I can't understand what's happening in the code given in the example. No bit reversal is performed on the input or the outputs only on the twiddle factors, is there some maths I am missing? Maybe something to do with the why the code accesses individual twiddle factors?

ps. The code is original from page 4-34 of this document: http://www.ti.com/lit/ug/spru657c/spru657c.pdf

void main(void)
{
 gen_w_r2(w, N); // Generate coefficient table
 bit_rev(w, N>>1); // Bit−reverse coefficient table
 DSPF_sp_cfftr2_dit(x, w, N);
 // radix−2 DIT forward FFT
 // input in normal order, output in
 // order bit−reversed
 // coefficient table in bit−reversed
 // order
 DSPF_sp_icfftr2_dif(x, w, N);
 // Inverse radix 2 FFT
 // input in bit−reversed order,
 // order output in normal
 // coefficient table in bit−reversed
 // order
 divide(x, N); // scale inverse FFT output
 // result is the same as original
 // input
}


texts: A reference request for zero-order hold (ZOH)

texts:
From Wikipedia:

  A zero-order hold reconstructs the following continuous-time waveform
  from a sample sequence $x[n]$, assuming one sample per time interval
  $T$: $$x_{\mathrm{ZOH}}(t)\,= \sum_{n=-\infty}^{\infty} x[n]\cdot
 \mathrm{rect} \left(\frac{t-T/2 -nT}{T} \right) \ $$ where
  $\mathrm{rect}()$  is the rectangular function.

I'd like to find a good bibliographic reference for it.

Thanks in advance.


texts: Is there a relatively easy way to detect likely real-time peaks in discrete-time data?

texts:
Let's say I have a set of data over time, t:

[0, 4, 6, 7, 7, 6, 4, 0]

It seems likely that this data would peak at t=3.5.

Is there a well-known algorithm for calculating this sort of peak?


texts: Spectral estimation from noisy time-series data

texts:
This is the first time I'm posting a question on here so I hope I'm doing it right. I've tried searching on here for an answer but haven't found anything particularly relevant.

I have some data collected from a line array of 32 hydrophones. I'm trying to estimate the power spectral density of the underwater noise at different tow speeds of the array using Welch's method. I think the noise should be approximately Gaussian, however on examination of the time series from each hydrophone, there are loud "bangs" occurring at random times on random hydrophones. The bangs are about 10 times the amplitude of most of the time-series values lasting for only fractions of a second.

Am I correct in assuming that the "bangs" will distort the estimate of the spectrum? Will the averaging used in Welch's method help to overcome this and if so is there any way to quantify the effects? Or is there any way of removing the "bangs" without distorting the PSD too much?

I don't have much formal background in signal processing so I apologise if the question is basic or lacking in information.


texts: How does the ROC (Region of Convergence) related to a real world application?

texts:
In class, we are often given exercises to find the impulse response, output, and Z-transform of a system.  In addition, we are often asked to define the Region of Convergence (ROC) depending on where the poles and zeros are in our system.

I am confused about how to relate the ROC to a real world application.

What does it mean for a system to converge?  How does the ROC relate to causality and stability?


texts: what does the statement "band limited signal of 5 KHz" mean

texts:
A band limited signal of $5$ kHz is observed at the output node whose sampling frequency is $600$ kHz. What is the minimum order of the filter?

Does it mean:

a signal that is from $0$ to $5$ kHz on the frequency axis when drawn
a signal from $-2.5$ kHz to $2.5$ kHz
a signal with bandwidth of $5$ kHz centered anywhere


texts:
If we sample a signal let say sine(2 * pi * f) with f=1Hz  and a sampling Frequency of Fs = 8Hz, is it right that the length of the data should be N = Fs/f or multiple of Fs/f like N= d*(Fs/f) with d=1,2,3,.., is that right ?
I read often, that it is better to increase N,
my question : we can only increase N with Nnew= d * Nold, right ?
and not like Nnew= 1,2 * Nold?
for my example , with f=1HZ, Fs= 8Hz, T=1s, Ts=0,125s, N=8
we can increase to  f=1HZ, Fs= 8Hz, T=2s, Ts=0,125s, Nnew=16,
but it would not be right to increase ist to f=1HZ, Fs= 8Hz, T=1,5s, Ts=0,125s, Nnew=12, wich is not right  because  x[n]=x[n+N] doesnt fit, right ?
......
if it is right above, then where do I know how to get the right length N if i down know my signal ?
Do I have to Look the x[n] Series of the Signal one by one to see where N (full Cycle) of the signal ist ?
Thanks


texts: What is the role of Freqency in Digital Images

texts:
Possible Duplicate:
  What does frequency domain denote in case of images?

If we look deeply into Digital Images they are purely generated by the pixels distributed in rows and coloumn and the pixel consists of number of certain bits which define the complete Image.

Then what is the role of Frequency in generating Digital Images ? like many people says that in Digital Image processing and Image Compression, Wavelets is much more efficient than Discrete Cosine Transform as Wavelets gives the information of both time and Frequency.

I want to know what role does frequency and time plays in producing a Digital image, does it has to do something with pixels?


texts: White noise and entropy confusion about concepts

texts:
The spectral entropy (SE) of a signal is a measure of its spectral power distribution. The concept is based on the Shannon entropy, or information entropy, in information theory. The SE treats the signal's normalized power distribution in the frequency domain as a probability distribution, and calculates the Shannon entropy of it.

In general, Shannons' entropy of a signal is in between 0 and 1. 0 means no information content is present in the signal and 1 means otherwise. In communications, if I recall correctly we are uncertain of what the next symbol should be and so we prefer uncertainty as it conveys more information. My question is what if the entropy of the signal (spectral entropy) is say 0.12 i.e., quite small. For example, in a communication channel there is white noise but as soon as somebody speaks, the spectral entropy decreases (please see the example of detecting sine wave from white noise https://www.mathworks.com/help/signal/ref/pentropy.html)

Therefore, the information content of the signal now reduces during the time interval of the duration of the speech signal.

QUESTION: Does the reduced information content of the signal imply that the speech signal contains no information? How come a speech signal has no information or worth? Do we prefer high or low entropy (spectral and Shannon entropy)?

My confusions are:

High entropy --> more information content -- is that preferred or is useless?

Low entropy --> less information content -- Is that preferred?

Please correct me where wrong.


texts:
So I have signal with frequency of $15Hz$ and sample rate frequency is $20Hz$.

What happens if we sample the signal at a frequency that is lower that the Nyquist rate?  We will have aliasing. Sample rate frequency should be at least bigger than $2*f_{max}$.

I understand that part but I'm confused how that will look like. Can someone help me with that?


texts: Applying Window Function to Low Frequency Signals

texts:
I'm computing 1 sec. hanning windows from a signal that has a variable frequency between 1-4Hz. My first impression is that data loss caused by the distortion due to the window function is greater than the correction that it is expected to give while taking FFT of that window. Am I right?

Is it a bad approach to apply window functions to such windows with size of at most 4 wavelengths?


texts: Help with equations for exponential ADSR envelope

texts:
With application code, I have implemented a linear ADSR envelope for shaping the amplitude of an oscillator's output.  The parameters for attack, decay and release duration as well as sustain level can be set on the envelope and everything works as expected.

However, I would like to tweak the ramp shapes of the envelope to something that resembles what most synthesizers use for a more natural response: inverse exponential for the attack and exponential for the decay and release.  I am having trouble getting my formulas right for calculating the envelope output values for these types of ramp shapes.  To calculate the linear ramps, I am using the two-point form, plugging in the start/end $x$/$y$ values which are derived from the attack/decay/sustain/release input parameter values.  I cannot seem to work out the correct formula for exponential (standard and inverse) ramps using the same start/end $x$/$y$ point values.

I have saved a Desmos Graphing Calculator session that demonstrates the approach for linear ramps that I described above.

If anyone can help point me in the right direction, it would be much appreciated.


texts:
I have an exercise that asks for us to determine the model for a system that goes like this:

  A battery manufacturer for cars is studying  how their batteries behave. The measurements are influenced by gaussian noise with center in 0V and standard deviation equal to 3 Volts. Nominal value for the Battery voltage is 14V. Determine the model for the system, as well as initial values to implement a Kalman Filter (in matlab).

It is quite clear what we want done. But I don't really understand how the centered values for the gaussian distributions could be different, and so I have no idea how to treat it. It is most likely that I have some concepts wrong, can someone explain how to deal with a noise that has a mean value different to the nominal value of the object in analysis?


texts: Polarity inversion in frequency domain (polar coordinates)

texts:
I don't fully grasp how polarity inversion is performed in the polar coordinates of frequency domain. The frequency components of the signal do not change, so the amplitude part is going to stay whatever it is. That means the phase must change, but how? If I multiply the phase by -1 the time domain gets reversed. Phase shifting on the other hand only generates a delay...

The only thing I can think off is to reverse the amplitudes, but as far as I am aware the amplitudes are always positive in polar format. Am I wrong on this?


texts: Summing magnitudes of individual frequency bins

texts:
I am working on signal analyser and have problem with understanding relationship between display resolution and frequency resolution (range).
My frequency range is $ 1-20000\quad [ H z ] $ so to project each frequencies magnitude on display (horizontally in linear scale) I need display horizontal resolution at least 20000.
But of course I don't have :)

So let's say I have 1000 pixels horizontal resolution. So to project whole frequency range I need to express $ \frac { 20000} { 1000} = 20 $ frequency bin magnitudes by one pixel.

And my question is what is the most relevant manner to do that?

Should I just sum all 20 magnitudes? Or better make some avarage value like $ \frac { 1} { 20} \sum _ { i = 1} ^ { 20} mag_{fbin} $

I am pretty sure it's concern a lot of other subjects like: is magnitude print in decibels (log) scale or as range from 0 to 1? Also important thing is perception of human ear (if it's audio). And other things. But I don't know how to deal with that. Could you give any advice? To make the answer easier, let's say I want to create audio signal analyser.

Please help. Thanks in advance.


texts: Fourier Transform with both Time Delay and Frequency Shift

texts:
I know that the Fourier transform of a function with time delay can be written as: $$\mathscr{F}\big\{x(t-t_0)\big\}=X(f)e^{-j2\pi f t_0}$$

The Fourier transform of a function with frequency shift can also be written as: $$\mathscr{F}\Big\{x(t)e^{j2\pi f_0 t}\Big\}=X(f-f_0)$$

So what if we have both shift and delay at the time domain, what will be the result in the frequency domain? E.g.:

$$\mathscr{F}\Big\{x(t-t_0)e^{j2\pi f_0 (t-t_0)}\Big\}$$

Will the result be: $$X(f-f_0)e^{-j 2 \pi  f (t-t_0)}$$

Also what will be the result of:

$$\mathscr{F}\Big\{x(t-t_0)e^{j2\pi f_0 t)}\Big\}$$

Is there an order to apply these properties?


texts: Backward propagation of error in FIR Neural Networks

texts:
FIR Networks are a really great kind of Neural Networks. It allows very precise predictions of missing samples for example when ones wants to reconstruct missing signals or adaptive noise cancellations, etc

I'd like to understand how they work and a great paper about it is the one by WAN in 1993 : http://www.cslu.ogi.edu/publications/ps/wan93c.pdf

here is an example of a FIR connection, and the computation of the weight changes knowing weights $b()$ or $a()$, inputs $u(k)$, $x(k)$ and error $e(k)$

It is said in the paper that : as the signal has to be propagated through the network, the resulting error has to be back-propagated through the same network

here is a simple image explanation

so the goal is to find $\delta$(k) for a given neuron to be able to work backwards the gradient (the error)

here is the formula of the weights ($a()$, $b()$) updates:
$$\bigtriangleup  \bf w \rm ^l _{ij} = - \mu \delta^{l+1} _j (k) \cdot \bf a\rm^l_i(k) \ \ (1)$$

where

$$\delta^l_j(k) = -2e_j(k)f'(s^L_j(k)) \ \ (2)\normalsize \\\ if \ l = L \ (last \ layer) $$
and
$$\delta^l_j(k) = f'(s^l_j(k))\cdot\sum_m \bf\delta\rm ^{l+1}_m(k)\cdot\bf w\rm ^{l+1}_{jm} \ \ (3) \normalsize \\\ if \ 1 \leq l \leq L -1$$

$f'$ is the derivate of the activation function. An important point is that $\bf w \rm ^l _{ij}$ and $\bf \delta$ are vectors, not scalars.

page 26 we see :
$$\bf w\rm^l_{ij} = [ w^l_{i,j}(0), w^l_{i,j}(1), \ ... \ ,w^l_{i,j}(M^l)]$$

and the vector of delayed activation values is :
$$ \bf a\rm ^l _i (k) = [a^l_i(k), a^l_i(k-1), \ ... \ , a^l_i(k - M^{l+1})]$$

So let's take the first step : it is the last layer L (filter b in this example) and we have the error $y(k) = e(k)$, the actual weights $b(0), b(1), b(2)$ and the signal values $\bf a\rm^l_i(k) = [u(k), u(k-1) ...]$

I'm trying to understand fully how to compute each weight change.

using (2) we first compute the weight change
$$\bigtriangleup w_{b(2)} = - \mu \delta^{l+1} _j (k) \cdot \bf a\rm^l_i(k)$$
$$\bigtriangleup w_{b(2)} = 2 \mu e_j(k)f'(s^L_j(k)) \cdot u(k-2)$$

so we have the new weight

$$b(2) = b(2) + \bigtriangleup w$$

is this first assertion correct?

and if it is, i have trouble understanding what is the next step:

do we have to multiply $e(k)$ by the new weigth $b(2)$ to get the error for the next backward step (at weight $b(1)$) ?
so for b(1) we use $$\bigtriangleup w_{b(1)} = 2 \mu e_j(k)b(2)f'(s^L_j(k)) \cdot u(k-1)$$
or do we have to use always the same value of e(k) for the next weight update : $b(1) = b(1) - \mu \delta^l_j(k) \cdot u(k-1)$ ?

for the second FIR filter there is a difference.
Here we use eq (3) as it is not the last layer L.

in this simple case of two cascaded FIR filters, i think $(1)$ could be rewrote as:

$$\bigtriangleup  \bf w \rm ^l  = - \mu \delta^{L} (k) \cdot \bf x\rm(k)$$

where $\delta^{L} _j (k)$ is the previously calculated $\delta$ and $x(k) = [x(k), x(k-1), \ ... \ , x(k-M)]$
and as before we multiply the gradient $\delta$ by the updated weights and go backward to the start.

is it right? or am i wrong (and where)?

Also it would be very nice if ones could possibly put some general pseudo-code to compute the whole FIR network or point to some existing code so i can compare the algorithms.

Thanks for help

Jeff


texts: What does standard deviation of noise 1 mean?

texts:
In theory of noise,Typically, the standard deviation of noise has 1 and mean has 0.
I think that the reason of noise mean has 0 that we can assume that all noise signal go to zero when we sum it all.
But I can't understand standard deviation of noise has 1 in image noise.
They are always 0~255. There is no negative value.

What does zero-mean noise mean?

Especially, but I have got an idea as following. I can't catch quite a bit. So would you please let me know how to illustrate following answer?

"for an image intensity which is always non-negative, you can simply modify your added N(0,1) standard gaussian noise in 3 steps: 1-scale it so that your noise has whatever std you wish. 2-add whatever proper mean you need such as 128. 3-clip the noise for below zero and above 255 samples. This is simple bt It will help you get what you need at least initially."


texts: Improving template with instantaneous amplitude

texts:
Given some recording (containing both the signal of interest and some Gaussian noise), can we improve our template (or model) of the signal using the analytic signal of the recording?

For example, a signal (red) with Gaussian noise results in some noisy recording (black). The instantaneous amplitude of the recording (black) deviates away from the true signal's instantaneous amplitude (red) because of this noise:

This got me thinking: Since we know the instantaneous phase of the true signal will be linear (when unwrapped), we can reconstruct this from the (noisier) instantaneous phase of the recording, say using OLS. For argument's sake, let's assume a fixed unit amplitude (even though in this example the amplitude is actually modulated at 2 Hz) and reconstruct the recordings either from the raw instantaneous phase (i.e., with noise) or from the reconstructed instantaneous phase (i.e., hopefully without noise) -- and compare these to the reconstructed signal from the instantaneous phase of the true signal (i.e., without noise).

Clearly, the reconstructed (OLS) instantaneous phase better approximates the true signal's instantaneous phase than the instantaneous phase we yield from the raw recording (error = true signal – reconstruction; figure  below).

Finally, to see how close the reconstructions (either using raw or OLS instantaneous phase) approximate the true signal, I've computed these using the raw instantaneous amplitude for both. While (again) the OLS does better (below), there is still so much noise (because the instantaneous amplitude is computed from the raw recording).

Is there a way to better approximate the true signal (e.g., by low-pass filtering the instantaneous amplitude)?


texts: how I can use the FFT data to compute the convolution?

texts:
First,I have a vector A of length N,through process

A1 = fft(A,N);
A2 = Filter(A1);
A3 = ifft(A2,N);

Now,I need compute the convolution of vector A2 with vector B,vector B is another vector with N elements，I noticed that seemed that I could use

ifft(fft(A3,2N).*fft(B,2N))

to calculate convolution. fft(A3,2N) means padding A3 with N zeros.

In fact, A2 = fft(A3,N)

So, the problem is what can I do to avoid calculate A3 and fft(A3) by using A2?

Or maybe the problem is how can I use A2 to calculate fft(A3,2N)?I wan to know if I can reduce some calculations in the whole process.thanks.
Here is a matlab test

clear;
N = 4;
A = 1:4;
B = 3:6;
A1 = fft(A);
A2 = (A1).*2020+1234;%filter(no sense)
A3 = ifft(A2);
A4 = fft(A3,2*N);
B2 = fft(B,2*N);
x = xcorr(A3,B)%ans: 0.1952    0.4051    0.6958    1.0470    0.7676    0.5050    0.2424
x2 = ifft(A4.*conj(B2),2*N)%ans: 1.0470    0.7676    0.5050    0.2424         0    0.1952    0.4051    0.6958
x3 = ifft([A2(1:N/2) A2(N/2+1)/2 zeros(1, 2*N-length(A2)-1) A2(N/2+1)/2 A2(N/2+2:end)].*conj(B2),2*N)
%ans: 3.5624    4.2973    5.4391    6.3191    6.2232    5.2077    4.0659    3.4665


texts: How to edit audios so that they have the same length

texts:
I have a dataset of audio files, which differ on their lengths by a couple of milliseconds. Some are little shorter than 1s and some are little longer than 1s. They all have the same sampling rate, namely 20kHz, what differs is the number of samples.

Does anyone know a way to automatically transform them into 1s audio files with 20kHz sampling rate?

EDIT:
I need to transform the audios to having the same length so that I can input them into a standard fully-connected neural network.

Cutting the audio in the beginning and at the end would be the best solution, I think, if the audio is longer than 1 second. For example, if the audio is longer 1.1s, then I would like to cut the audio by 5ms in the beginning and the end to transform it to a 1s audio? And if the data is shorter, somehow putting some "silence" at the end of the data?

Thank you in advance!


texts: This is how my professor is finding the frequency response of an LTI system when given the impulse response. Is this wrong?

texts:
My DSP professor uses the freqz() function to find and plot the frequency response and I think it's wrong but I want to make sure before I point it out. Take this example:
Given the impulse response of an LTI, derive an expression for the magnitude and phase response and verify using MATLAB.
$$h(n)=2(-1)^{n-8\over 2}\sum_{k=0}^5 \delta(n-2k)$$
This is how I calculated the freq. response:
The impulse response is just the following values:
h = 2[1 0 -1 0 1 0 -1 0 1 0 -1]
The freq. response is the FT of the impulse response:
$$H(e^{j\omega}) = \sum_{n=-\infty}^\infty h(n)e^{-j\omega n}$$
h(n) exists only for $n=[0,10]$ so I change the limits of summation. Also, the series in the impulse response, converges to 6, so I replace it with 6:
$$\sum_{n=0}^{10} 2\times 6\times (-1)^{n-8\over 2}e^{-j\omega n}$$
Let $n'={n-8\over 2}\Rightarrow n=2n'+8$. Absorb the $(-1)^{n'}$ term. Replace these in the summation and update the limits in terms of n':
$$2\times 6 \sum_{n'=-4}^{1} (-1)^{n'} e^{-j\omega (2n'+8)}=12\sum_{n'=-4}^{1} e^{-j8\omega}(-e)^{-j2\omega n'}=12e^{-j8\omega}\sum_{n'=-4}^{1}(-e)^{-j2\omega n'}$$
And after finding the sum of the series, and some simplifications, the expression becomes:
$$H(e^{j\omega})=\frac{12(1-e^{-12\omega j})}{1+e^{-2\omega j}}$$
I derived the expression for phase response and got the following:
$$\angle H(e^{j\omega})=-5\omega +{\pi\over 2}+\left\{
\begin{array}{ll}
      0,   & k{\pi\over 6}\le\omega\le(k+1){\pi\over 6} \\
      \pi, & (k+1){\pi\over 6}<\omega<(k+2){\pi\over 6} \\
\end{array}
\right.$$ for $k=0,1,2,...$
I plug in some test value for $\omega$ to get the phase.
Then, to find and plot the frequency response, this is what my professor does:
freqz(h,1,w)
where h is the vector of the impulse response, h(n), and w is the vector of freq. (in rad). He says the '1' is added because it's an FIR filter.
Looking at the MATLAB documentation for freqz none of what he said makes sense. The '1' is supposed to be the arguments for the number of points for the transformation, and 'h' is supposed to be the digital filter represented either by the vector coefficients b and a or other methods.
When I run his code, I get the right shape and points where the frequency jumps up by $\pi$ but not the right values. For example, this is what I get with his plot:

Notice the phase at $\pi /6$.
This is what I get by passing the b and a coefficients from the transfer function $H(e^{j\omega })$:

Notice the phase at $\pi /6$. If I plug in $\omega = \pi /6$ in the expression for the phase response, I get that the phase is $\phi = -\pi /3 \Rightarrow -60^{\circ}$
I tried hours and hours to find out what my mistake was and got very frustrated, until I looked at the documentation. I want to bring this up to him because other students in the class are using his method which inherently gives wrong results, and future students will too, but just to make sure before I do that, am I right or am I wrong?
Thank you!


texts: Does audio upsampling create noise/artifacts or degrade the signal?

texts:
I've read that upsampling performed in digital music playback can color the sound, produce artifacts, etc.  For example, an audio file ripped from a CD might be 44.1Khz/16-bit, and then upconverted to 48Khz/16-bit and played via an optical digital audio output.  Audiophiles say this is bad because the signal needs to be "bit perfect" to be reproduced correctly.

Is this correct?  My vague knowledge of DSP from grad school leads me to think that all upsampling should do is increase the bandwidth of the signal.  But, since the source signal is bandlimited, there shouldn't be anything new in the added bandwidth.  And I don't see why the process would color the sound.

What am I missing?


texts: I am working on diffusion of medical images, and I have come across the term isotropic diffusion. Can anyone explain it for me?


texts: Intuitively explain Bi-linear time frequency distributions, someone please?

texts: I have a fairly good understanding of Wavelet Analysis, but what are these bilinear distributions and how do they differ from Wavelet Transform?


texts: What is absolute ripple specification and how does it arrive in low pass prototype for Butterworth?

texts: Digital Signal Processing by John G. Proakis, Dimitris G. Manolakis(4th Edition) gives the prototype function for Butterworth low pass filter in an analog system which is fine till the point where the cutoff radian frequency is present in the equation. But then an epsilon and pass band radian frequency come into the equation. Digital Signal Processing by Li Tan mentions this epsilon as 'Absolute ripple specification'. So, my question is, we know about the stop band attenuation, pass band ripple and the pass band, stop band frequencies, what is this epsilon and how does the equation containing it (in the image) come to be?


texts:
I have just started taking signal & systems lessons and here is my question:

If we say that x0(t) = A.cos(w0t). (a cosine signal with zero phase shift, w0 radian frequency) And if we would like to time-shift this signal by for example t1.

The resulting phase shift should be found by -w0*t1 = phi. (phi denoting phase shift).

By this logic, if I wanted to find the phase-shift for this signal: x(t) = sin(pi/4*t-pi/4)

What would the result be? Can I apply the first formula for phase for already phase shifted signals? Or am I missing something very big here? :)

Thank you very much for any kind of help.


texts: Please, help me interpret my Simulink simulation of AM. Why does carrier not appear in the spectogram?

texts:
Carrier is 2 * pi * 25, modulating signal is 2 * pi, all the amplitudes are 1s and zero phase.

I realized that I could add a sine wave right at the end. I get a carrier in frequency domain, but my signal in time domain looks strange.


texts: Can we start a wave $\sin(2x-4)$ from position 4 in the horizontal axis?

texts: Even though the wave of $\sin(2x-4)$ looks like this and it starts from position 2 out of curiosity I would like to know whether we could start it from position 4 like the wave of $\sin(2x)$ shown here.


texts: What is the autocorrelation equivalent of the spectrogram called?

texts:
I'm very knowledgeable about the differences between the Fourier transform, and the autocorrelation; mainly that one converts the time domain to the frequency domain, and the other finds periodicities (regardless of spectral composition). And I'm not asking what either does, or how to perform them.

My question is, when one does the equivalent of STFT (short-time Fourier transform) to produce a spectrogram, but with overlapping windowed autocorrelations, what is the result called? The result is very similar, but with the frequency axis kind of inverted and scaled to give the periodic lag, and the amplitude axis is now the correlation.


texts: Additive disturbance in block diagram representation

texts:
Drawing the open loop block diagram between valve and pump is straightforward (please see illustration). But why should $v$ be an additional disturbance in this system (please see solution)?
$v$ is going out of the tank?


texts: How to replace color in an image without changing its texture/shades or brightness?

texts:
I want to replace color in an image from another color: For that sample image is below

I want to replace color such that it becomes

I know it can be easily done in Photoshop but I am looking for an algorithm which can replace a particular region color with another color but texture and shades should be preserved. These image are only for example.

I have tried changing hue and maintaining saturation and brightness but it fails when I try to change image to white/Black and nearby colors

<style>
  img{
      -webkit-filter: hue-rotate(120deg);
  }
</style>