texts: Help with denoising signal and periodogram analysis resources

texts:
This is a cross posting from the crossvalidated stack exchange as I thought this may be a better forum to ask.
I have a dataset consisting of respiratory time series signals of different lengths obtained from different groups of patients. I want to either classify or cluster the patients using these timeseries by using the commonalities of the time series of each group. However, I have no experience in dsp.

Firstly, I am confused if I am supposed to filter my signals to get rid of any frequencies above the Nyquist frequency. My sampling frequency is 32Hz and my time series is somewhat noisy and has some artifacts. I am also unsure of which filter to select for this.

Secondly, I wanted to look at the periodogram and the average power spectral density at each frequency within a group - but I am not sure if I understand the periodogram very well - if I have different time series lengths then my periodogram length will vary too, so I am not sure how this comparison can be made.

Being from Pure Math, I know Fourier analysis purely from the perspective of functions and using Fourier transforms to obtain the coefficients that describe the projection of these functions onto an orthonormal system. With periodograms however, I noticed that the x-axis represents sample frequencies. I am confused with the distinction between sampling frequencies vs. underlying frequencies of the generating function (say I have $\sin(2\pi x)$ sampled at 10Hz, does the periodogram characterize the 1Hz underlying frequency of the function?)
Any resources on understanding how to analyze and remove noisy components of time signals from a machine learning perspective would be much appreciated! Due to time constraints, I have shied away from long textbooks on digital signal processing. Thanks a lot.


texts: How to generate the amplitude of a signal with a certain power spectral density?

texts:
I am a newbie. If I posted a question someone else already asked, please forgive me. Thank you!

Now, I have a power spectral density named $P(f)$ as a function of $f$. Let's say this function is given by

$$\big\langle h(f)^*,h(f') \big\rangle=P(f)\delta(f-f')$$

Here, the asterisk stands for the complex conjugation and the brackets means the ensemble average. $\delta(x)$ is the Kronecker delta. Let's assume that $h(f)^*=h(-f)$ and $P(f)\propto f^\alpha$ with $\alpha$ a real number.

Now, I want to generate $h(f)$ based on $P(f)$. How can I do that? Shall I simply set $h(f)=\sqrt{P(f)}$?

I will primarily use c++. Please give me some hints. Thank you!


texts: Sequential Non Linear Least Squares Problem

texts:
I have the the following non-linear function,
$$s(x;A_k,\mu_k,\sigma_k)=\sum_{k=1}^2 A_k \exp\left(\frac{-(x-\mu_k)^2}{\sigma_k^2}\right)$$
with unknown (but deterministic) parameters $A_k,\mu_k,\sigma_k$.

The received signal is as follows: $$r(x;A_k,\mu_k,\sigma_k)=t\cdot s(x;A_k,\mu_k,\sigma_k)+n(x)$$ where $n$ is standard white Gaussian noise and $t\geq 0$.

The task is to estimate/update the model parameters $A_k,\mu_k,\sigma_k$ online, when the next data point arrives, because the data points arrive sequentially.

Here the data points DO NOT ARRIVE randomly from the model. They arrive in the order as given by the model. Namely, the incoming points are first around zero level, then they increase, make a peak, and then decrease, and the same happens for the second exponent.

We know that $\sigma_1^2\approx \sigma_2^2$ and $\mu_2-\mu_1$ allows that two distinct peaks can be visible. The incoming values are allowed to be evaluated over a moving window of size $5\%$ or less of the whole data. All data points lying behind this window are simply lost, due to memory constraints.

I was thinking about using an iterative non-linear least squares algorithm but this method doesn't consider about how the data points arrive. It assumes that data points arrive randomly. However, in my case, with a few data points from the first exponent, if I know that those points are from the left tail, for example, and the noise level is low, I can even almost completly know $A_1$, $\mu_1$ and $\sigma_1^2$ but this is never possible with the regular non-linear least squares. Hence, my question is the following:

  What is the best method to solve this problem?


texts: is there a second order approximation to perceived loudness

texts:
Quoted from this

  As a first order approximation it takes ten times the energy to double the perceived loudness

So is there a 2nd order approximation. If so then how much change in RMS value doubles perceived loudness? Is it governed by any system of equations?

Thanks


texts: How to decipher this Microphone sensitivity Chart for Choosing a SPL meter

texts:
I have a mic having sensitivity chart as below which has relative dB on y-axis showing

  1V/0.1Pa

what does this convey how to read my mic's sensitivity

a document on microphone sensitivity from analog says the microphone sensitivity is measure with 1Pa pressure as reference

confused in half way after seeing my datasheet of mic

usually i was of the opinion that the microphone sensitivity is measure with reference to 20micropascals,but i read with this SPL measurements
so i am wrong

so if i have to buy an SPL i have to correlate my SPL with the microphone i am using

because if my microphone i am using in my application picks up some sound according to its sensitivity and the spl meter i am purchasing may not give me the required SPL level that i have detected

when i have seen the frequency Weighting curves of the SPL meter they are shown as below

what do these convey ? are they trying to attenuate some frequencies or they are trying to follow human auditory model

so if i have to buy an SPL meter having correlative sensitivity as of my microphone would be better,what is your opinion am i going the right way in selection of an SPL


texts:
I want to know the amplitude of the first-order hold filter at the Nyquist frequency (the roll-off amplitude/gain).

I know that the Fourier transform of the reconstruction is given by:

$$\sum^\infty_{k=-\infty}F\left(\nu - \frac{k}{T}\right)\ \mathrm{sinc}^2(\nu T)$$

which corresponds to low-pass filtering of the spectrum in the frequency domain by a $\mathrm{sinc}^2$ function. This causes some aliasing due to the sinc's sidelobes. However at the Nyquist frequency $\nu = 1/2T$, approximately we have the amplitude:

$$\mathrm{sinc}^2\left(\frac{T}{2T}\right)\approx0.4053$$

Is this close to the correct value? Also, how should I display this gain as a dB reading? MATLAB's mag2db function gives -7.8, not sure if that's right.


texts: Non Coherent BPSK with no Channel State Information at the receiver

texts: Where or what is the proof for the failure of BPSK in fading channel when we have no knowledge of the fading coefficient $h$ at the receiver in the equation $y=hx+w$, where $x$ is BPSK symbol equally likely to be $A$ or $-A$, $h\sim \mathcal{CN}(0,1)$, and $w\sim \mathcal{CN}(0,1)$.


texts: How is the Tx/Rx Gain calculated in USRP?

texts:
I know that USRPs are uncalibrated devices. In many exampls you can set the so called Tx or Rx gain (as in the picture below).

Now, I know that this does not correspond to the real power of the transmitter, nor is it a "gain" of the antenna - the most appropriate term here would be "transmitter channel gain", right?
So I would like to know how this transmitter channel gain process is implemented, how it is calculated, and how it works in practice (since a particular gain value doesn't correspond to a particular power level).


texts:
I have to implement a second order filter in DF1 or DF2. I should avoid housekeeping operations by suitable addressing strategies.

I don't understand what "housekeeping operations" means. Anyone could help me or propose a source i can find more information?

EDIT :

I use DF2 for the second-order filter:

As pichenettes proposes with Housekeeping the code in matlab is something like:

%x=input sample
%state=containing old input values
%compute output value
y=b(1)*x+state(2)

%Update states
state(2)=b(2)*x-a(2)*y+state(1)
state(1)=b(3)*x-a(3)*y

Without Housekeeping is going to be like:

%compute output value
y=b(1)*x+state(pointer+1);
pointer=rem(pointer+1,N-1); %increment pointer in modulo form, N number of taps

%Update states
state(pointer+1)=b(2)*x-a(2)*y+state(pointer+1);
pointer=rem(pointer+1,N-1);

%Overwrite oldest sum with b(N-1).x
state(pointer+1)=b(3)*x-a(3)*y;
pointer=rem(pointer+1,N-1);%Increment pointer modulo-(N-1)

Is that right?Any mistakes?


texts: How much will a low/high pass filter reintroduce quantization noise into a dithered signal?

texts:
For example, most audio signals are dithered prior to distribution. However, if a low or high pass filter is introduced after dithering or during playback, won't that negate some of the benefits of dithering? Is there any way of calculating the magnitude of the effect?

Many lossy audio encoders automatically cut around 16-18kHz. On a 48kHz signal, that's a good ~25% of the bandwidth gone, wouldn't that have a noticeable effect on the dither, and therefore the signal too? especially if there is noise shaping pushing more dither into the high frequencies?


texts: I have time domain history data. Then, I convert it into FFT to get the frequency domain history data. The problem is, how to determine the bandwidth of the FFT data? Is it automatically synchronize with my time domain history data? The bandwidth of time history data is $50 Hz$-$500 Hz$.


texts: how to detrend a carrier phase with butterworth filter?

texts:
I am new with detrending techniques, I have a carrier phase measurements and I want to detrend it by 6th order butterworth digital filter. After creating the digital filter I get its numerator (b) and denominator (a). The filter was created by

scipy.signal.butter(N, Wn, btype='highpass', analog=False, output='ba')

In this case, do I need only to multiply the carrier phase measurements by the output of the filter which is b/a or I need to multiply it by something else?


texts: System that has derivative of input is non causal

texts:
Consider a system $y(t) = \dot{x}(t)$ where $y$ is the output and $x$ is the input. Given an initial condition $x_0$ and two inputs $x_1$ and $x_2$ such that $$x_1(t)=x_2(t) ,  0 \le t < t_0$$ the outputs $y_1,y_2$ corresponding to $x_1,x_2$ respectively should satisfy $$y_1(t)=y_2(t) ,  0 \le t < t_0$$ since $$x_1(t)=x_2(t) ,  0 \le t < t_0 \implies \dot{x}_1(t)=\dot{x}_2(t) ,  0 < t < t_0$$
How is this system non causal then?


texts: What are physical scenarious which can be modeled as multiplicative noise?

texts:
Consider $s(t)$ as the signal, $w(t)$ as the noise, and $y(t)$ as the captured signal. Usage of additive noise model, that is $y(t)=s(t)+w(t)$, is quite wide spread, example in speech and audio signal enhancement, and is also physically convincing to hypothesize. The convolutive noise model,that is $y(t)=s(t)\star w(t)$, where, delayed copies of the signal overlap together is another widespread model. A physically relevant scenario for this is reverberation modelling.

My question is - Is there a physical motivation to model noisy signal using multiplicative noise model, that is $y(t)=s(t)w(t)$? I am unable to think about any convincing physical domain examples where this happens in reality.


texts:
I am reading Smartphone based Blood Pressure Monitoring via the Oscillometric Finger Pressing Method, which is trying to estimate blood pressure from a PPG sensor and a small applied force finger sensor. I am not an engineer, so I'm unfamiliar with a lot of the terminology.
In this paper, they describe using the ppg sensor measurements to estimate an average heart rate. The single sentence that describes this process is "The average heart rate is determined
from the blood volume waveform based on its spectral peaks within the
frequency range of 0.5 to 3 Hz".
I have a ppg sensor, so I can take a time series measurement of the blood volume, but frankly, I have no idea what this sentence means other than it involves some kind of spectral analysis. I'm unable to find any similar descriptions of this algorithm in google scholar. I would really appreciate it if someone could interpret and translate this sentence into either an algorithmic, or statistical terminology, which I am much more familiar.


texts:
Is there a better way to increase Recall Rate when using SIFT features?
I am thinking a way to replace the NN1/NN2 ratio to account for slightly distorted objects.
Moving towards clustering and using BOW(Bag Of Words) seems a way but I need to do one-on-one match of objects in images rather than training and learning. This refrains me from thinking towards BOW.

Anybody got any idea?


texts: I am looking for some help to understand the concept how RLS converges? If possible to present it graphically that would be best. It is very easy to understand the understanding of convergence in case of LMS Algorithm but i am not being able to graphically visualize how its happening in case of RLS. How the cost function surface is being formed combining all previous weighted error? and How the weights are approaching towards optimum value on that surface?


texts:
In my Signal Processing class we just learned decimation however after messing around in Matlab trying an example of decimation, I just can't understand what's happening.

I get the introducing twi zeros between samples and the after filtering steps however I don't get how the original signal comes to look like that in the decimated step(EDIT: M=3).


texts:
I have a set of GPS satellite signal data, the set is 1 ms long and has the information of two satellites (satellite number, code phase and frequency) buried in noise. This data has a carrier frequency of 4.309 Mhz and the sampling rate is 5.714 Mhz.I've been reading but I don't really have pretty clear what to do:

which are the options to make the acquisition? As far as I've read, there are two options: time and frequency based acquisition. which is the best option to use?
The set of data is noisy and continuous:

I have generated the C/A gold sequencies sampled at 5.714 Mhz in order to perform the correlation with the satellite data. How can I design a narrowband filter to get rid of the noise? The local coded I generated are sequencies of +1's and -1's. Do I need to convert this data also into -1's and +1's to perform the acquisition?


texts: Pinhole camera model from houdini parameters

texts:
From a simulation with Houdini software I retrieved these parameters:

Camera position: -0.675839, 33.5945, 0.0318854
Camera Rotation: 0.0318854, 92.4693, 0.1
Focal Length: 52.5172 mm
Image size: 1920 x 1080
Pixel Aspect Ratio: 1
x aperture = 41.4214 mm

I am not sure about how to build the system for transforming 3d coordinates of the scene to 2d image coordinates, in particular how to derive and combine rotation-translation matrix, camera-matrix transformation, and image transformation.

Do you have any suggestion?
Thank you


texts: Isolation of a signal in a frequency band

texts:
I have a continuous signal. I digitize it at 40kHz. A useful signal for me is in the range of 500-1500Hz and takes ~ 50-100Hz. It can be located in any part of this strip at any time.

If I apply a digital bandpass filter at 500-1500Hz, I will select the signal I want from the entire band, and along the way I will collect all the noise in the 500-1500Hz band. To reduce noise, I divided this band into 10 bands of 100 Hz (also with digital bandpass filters) and from them I choose the one with the largest signal. At the same time, I do not collect noise across all bands, that is, I have improved the signal-to-noise ratio.

But there are moments when the signal is on the border of my 10 filters, that is, part of it falls on one filter, part on another, and I lose signal-to-noise ratio.

An obvious option for me is to split the 500-1500Hz band into more bands, but the computational capabilities of my microcontroller are limited, and I cannot afford to increase the number of filters anymore.
Is there any good way to select a signal located in the 500-1500Hz band without collecting noise from the entire frequency band? I also wonder if there are 2 such signals in my 500-1500Hz frequency band, how can I do in this situation? And will it be possible to unite them? Perhaps the Wavelet transformation will help me, but in the Internet I did not find any information on how it can be implemented on a microcontroller.


texts:
According to this paper, coherence is assessed by

Identifying the maximum peak in the 0.04–0.26 Hz range of the HRV power spectrum,
calculating the integral in a window 0.030 Hz wide,
centred on the highest peak in that region,
and then calculating the total power of the entire spectrum.

The coherence ratio is formulated as: (Peak Power/[Total Power − Peak Power]2)

I have a list of rrInterval from heart-rate variability (HRV). I proceed with the data with FFT using Welch's method. I'm new to signal processing and stuck at Python code, what should I do next? My goal is to calculate coherence ratio in HRV.

Python

from scipy import signal
x=[901,823,930,888,955,846,793,831,798,837,845]
fs = 10e3
f, Pxx_den = signal.welch(x, fs, nperseg=1024)


texts: Sensor fusion with accelerometer and gyroscope only

texts:
I need to track an object in 3D-space and I can use only accelerometer and gyroscope. I can't use a magnetometer because the object itself has a strong magnet.

I need to know the orientation of the object (how much gravity there is in $x, y,$ and $z$ components), and how much acceleration there is in $x, y,$ and $z$. I'm not trying to calculate the object's absolute position.
Is it possible to create sensor fusion that has less than $10\%$ error in gravity and acceleration? At this point I'm just trying to understand if this goal is realistic.

I did a quick experiment with my smartphone and found out that the way it calculates gravity (LPF?) results $\approx 40\%$ error when phone is moved.

This was just a test: I'm not making phone app. I'm designing dedicated HW.

I'm just posting here a pic to show how the "gravity sum" looks like after fixing the math as suggested by Maximilian.


texts: Output of an LTI system given its transfer function and input

texts:
Given the transfer function $$T(s) = \frac{100}{1 + \frac{s}{10^{6}}}$$ and the input $$v_i(t) = 0.1 \sin(100t)$$ find the output, $v_o(t)$.

My approach was to use $v_o(t) = \mathcal{L^{-1}}\left\{T(s)\ V_i(s)\right\}$, where $V_i(s) = \mathcal{L\left\{v_i(t)\right\}}$. This gives

$$v_o(t) = \left(\frac{10^5}{10^8+1}\right) \mathrm{e}^{-10^6 \,t} - \left(\frac{10^5}{10^8+1}\right) \cos\left(100\,t\right) + \left(\frac{10^9}{10^8+1}\right) \sin\left(100\,t\right)$$

in MATLAB. However, my textbook does the following:

Which one is correct? The difference between the two functions is of the order $10^{-3}$, and the first function is not reducible to the second in MATLAB.

Edit:

This is the whole question — Example 1.5 from Sedra & Smith's Microelectronic  Circuits (7th ed.):


texts:
As the title suggests , I'm looking for good books on medical imaging . It would be a great help if you can provide a link to the books website .

Thanks.


texts: Help finding the output for input with conditions

texts:
I'm trying to find the output where $h[n]$ is the impulse response of a real stable causal LTI system, and $s_0 \epsilon \mathbb{R}$, and where the input is $x[n] = e^{2\pi i n s_0}$ for $n \epsilon \mathbb{N}$.  Supposedly my answer should be a compact formula with no infinite sums...

So since since my system is causal I obtain, $y[k] = e^{2\pi i ks_0}\sum_{n=0}^{\infty}h[n]e^{-2\pi i ns_0}$.  From here I can conclude that since the system is stable this series converges, but without knowing more information about $h[n]$ I can't see any way to further simplify the expression and rid myself of this infinite sum.  Of course I also know by assumption that $y[k],s_0 \epsilon \mathbb{R}$, but I can't see anyway to use this fact without, again, knowing more about $h[n]$.

I suppose my sum is looking a lot like the standard Fourier transform but I don't see how I can use that with out, once again, knowing more about $h[n]$.  Hopefully someone can help me here, thanks.

Edit: Could it be that a real system implies that $h[n]$ is real?  Although that's still not enough info to allow me to find a closed form for this series.

Edit 2: Or could "real" in this context be referring to a system which is actually implemented?


texts: Dynamic Time Warping of inverted binary signals

texts: I am trying to find a match between a reference binary signal and a large set of data. From experience, the reference signal can appear time-shifted(that is why I've chosen dtw) and inverted, meaning a reference [101] may be represented as [010]. Is there a clever metric that i can use, or some alterations of the signals (some kind of norming before dtw), such that, in a single pass, i can check both normal and inverted bit signals? The obvious and labourish way would be to analyze the bit signals, revert them, and make a second dtw pass, but i'm trying to beat that.


texts:
We apply compressive sensing to reconstruct a signal if it is sparse in the original domain or has a sparse represetation in some basis.

How we may know a if a signal is sparse or has a sparse represetation ?
Is a radar received signal sparse or has a sparse representation ?


texts:
I am trying to design the Symbol timing recovery(#STR) block of #DVBS Receiver. These are the specifications

Symbol rate ($f_s$) = $2\textrm{ MHz}$
Acquisition range = $10\%$ of Symbol rate
Acquisition time = better than $50\textrm{ ms}$
Interpolation rate = $4$
Roll off factor = $0.5$
Symbol time ($T_s$) = 1/$f_s$
Sample time ($T$) = $T_s$/Interpolation rate =  $T_s$/4

The main thing I need for the design is to find out the loop filter coefficients $\mathbf{K1}$ and $\mathbf{K2}$ of PI filter which depends on $\zeta$, $B_n$, $T_s$(symbol time), $K_d$(TED gain) and $\mathbf{K0}$(VCO gain).

I am referring to the book Digital Communications: A Discrete-time Approach by Michael Rice, Appendix C, for the design of the loop filter.

From the acquisition range specs, I found:

The term $B_nT_s \geq 0.01125$.
Acquisition range $\approx$ $2\pi B_n\sqrt 2 \zeta$.

Besides I also figured out the following values

$K_d :(\text{I found out from S-curve})= 0.1751$  [Gardner TED]
$\mathbf{K0} =1$
$\zeta = 1$

I calculated $\mathbf{K1}$ and $\mathbf{K2}$ from these, but when I am simulating the timing recovery design for noise-free channel, it is not working. I found out through trial  that $B_nT_s$ factor should be in the range $0.005$ for retrieved symbols bit amplitude close to the original symbol bit amplitude, not $0.01125$ which I got from my calculation. I am not understanding what possible mistake I could have done with calculation. Or I am missing any important factor in the calculation of $\mathbf{K1}$ and $\mathbf{K2}$.

This is the equation for loop filter coefficient $\mathbf{K1}$
$$
 \mathbf{K0}\cdot K_{d}\cdot \mathbf{K1} = \frac{4\zeta\left (\frac{B_{n}T}{\zeta+ \frac{1}{4\zeta}}\right )}{1 + 2\zeta\left ( \frac{B_{n}T}{\zeta + \frac{1}{4\zeta}} \right ) + \left ( \frac{B_{n}T}{\zeta + \frac{1}{4\zeta}} \right )^{2}}
$$


texts: Discrimiation between human speech and computer generated one

texts:
I'm currently working on voice activity detection (VAD) theme and I just started to wonder - if computer generated speech (as when using voice generators) can be discriminated from human speech with classic VAD approaches (ex. 4Hz energy modulation, zero-crossing ratio, modulation entropy, short time energy, MFCC coefficients).

Or - from mathematical point of view - are they just the same signals (or with very similar characteristics)?


texts: Kalman Filter: Difference between sensor input and control input

texts:
I recently saw a matlab sensor fusion example which combined IMU and GPS data for drone localization.
What was surprising about it was that the IMU was used to predict future behavior of the system as if it was a control signal. Basically the IMU reading was read and then integrated over a time step to create a prediction for the next location of the drone which was then fused with the GPS reading.
This is confusing to me as in principle both the IMU and the GPS are sensors and not control inputs.
Could someone explain in more detail when you are supposed to consider something a control input to a system vs a sensor input? I always assumed control signals were things like motor velocity control which evolved the system state using linearized dynamic equations but this matlab example has kind of blurred the line for me.
In principle could any sensor reading be viewed as a control input if you can evolve the system state from it?


texts: Tetrahedral microphone array beamforming

texts:
I have a microphone array of 4 channels taken as channels [6,10,22,26] from Eigenmike spherical microphone array. I wish to do 3D beamforming and create $8\times 4$ beams, 4-elevations with 8 wavefronts per elevation equally distributed.

I can't seem to work out the math as to the delays between the microphones. I also can't find an "off the shelf" code for that. This is my first beamformer so I am not even sure I am not missing anything. Is delay and sum process all I need?

What are the equations for determining the delays between the channels per beam?
Do I need any other equations to create a beamformer?

Specifically, I am trying to create beams in direction from all possible combinations of $\varphi_s \in \{-\frac{3\pi}{8},-\frac{\pi}{8},\frac{\pi}{8},\frac{3\pi}{8}\}$ and $\theta_s\in\{-\frac{7\pi}{8},-\frac{5\pi}{8},-\frac{3\pi}{8},-\frac{\pi}{8},\frac{\pi}{8},\frac{3\pi}{8},\frac{5\pi}{8},\frac{7\pi}{8}\}$.

My microphone array contains 4 microphones $m_i=(r_i,\theta_i,\varphi_i)$, at the following positions:
 \begin{pmatrix}
  0.042 & \frac{\pi}{4}  & \frac{7\pi}{36} \\
  0.042 & -\frac{\pi}{4} & -\frac{7\pi}{36} \\
  0.042 & \frac{3\pi}{4} & -\frac{7\pi}{36} \\
  0.042 & -\frac{3\pi}{4} & \frac{7\pi}{36}
 \end{pmatrix}

$r_i$ is in meters.
$\varphi_i, \theta_i$ are azimuth and elevation respectively, according to the microphone's documentation, given herein radians.

A quick sketch of the configuration from two views. Note that the distance of all mics is 42mm from the origin:

$(x,y,z)$ values in this system is extracted in the following manner to my understanding:
$$x=r\cdot \cos(\varphi)\cdot \cos(\theta)$$
$$y=r\cdot \cos(\varphi)\cdot \sin(\theta)$$
$$z=r\cdot \sin(\varphi)$$


texts:
I have a vibration signal coming from a motor measured from accelerometer (Irregular Time series) and I need to use these signals for analysis purpose.

I am in need to transform this signal to some form for analysis purpose. I read few blogs and websites containing vibration signal processing technique. The basic thing is to transform the signal from time domain to frequency domain.

So I used the fft function to transform using R

X.k <- fft(signal)

plot.frequency.spectrum() plot a frequency spectrum of a given fft [Link: here]

plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  plot.data  <- cbind(0:(length(X.k)-1), Mod(X.k))

  plot.data[2:length(X.k),2] <- 2*plot.data[2:length(X.k),2]

  plot(plot.data, t="h", lwd=2, main="",
       xlab="Frequency (Hz)", ylab="Strength",
       xlim=xlimits, ylim=c(0,max(Mod(plot.data[,2]))))
}

The frequency spectrum of this fft looks like this

The first peak is extremely high. I don't know why this happens as am new to signal processing techniques. I cannot use this for analysis purpose and do prediction as it will end in bad results. Any other ways to do this method? Or do I need to use other techniques?


texts: Image Matrix Vector Representation for the Degradation Model

texts: I am trying to understand the the degradation model equation but I have doubt that how come y^t.x.h will be equal to  x^t.h^t.y . Aren't they transpose of each other.


texts: representing simple definite integral as convolution in matlab using CONV

texts:
A definite integral is a convolution with idial all '1' filter(by the theory)
so i tried to test this issue with MATLAB.
i have taken a function called fun made an integral over it in 1e-6 - 20*e-6 interval the result is called  simbolic_int_result which 37.7
then i have taken fun sampled it in 1e-6 - 20*e-6 interval as shown bellow with 1000 samples and created all "1" filter (idial)
and used CONV to make convolution,but its not working, instead of a scalar i get 2000X1 vector
Where did i go wrong?
Thanks.

c0=2.997*10.^8;% m/s speed of light in vaccum
h=6.625*10.^-34;% J.s Planck constant
k=1.38*10.^-23;%  T/K Boltzmann constant
n=1;

T=307;%  Temperature initiatlisation
fun=@(lambda)(2*pi.*h.*(c0.^2))./((n.^2).*(lambda.^5).*(exp((h.*c0)./(k.*T.*lambda))-1));
simbolic_int_result= integral(fun,1e-6,20e-6)/10;

k=linspace(10.^-6,20*10^-6,1000);
fun_vector=fun(k);

filter=linspace(1,1,1000); % all ones idial filter

convolution_result=conv(filter,fun_vector);


texts: Calculating Signal Approximation Error (Theoretical signal - Real hardware signal)?

texts:
I've got a FIR filter, which I developed in IC. Now, when I got my results, I ended up with two signals:

Theoretical signal calculated through MATLAB as a response to my input.
Real response given by the hardware.

What is the best method of calculating the error of the real response with respect to the theroetical one?

I could go

delta = abs(Y) - abs(Yreal);
max_err = max(delta);

but I don't know what to do with the maximum error? Any suggestions?


texts: Can complex envelope be writen in the form of quadrature components when it has symmetric spectrum?

texts: I am reading a chapter on VCO noise in "Design of CMOS phase-locked loops from circuit level to architecture level by Behzad Razavi";I am confused when the upconverted noise is writen as $N_I\cos\omega t - N_Q\sin\omega t$, which means the baseband noise(complex envelope of the upconverted noise) have a form of $N_I+jN_Q$; I have this confusion because I think the complex envelope has symmetric spectrum which implies it is real signal so Nq should be 0; please help me understand this, thanks!


texts: The model of noise in Image denoising problem

texts:
I am studying the image denoising problem. The paper I studied uses Gaussian Noise to model the noise appearing on the image. E.e., If we say $u_g$ is a clean image, then we model the noisy image $u_0$ so that $u_0 = u_g+n$ where $n$ has Gaussian distribution with mean $0$ and variance $c$.

Q1: I am wondering why are we using Gaussian distribution to model the noise? Any theory behind it?

Q2: Can we use stochastic processes to model the noise? If so, is there any existing literature?


texts: Time Setting of $z$ and Laplace Transforms

texts:
I'm aware that the z-transform and the Laplace Transform have an analogous relationship but I want to be doubly-sure that the z-transform only works in discrete-time and that the Laplace transform only works in the continuous time settings?

Thanks.


texts: Efficient Convolution Without I/O Delay (Gardner 1995) implementation

texts:
I am trying to perform real-time convolution on an audio stream using a fairly large FIR for convolutional reverb.

I found a great paper explaining how to do just that: Gardner, 1995. But, I'm new to this field and I'm still confused about some of the details and how to implement it.

Does anyone know of an open source implementation of this algorithm? I have been looking and can't find one.
If not, would anyone be willing to write some pseudo code for the actual steps of the algorithm or help try to clarify some of my confusions? Thanks!

What I understand: I get the general idea. I understand that naive convolution is slow and overlap-save DFT convolution is faster but has high latency. This paper uses a combination of the two. It uses plain convolution for the first bit of the FIR to buy time to accumulate enough data to run DFT on the rest of it.

What I don't understand: I think for many people the job scheduling and interrupts that you would need to actually implement a uniform CPU load version of this algorithm would be the daunting part, but I actually feel fine about that. What I'm confused about is the actual steps to the algorithm. Specifically:

A single audio data point comes in. What happens? The algorithm must produce a single point of output. Which convolutions/multiplications are we doing in that tick under which conditions?
Are we performing the overlap-save DFT convolution for each block of the FIR every tick/point? The language of the paper would imply not. But if not, then wouldn't the correct result change with every tick because the offset of the FIR would change with respect to the input stream?

Thanks for your help!


texts: What is the Sound of a Solution to the Wave Equation?

texts:
What is the sound of a solution $y(x,t)$ to the Wave Equation

$\frac{\partial^2y}{\partial t^2}=c^2\,\frac{\partial^2y}{\partial x^2}\enspace$?

To be clear, I don't look for a solution of the Wave Equation, I have a concrete solution $y(x,t)$. I only want to describe the sound of this concrete solution.

In my case I want to describe the sound of a vibrating string, so the ends of the string are fixed, i.e. $y(0,0)=y(L,0)=0$ where $L$ is the length.

With a solution $y(x,t)$, I get perfectly the shape of the string between $x=0$ and $x=L$ for every time $t$.

I can show that $y(x,t)$ must be also $2L$-periodic according to $x$, i.e. $y(\lambda+2L,t)=y(\lambda,t)$, and $(2L/c)$-periodic according to $t$, i.e. $y(x,\lambda+2L/c)=y(x,\lambda)$.

To describe the sound, I would like to

find a frequency spectrum (or magnitude/amplitude spectrum) or
produce a sound file with a series of samples $x(i)$ to hear the vibrating string.

For 1. I don't know how to do that. Should I develop the Fourier-Series according to $x$ or to $t$ (a Fourier-Series exists, because I've showed the periodicity) or do complety other things? For a Fourier-Series according to $x$, the Fourier-Coefficients $a_k,b_k$ depends on $t$ and for a Fourier-Series according to $t$, the Fourier-Coefficients depends on $x$.

Any idea?

Edit:

Here is an example for a string that get plucked at $x_p$ with a displacement of $h$. Its shape is a triangle as follows:

$y_0(x)=
\begin{cases}
x(h/x_p)&\text{if}\enspace 0\leq x < x_p\\[1ex]
h\left(1-\frac{x-x_p}{L-x_p}\right)&\text{if}\enspace x_p \leq x \leq L
\end{cases}$

The initial velocity is 0 so finally the string is described as:
$y(x,t)=y(x,t)=\frac{1}{2}\left(y_0(x+ct)+y_0(x-ct)\right)$

In the following picture, you can see the process of the string starting at $t=0$


texts: I have difficulty in understanding what is Hue and Saturation. please explain what is hue and saturation to me with an example or analogy.


texts: Spatial Audio (Ambisonic) and calculating sound source position

texts:
I have 4ch Spatial Audio (Ambisonic) WAV file and I want to calculate sound source position and put it on 2D plane.

What I know so far is the following:

WAV file consists of signals that support of 360 video playback

Channel 1 = omnidirectional sphere (named W: $w(t) = p(t)$)
Channel 2 = left-right dipole (named Y: $y(t) = \sqrt{2}p(t)\sin(a)\cos(b)$)
Channel 3 - has no data
Channel 4 = front-back dipole (named X: $x(t) = \sqrt{2}p(t)\cos(a)\cos(b)$)

How to calculate sound source position at any point of time using these data?

Edit:

calculation like this gives mess:

theta = Math.Atan2(y, x);
px = r * Math.Cos(theta);
py = r * Math.Sin(theta);

Edit 2:

So imagine we have Spatial Audio/Ambisonic/B-Format WAV file
and we need to draw/visualize a microphone in the center of screen and a sound source around the microphone at any time reading WAV file

Edit 3:

We use H2n SPATIAL AUDIO mode that gives 1 WAV file with 4 Channel
Using the suggested wiki-formula here is our result for first 1000 ticks using MatLab (does not look proper):


texts: Special case peak/notch filter for exactly 1/32 sampling rate?

texts: I need a filter at 1/32 my sampling rate. Because it's 1/2n, I was thinking there might be a special case filter for this case. Anything like this?


texts: What are the missing steps in the derivation of this equation?

texts:
I am trying to understand the model of a piano hammer described here. The relevant excerpt is:

As I understand it, they are saying in (12a) that if the hammer spring's uncompressed end's y position is greater than the string's y position, then the force of the hammer/spring will be:

$F = Kh(yh(t) - ys(t))^{Ph}$

(12b) is simply saying force is also equal to negative mass of the mass-spring combo times its acceleration. This is Newton's law I believe, where the spring's force (12a) must equal the mass's inertial force (12b).

The derivation of (13a) is straightforward since there's no change.

(13b) I'm having trouble understanding though. The best I can do is use the differentiation theorem for Laplace transforms described here:

$f(t) = m*a(t)$

$f(t) = m*s*v(t)$

$f(t) = m*s^{2}*y(t)$

$y(t) = f(t)/(m*s^{2})$

Is this what they did? If so, what is the type of substitution they did for $s$ here? I have been told about the Euler and Tustin method in another thread. What is this?

Also what is meant by the extra $z^{-1}$ at the end of (13b)? I was told multiplying by $z^{-1}$ means you just delay the whole equation by 1 sample. Is that what they're referring to to solve the problem they describe at the end?

Lastly, how would you rewrite/adapt these equations to accommodate an initial velocity for the mass component? ie. An excitation impulse velocity at time 0, ie. v0?

I have this example for a simple mass with v0 as the initial velocity:

But I'm not exactly sure how that really works. I mean, you end up with:

$a(s) = s*V(s) - v0$

How would you go one step further to describe $a(s)$ in terms of $y(s)$ while still maintaining the $v0$ parameter in there?

Thanks for any guidance.


texts: Why can't DFT be used when samples are not equally spaced in time?

texts:
I found the following comment here

  The DTFT can be used when the samples are not equally spaced in time, the DFT cannot

My initial thought was that this had to do with periodicity of the basis complex exponential in DFT, but then this issue is unrelated to the uniformity of sampling itself.

What is the correct explanation here ?


texts: Finding periodicity within sequence of time hacks

texts:
I have a series of time hacks for various events that have occurred.  Some of these events occur at regular intervals (+/- some small variance) but I do not know what those intervals are and would like to find out.  As a overly simplistic example, let's say I have a series of events that have a relative times of:

1, 2, 5, 7, 8, 10, 11, 15, 16, 18, 20, 24, 25, 30, 32, 35, 39, 40, 41, 42, 45, 48, 50

There are two series that occur; one every 5 seconds and one every 8 seconds.

How can I find these interval periods if I have a subset of data, am starting at an arbitrary start point and can take into account the minor variances that occur when recording time?  Is FFT the right way to go or is there something simpler such as just calculating differences and find all the multiples with a given tolerance?


texts: Eliminating inertia effect from the acceleration signal

texts:
I am struggling with a problem, and would be happy if you could assist me. I put an accelerometer sensor inside a spherical enclosure, and release it to the water. While it was translating in the flow, I recognized that the enclosure was also wobbling (like a kicked pendulum), which I think that it is likely caused by the inertia of the enclosure. I then added some weight inside the enclosure and observed that the peak was more pronounced. Left panel is the spectra of the acceleration magnitude for three different tests without additional weight (inertia is only described by the sensor + enclosure + battery).

Since the sensor is like a black box (I do not know the mass distribution inside so that I can try to match it with the geometrical center of the enclosure), I would like to find a way to exclude the effect of the wobbling in the signal without disturbing it because the wobbling might also affect the lower frequency part of the signal, as seen in green line in page 118.

Based on the comment below, I have added the spectra after notch filter. Notch filter does its work very well, and attenuated the signal in the region (2 - 5 Hz), without affecting the rest. However, the oscillations (around 3.5 Hz) likely influences the lower frequency range of the spectra. Is there any quantity that I can derive to see the effect of these oscillations in the lower frequency range or any function that I can try to model the effect of inertia? Any ideas and suggestions would be appreciated.


texts:
I have applied FFT on a random noisy signal (say for ex, on some stock data).
Below figures shows input and output. Now, my question is, how to extract useful peaks (frequencies) from the output? Can FFT be useful on such random data?


texts:
I want to calculate Morlet time and frequency resolution. the Morlet wavelet function is define as : $\psi(t)=\frac{1}{\sqrt{\pi f_b}}e^{j2\pi f_c}e^{-t^2/f_b}$
Note: I know the answers, but I don't know how to achieve it on my own.I want someone to explain the time and frequency resolution relation to me please. here are some hint that I got from paper and might help you.
in some paper I found that Morlet wavelet time and frequency resolution is :
 $\Delta t=\frac{f_c\sqrt{f_b}}{2f_i}$
 $\Delta f=\frac{1}{2\pi f_c \sqrt{f_b}}$
Because generally, the wavelet time and frequency resolution is define as:
$\Delta t=s \Delta t_\psi$   and    $\Delta f= \frac {\Delta f_\psi}{s}$  (1)
where 's' is scale. it is also evident that the frequency and scale are related to each other by $f_i=\frac{fc}{s_i}$ .   $\Delta t$ and $\Delta f$ are wavelet time and frequency resolution,respectively. $\Delta t_\psi$ and $\Delta f_\psi$ are morlet function time and frequency resolution which are as follow:
$\Delta t_\psi=\frac{\sqrt{f_b}}{2}$ and $\Delta f_\psi=\frac{1}{2\pi \sqrt{f_b}}$ (2)
the Heisenberg uncertainty principle also says: $\Delta t \Delta f >= \frac{1}{4\pi}$
Basically i want to prove (1) and (2). other things can be obtained by substituting.
Thanks


texts:
In reading a paper on demodulation there was this sentence:

  "Using complex-envelope notation, the noise corrupted waveform at the
  IF filter output can be written as...".

I've not heard this term, what does the complex-envelope notation mean?

The equation below that statement is:

$$z(t) =  \mathrm{Re} \left\{ \widetilde{z}(t)e^{j2\pi f_0t+\theta} \right\}$$


texts: Convolution vs multiplication vs polynomial multiplication?

texts:
Apparently these 3 terms are some how similar but what is exact difference between them?please kindly explain with example, because the number of terms in result/output are different in all 3 cases

Especially in  context of signal processing, when do we need to multiplication, when we need to do convolution and when we need to do polynomial multiplication?


texts:
I am taking the PSD of the output of an RTL-SDR with Welch's method.  The output is an array like: [1.34225796e-07   1.37964799e-07   1.24558405e-07, ....].  I'd like to convert this array to dB, so that I can find the point 3dB down from the center (which in this case is the first element of the array, because I am not using fftshift.)

How can I do this?  I don't understand the units given in the PSD in this case, nor how to convert them to dB (one problem follows the other).  I understand that the RTL-SDR output is not wrt some known unit (i.e. it's not dBm, but dBFS.)


texts:
I'm trying to understand what frequency domain is. I found general explanations on the Internet, for example:

frequency-domain graph shows how much of the signal lies within each given frequency band over a range of frequencies
Fourier transform refers to both the frequency domain representation and the mathematical operation that associates the frequency domain representation to a function of time.
Fourier series transform a signal from time domain to frequency domain.

But I could not find an example which shows how I can obtain the frequency domain graph using the formula of a signal.
The graphs I found are sometimes discrete like this one:

and sometimes continuous like this one:

that seems confusing.
Suppose I have a signal $x:\Bbb R\to \Bbb R$ defined by the formula $x(t) = \cos(6\pi t)e^{-\pi t^2}$.
It's clear how to plot its time domain graph, But how can I find its frequency domain function or graph?
Should I apply fourier transform on it?:
$$\widehat{x}(\tau)=\int_{-\infty}^\infty \cos(6\pi t)e^{-\pi t^2}e^{-2\pi t \tau i}dt$$
Does plotting this new function give the frequency domain graph? (but it is complex valued, how can it be plotted?)
Or should I find the Fourier series of $x(t)$ and plot the series coefficients discretely?
So my only question is: How can I mathematically obtain the the frequency domain function (and then plot it to get the frequency domain graph) using the formula of $x(t)$?


texts:
I am looking for a way to describe the properties of voltage fluctuations - is the RMS amplitude a suitable measure? Attached is a screenshot showing the random current fluctuations (in the case of strong noise this corresponds to a random walk)

EDIT:This random walk is the voltage fluctuations in a programmed neuron model. The "resting voltage" is $-65mV$ - this can also be seen as the "starting point" of the random walk. I would now like to be able to measure the "magnitude" of the fluctuations.
The data vector looks like this $v[i] = (-65,-65.12,-64.63.....$)
for i=1000 time steps, for example.
But if I calculate the RMS value, I get a value that is more or less the same size as the average (i.e. 64.3mV), which is nonsensical... I may also be measuring it wrong, but according to Wiki:
$$RMS= \sqrt{\frac{1}{n}\sum_{k=1}^n x_k^2}$$


texts:
I have a question regarding Modulation and Demodulation.
In question 5.21 (b) from the "Discrete-time Signal Processing" book by Oppennheim, he asks to find out the type of filter used in the attached figure:

The question is what is the effect of $(-1)^n$ on the original filter and y[n].
I saw the answer to be high-pass filter, but I am not sure why.
Please help

Thanks


texts: Why complex numbers are represents as a+ib and can't be as (a,b)?

texts:
I am confused as why do we need to represent the complex numbers with the imaginary y-axis if we can simply represent them as (x,y) ?

I've read that Multiplication by i is an anti-clockwise rotation of a quarter-circle over y-axis.

Multiplying 1 by i gives i. Multiplying i, by i once more, does another quarter-circle and gives -1. So, multiplying by -1 means a rotation of a half-circle. That is the meaning of i*i=-1.

So what does that supposed to mean ?

Suppose, I am solving an equation and I ended up with an answer like 3i does that mean i've moved from x-axis to y-axis by half-circle counter clock wise ? I couldn't be able to visualize this properly


texts: Finding preferred pair of $m$-sequence for Gold code

texts:
I would like to find a preferred pair of $m$-sequence of degree 34 (not a multiple of 4) for Gold code. However, I am lost when I am checking William Wesley Peterson's table in his Error-correcting Codes, Appendix C

I tried first fix the first entry for my first $m$-sequence. To find the other sequence, since $n = 34$, it is even, then
$$2^{\left(\frac{34+2}{2}\right)}+1 = 2^{18} + 1$$
or
$$2^{\left(\frac{34-2}{2}\right)}+1 = 2^{16} + 1$$
But either number is not mapped to any entry in the table that I cannot proceed to find the other $m$-sequence. I assume I should find the other $m$-sequence which has the equivalent root of
$$r^{\left(2^{\left(\frac{34+2}{2}\right)}+1\right)}$$
or
$$r^{\left(2^{\left(\frac{34-2}{2}\right)}+1\right)}$$
To elaborate, the following is what I consider as an easy case of prefered pair of Gold Sequence using Peterson's table and Gold's theorem, presented in this paper. I have no access to Dixon's book therefore I don't know what the correct procedure is.

The author applying the equation in the conjugate form of Gold's theorem in Gold's paper


texts: Calculating a homography based on detected lines

texts:
I know you can calculate homographies from image to camera plane using correspondence points between a "perfect model" and the image points.

I'm doing it for a football pitch/field, and have used edge detection to find the white lines in the pitch.

But the camera does not (always) cover all of the pitch, so I can't see all the corners... and I only the corners are 100% known points in the model (no other distinguished points).

So the problem is that unless the line intersects with another line and forms a corner, I only know the image points of the line, not it's corresponding "perfect/real-world" coordinates in the model.

Is there some way I can use the detected lines to calculate a homography, or even just a set of candidate homographies, even if the detected lines do not intersect with each other and create a corner?

Example image, showing the pitch, our field of view, and the points of the pitch where I can know the corresponding realworld/model coordinates(green circles), and an example of 2 lines that might be completely useless since in our field of view, I have no clue exactly at which point they start or stop in the corresponding realworld /model of the pitch:

The red lines are examples of lines which I would like to use, but I don't know their realworld coordinates, and it's kind of hard to estimate them because depending on the camera pose, the correspondent points could be "anywhere".


texts:
Is there a relationship for calculating the number of samples ($N$) that must be used in order to minimize spectral leakage of a discrete time signal.

For example, given a signal

$$x[n] = \sin(2\pi f_0 n T)$$

and $f_0 = 5, T = 0.02, n = 0, \ldots, N-1$, and no information regarding the sampling frequency, how do we choose the value for $N$?

I saw somewhere that $N$ would be equivalent to the sampling frequency, yet again, assuming that isn't available, is there a way of obtaining $N$?


texts: Distance from an object.. Where is the camera origine?

texts:
I compute the distance from an object (Chessboard) using OpenCv and my camera parameters using those steps:

findChessboardCorners

solvePnP

->Distance

The distance I get is between two points: the chessboard and the camera. My question is where is the origine of my camera?

I know perfectly about my Chessboard but not my camera in terms of reference.


texts: How can create a .wav bar based spectrogram on matlab?

texts:
How can I create a bar based spectrogram that updates as a .wav file is playing. This is commonly found in music players. Here is an example below:

I am able to display a amplitude/frequency graph that updates as the .wav file is being played using this code below:

function syncPlayerDemo()
%some example music
%set up audio player
%player = audioread('test.wav');
[y,Fs] = audioread('test.wav');
player = audioplayer(y, Fs);
[samples,channels]=size(y);
%calculate timeline
t=linspace(0,1/Fs*(samples-1),samples);
%initialize full plot, update will only move the visible area using xlim
h=plot(t,y);
%set up callback to update every <TimerPeriod> s
player.TimerFcn=@timerFcn;
player.TimerPeriod=0.1;
player.playblocking()
end
function timerFcn(source,data)
%an area of length <area> s will be visible
area=1;
position=(source.CurrentSample-1)/source.SampleRate;
%move visible area, current position is in the center
set(gca,'XLim',[position-area/2,position+area/2]);
%used a waitbar for testing, might be commented in
%waitbar(source.CurrentSample/source.TotalSamples);
end

Which results in an updating graph:

How can I get the bars like above, any suggestions?


texts: I want to know if there is a practical way to find out if multipath propagation is significant for audio in a given environment?

texts:
I am employing audio signals generated by a mechanical press for Blind Signal Separation. But, prior to algorithm application, I need to clarify if the signal strengths coming in multipath (except direct path) are significant.

Ideally, I would like to use the four microphone recordings of audio generated by this press for this task. However, if it's difficult or impractical I am interested in trying out other methods.

Cheers!


texts: Compare the quality of IQ data from different Software Defined Radios (SDRs)

texts:
I want to know what methods are best to scientifically evaluate the quality of different Software Defined Radios (SDRs) that spit out IQ samples.

For this question, I would like to set the boundary conditions as follows:

Their ADCs are from different vendors but contain the exact bit resolution.
They may have very different RF front ends or even be based on different architectures such as Direct conversion, Direct sampling or even Super-Heterodyne. We do not care about this as long as they tune to the band we specify and provide IQ.
During the test, they have same exact type of antenna plugged in and all other environment parameters are maintained same.
SDRs are tuned to the exact band to RX at an officially supported band in the specification.

After gathering, lets say, 2-3 IQ recordings (one from each SDR) through GNU Radio, how can we compare the quality of these IQ files?

Doubts: Can we tune the receivers to the same FM channel and ask some block in GNU-Radio to report the SNR so we can chose the one with highest SNR as the SDR that offered the most quality IQ?

Appreciate your time and knowledge.


texts: Implementing Edge Preserving Diffusion (Anisotropic Diffusion)

texts:
I am trying to implement edge preserving diffusion. Recall the general diffusion equation to be:

$$\DeclareMathOperator{\Div}{div}\delta_t u = \Div(g \nabla u)$$

Where $g$ is the speed of the diffusion process and $u$ is the image. Now if we want an edge preserving diffusion, we can use a non linear diffusion speed as in Scale Space and Edge Detection Using Anisotropic Diffusion:

$$g(|\nabla u|) = \frac{1}{\sqrt{1+\frac{|\nabla u|}{\lambda^2}}}$$

To implement this smoothing effect, we can simply rewrite the diffusion equation as:

$$\delta_t u = \delta_x(g(|\nabla u|)\delta_xu) + \delta_y(g(|\nabla u|)\delta_yu)$$

And then perform gradient descent:
$$u_{t+1} = u_t + \tau\delta_t u$$

This is implemented as follows:

lam = 0.1
im = smisc.imread('lena.png', mode='L')
for i in range(100):
    ux = cv2.Sobel(im, cv2.CV_64F, 1, 0, ksize=5)  # x
    uy = cv2.Sobel(im, cv2.CV_64F, 0, 1, ksize=5)  # y

    g = 1 / (1 + (ux ** 2 + uy ** 2) / lam ** 2) ** 0.5
    utx = cv2.Sobel(g * ux, cv2.CV_64F, 1, 0, ksize=5)  # x
    uty = cv2.Sobel(g * uy, cv2.CV_64F, 0, 1, ksize=5)  # y

    im = im + (utx + uty) * 0.01  # gradient descent
plt.imshow(im, cmap='gray', vmin=0, vmax=255)
plt.show()

This works well and smooths the image while preserving the edges. I decided that I would also try to implement this a different way, in particular I would solve the equations until the end and implement the smoothing. In particular I did:
$$\begin{align}
\delta_t u
&= \Div(g \nabla u) \\
&= \delta_x(g(|\nabla u|)\delta_xu) + \delta_y(g(|\nabla u|)\delta_yu) \\
&= u_{xx}\big(1 + \frac{u_x^2 + u_y^2}{\lambda^2}\big)^{-\frac{1}{2}} - \frac{1}{\lambda^2}u_x^2u_{xx}\big(1 + \frac{u_x^2 + u_y^2}{\lambda^2}\big)^{-\frac{3}{2}} \\
&+ u_{yy}\big(1 + \frac{u_x^2 + u_y^2}{\lambda^2}\big)^{-\frac{1}{2}} - \frac{1}{\lambda^2}u_y^2u_{yy}\big(1 + \frac{u_x^2 + u_y^2}{\lambda^2}\big)^{-\frac{3}{2}} \\
\end{align}$$

Using gradient descent this can be implemented as:

lam = 0.1
im = smisc.imread('lena.png', mode='L')
for i in range(100):
    ux = cv2.Sobel(im, cv2.CV_64F, 1, 0, ksize=5)  # x
    uxx = cv2.Sobel(ux, cv2.CV_64F, 1, 0, ksize=5)  # x
    uy = cv2.Sobel(im, cv2.CV_64F, 0, 1, ksize=5)  # y
    uyy = cv2.Sobel(uy, cv2.CV_64F, 0, 1, ksize=5)  # y

    utx = uxx * (1 + (ux**2 + uy**2) / lam**2) ** -0.5 - 1 / lam**2 * ux**2 * uxx * (1 + (ux**2 + uy**2) / lam**2) ** (-1.5)
    uty = uyy * (1 + (ux**2 + uy**2) / lam**2) ** -0.5 - 1 / lam**2 * uy**2 * uyy * (1 + (ux**2 + uy**2) / lam**2) ** (-1.5)

    im = im + (utx + uty) * 0.01 # gradient descent
plt.imshow(im, cmap='gray', vmin=0, vmax=255)
plt.show()

Interestingly this smooths as well, however, there appears to be some weird dot artifacts appearing in some locations, does anyone know why this happens and what is wrong with the second implementations? I show the outputs below:

Original image:

Implementation 1:

Implementation 2:


texts: Show That the Power Spectrum Density Matrix Is Positive Semi Definite (PSD) Matrix

texts:
Given a Wide Sense Stationary Multi Variate (Vector) Random Process $ \boldsymbol{x} \left[ n \right] $ it Auto Covariance Matrix Function is given by:

$$ {R}_{x, x} \left[ m \right] = \mathbb{E} \left[ \boldsymbol{x} \left[ n \right] \boldsymbol{x}^{T} \left[ n - m \right] \right] $$

Prove that the Power Spectrum Density Matrix is Positive Semi Definite (PSD) Matrix where it is given by:

$$ {S}_{x, x} \left( f \right) = \sum_{m = -\infty}^{\infty} {R}_{x, x} \left[ m \right] {e}^{-j 2 \pi f m} $$

Remark

Pay attention that $ {R}_{x, x} \left[ m \right] $ isn't necessarily Positive Semi Definite matrix (It is for $ m = 0 $, yet nothing can be said in general for other time indices). It is even not necessarily  symmetric.


texts:
I have a stream of data over time that I have fed into a Kalman filter. This data represents the vertical displacement in time of a vehicle's rearwheel as it travels over a bump in the road. The wheels are being detected through video processing.

How can I fine tune my algorithm to reduce the sawtooth jitter that the Kalman filter gives me?

code:

import numpy as np
import pandas as pd
from pykalman import KalmanFilter
from numpy import ma
import matplotlib.pyplot as plt

# The numpy.ma module provides a convenient way to address the issue of dropout, with masked arrays.
# When an element of the mask is False, the corresponding element of the associated array is valid and is said to be unmasked.
# When an element of the mask is True, the corresponding element of the associated array is said to be masked (invalid).
rearwheel_y = ma.masked_values(rearwheel_y, 0)

# time step
dt = 1
# initial_state_mean
X0 = rearwheel_y[0]
# initial_state_covariance
P0 = 0
n_timesteps = len(rearwheel_y)
n_dim_state = 1
filtered_state_means = np.zeros((n_timesteps, n_dim_state))
filtered_state_covariances = np.zeros((n_timesteps, n_dim_state, n_dim_state))
# Kalman-Filter initialization
kf = KalmanFilter()
# iterative estimation for each new measurement
for t in range(n_timesteps):
    if t == 0:
        filtered_state_means[t] = X0
        filtered_state_covariances[t] = P0
    elif t != 0:
        filtered_state_means[t], filtered_state_covariances[t] = (
        kf.filter_update(
            filtered_state_means[t-1],
            filtered_state_covariances[t-1],
            observation = rearwheel_y[t])
        )

# plot of the resulting trajectory
plt.figure()
plt.plot(rearwheel_y, 'k.', label = 'Observations')
plt.plot(filtered_state_means[:, 0], "g-", label="Filtered Positions", markersize=1)
plt.ylim(150, 205)
plt.grid()
handles, labels = plt.gca().get_legend_handles_labels()
by_label = dict(zip(labels, handles))
plt.legend(by_label.values(), by_label.keys())


texts:
As the order of filter needed for digital information gets higher, it takes longer to process and requires more memory. Maybe analog filtering could be of use here. I know that the words analog and high precision dont often appear in the same room together, but lets assume they do for the sake of this post.

Ok, so I suggest that when a higher order filter is needed the following linkage of devices could be implemented:

DAC > Analog Filter > ADC

My question regarding this are:

Has this linkage of devices been used before?
If so, where can I find literature on it?
If not, why do you think it hasn't been used?

(Assume highly precise analog filters are being used)


texts: Suppose that I have a sensor that can acquire samples $X[k]$ of the Fourier transform of an unknown signal $Y[t]$. An example is MRI, where the acquired data is in $k-$space. Now suppose that the unknown signal $Y[t]$ is known to be real and non-negative. My question is: is there a principled way to incorporate this knowledge into the spectral analysis algorithm that will estimate $Y[t]$ from $X[k]$, in order to produce an estimate with less bias or variance? I am thinking at non-parametric spectral estimation algorithms. A naive way of course would be to take the real part of $Y[t]$ and clip the negative values, but this does not seem to be optimal. I am looking for some sort of Cadzow's denoising method for spectral data.


texts:
I have been working on an assignment for university in which I have to compress an 80K message consisting of only two symbols, 'a' and 'b', having probability values of 0.6 and 0.4.

I have successfully written my code in Matlab and it is working efficiently for 10-20 symbols. However when I pass my 80k symbol message through my code it stops updating at the 1057th value due to the Range parameter, which achieves a value of 10^-324 (the theoretical limit of type double float).

My question is, is this the limitation of arithmetic coding when the range becomes so small that we cannot work with it or am doing something wrong?

I am working on arithmetic encoder, so no answers related to range decoding will work.


texts: Matlab Neural Networks: input size vs. number of inputs

texts:
I'm trying to do time-series prediction with dynamic recurrent networks in Matlab (will try at least NARX and LRN architectures, if not one or two others). The question I have is, what is the functional difference between giving a network multiple inputs, versus giving it an input vector with multiple elements?

My inputs are values from multiple sensors. Can I create a single matrix (say, a 3xN matrix for 3 sensors that recorded N time steps), run 'con2seq' and use that as a single input to the network? What is the functional difference between doing that versus formatting it as 3 different sequential inputs?

As I understand it, each value (each row within the 3xN matrix, or alternatively each of the 3 single-row inputs) will get its own weight to every layer 1 neuron. Is that correct? What's the difference between the two options, then? Is the only purpose of creating multiple inputs for the case where you want to send some inputs to one subset of layers and other inputs to a different subset of layers?

After reading the first third of the Neural Network Toolbox User Guide, I looked around on here, stackexchange, and google with luck. Everyone says, "net.inputs{K}.size is the dimension of input K, while net.numInputs is the number of inputs," which is tautological more than clarifying.

Thanks much for your help!


texts: I know in a minimum-phase system, any poles or zeros are reflected.  How do I show that a minimum phase system is unique, or that only one system with that magnitude response can be minimum phased?


texts:
How would one go about determining if the following discrete time signal x[n] is periodic, and if it is, determine its fundamental period?

I understand that the period for the second exponential term is 6, but apart from that I am unable to further my calculation.

The answer to the question above is:

but I fail to understand how the equation highlighted in yellow comes to be. Any help with this matter would be appreciated.


texts: Downsampling/Decimation - When is well done?

texts:
I am working on decimation of signal, and I want to know which is the best way to understand if the downsampling is well done or not. At the moment I am comparing the FFT of the source signal and the downsampled signal and I observed a downward shift of it (I think it is due to the lesser quantity of samples), I had also a look into the time behavior. Do you have other advices/suggestions?

EDIT

From the comments/answers:

one method to understand if the downsampling process is well done is by comparing the FFT of the decimated signal and the original signal. The original signal must be attenuated by the decimation factor as suggested in the answer from @user2934229. Otherwise the signals can be normalized by the length of the signal (not suggested in my case because the signal is too long);


texts: frequency response of a time domain subroutine in matlab

texts:
I implemented a sigal processing structure using very basic operation like multiply and add, I wonder is it possible to find a built-in function in matlab to treat this as a black box and obtain its frequency response. I imagine the process being:

Feeding in windowed sinusoid with magnitude 1 at different frequency.
Get output sinusoid fft at the corresponding frequency location and obtain magnitude and phase.


texts:
Why these cross-connections in the allpass filter?

and what do negative and positive $k_1$ really refer to?

Is it when the signal is going downwards or is it when the signal is below the zero line?


texts: What is the general formula for radon back projection for a javascript implementation?

texts:
I'm aiming to implement a simulation of computed tomography back projection in javascript/HTML5 canvas.

Trying to figure the correct approach for doing a back projections and I have been studying the presentation below:

http://www.dtic.upf.edu/~afrangi/ibi/reconstruction_color_2.pdf. On pp. 9-13 of the above pdf presentation a step by step example of back projection is shown.

This example involves a 2x2 matrix (with 4 projections and a total of 10 line integrals) and computes the line integrals of each projection where the value of each corresponding line integral is added to each matrix cell, respectively. Subsequently the total number of line integrals is subtracted from the value of each matrix cell. Finally the resulting value in each matrix cell is divided by the number of projections minus one.

Does this approach hold in general for larger, say a 100x100 matrix with larger cell values, say around 100?


texts: Denoising approach for a combination of several ADC voltage channles

texts:
I have 2 ADC channels of constant voltage measurement with small amount of high frequency noise only and no low frequency oscillations. The final signal should be the simple sum of those and denoised with the moving average in the end. Does the moving average denoising of each separate channel before final summation be more noise effective than applying summation first and do the final moving average later?

channel_1_noisy = channel_1_clean + noise_1
channel_2_noisy = channel_2_clean + noise_2

sum_noisy = channel_1_noisy + channel_2_noisy
sum_denoised = moving_average(sum_noisy)

or sacrificing computer time for 2 moving average filtering operations?

channel_1_denoised = moving_average(channel_1_noisy)
channel_2_denoised = moving_average(channel_2_noisy)
sum_denoised = channel_1_denoised + channel_2_denoised

Having more channels will the effect be exaggerated?


texts:
Tried HDR Algorithms of OpenCV. Since the algorithm takes pretty much time. I tried few alternative steps as follows.

Took sample images from: HDR Images

1. Divided the image into four equal regions as Top Left and Right, Bottom Left and Right
2. Estimated the brighter region and the darker region from the Highly exposed image by taking average of the regions respectively
3. Replaced the brighter region with the average of Low and Mid exposed image.
4. Replaced the darker region with the average of High and Mid exposed image.
5. Then merged the images back into a single image.

 Can someone suggest how to compensate the difference in them
 Tried Exposure Compensator of OpenCV but does not get expected result.

 The result image looks like:


texts: What is the advantages of BPSK+OFDM over usual BPSK (with no OFDM Modulation)?

texts:
The other days I read a useful article (on BER v.s. Eb/N0 curve of ofdm) whose link is as bellow. While watching the plot inside, a question was arisen in my mind. I wonder if the BER v.s. Eb/N0 curve of BPSK alone (without using OFDM) and one using OFDM could be the same in both AWGN and fading (flat and selective) channels? If so, what’s the use of applying OFDM to BPSK alone (expect the simpler equalizer for OFDM case)?

http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/

Best Regards


texts: Filter impulse response order calculation

texts:
I want to generate the following periodic sequence:
h[n]={1,2,3,4,0,0,0,0,1,2,3,4,0,0,0,0,1,2...}.
I am planning to generate this as an impulse response of a filter with an order no more than 8.

I start by finding the z transform of h[n] but this is infinite sequence and can't achieve an order less than 8.

Any hint will be appreciated.


texts: Missing Data in Machine Learning Classification

texts:
I have a training set of 4000 for ML with 36 features, two-class classifier.

Consider that due to some discrepancy feature no. 25 is missing for half of the data. But during data acquisition I know what class it belongs to.
I have defined a specified value (-1000) for that missing data. Other feature values are relatively smaller than -1000.
If I train the data with the same data set, it might not train the
data with high accuracy. Can I somehow extrapolate the data to create
the data set that may be present (near-by values) or is it fine to
train the model with that data-set? (or any other suggestion).

Thanks


texts: My model is operating at a sampling interval of $\frac{1}{f_0 \times N \times L_{maf}}$  s, (using a fixed point iterative method), now i want the output of my model to be at a sampling rate of $ f_0 \times N $Hz (I am planning to use this downsampled data further in my simulation). I am using the rate transition block and setting the output port sampling time as $ \frac{1}{f_0 \times N} $ s. The output which I get is definitely downsampled, but the magnitude is not the same. How can i make sure that this unwanted magnitude attenuation does not happen. Is there any other way to downsample my initial signal without any loss of magnitude.


texts: follow up to previous question " is this an impulse response or step response"

texts:
This question is a follow up to the gorgeous explanation of how the leaky integrator model becomes  a differential equation. The link to that question and answer is below.

should this be viewed as an impulse response or step response

I have two questions related to the explanation. Hopefully Fat32 will not mind answering but anyone else is great also.

1) At the bottom of the first page, the author has  2 statements that start with "such that".

The beginning of the first one is $\delta(t) = x(t)  \cdots $  and the beginning of the second one is  $u(t) = x_(t) \cdots $

Clearly, the equality sign in those statements does not mean the usual equality. Could  that notation be clarified because I don't follow it ?

2) At the very end of the answer, the author derives the continuous time differential equation for the leaky integrator model:

$y^{\prime}(t) + \alpha \times y(t) = x(t)$.

In the link I was originally looking at, the differential equation is discrete rather than continuous but aside from  that, the same equation as that immediately above. ( proportionality constant is $1/k$ rather than $-\alpha$ ). Of course, the discrete version of above would be

$ dy_{t} = (- \alpha \times y_t + x_t ) dt $

Where the subscripting denotes the discrete unit of time for $t = 1, \ldots n$ and $dt$ denotes the width between these discrete units.  This discrete version above is what Lesson 12 uses to generate the plots for how the level of the water in the bucket changes.

So my question is the following:  Would this discrete equation directly above  just be derived by discretization of what was derived by Fat32 or would the leaky integator model derivation need to change somewhere to justify discreteness ?  Clearly, the notion-concept of $exponential declining memory goes away in the discrete version of the model so that makes me think that maybe a whole new derivation is required for justification ? If it is required, then I imagine it is somewhere but I can't find it. Thanks a lot.

                                                Mark


texts: Do antisymmetric FIR filters preserve the shape of their input waveforms?

texts: For antisymmetric FIR windows, the phase response is of the form $a\omega+b$, where $b$ is $\pm\frac{\pi}{2}$, so it is not strictly linear. Does the waveform of the signal gets retained?


texts: error variance of frequency and phase estimation using DFT

texts:
What is the error variance of estimating the (frequency) and (initial phase) of a sinusoid using DFT.
please provide references if possible.


texts: How to filter, in real-time, a quasi periodic signal

texts:
I have a signal affected by a rather complex quasi-periodic noise.
I must filter this signal in real-time to remove this noise.
The noise is not really "high frequency" and its main frequency vary slowly (several orders of magnitude compared to its period) but they are some phase discontinuities.
So I'm looking for a method to cancel this noise, ie. to find the envelope or quasi-DC offset of the signal. A simple moving average may introduce an important lag - so I suppose it might be possible to exploit the noise frequency stability to design a better filter.
Could I take the noise profile over a small previous period in order to attempt to filter it out (cancel fft bins or other methods?). Maybe you have other ideas?
[Edit]
A delay of one noise period could be acceptable, but the lower the better, of course.
Here is an exemple of signal :

[Edit 2]
Currently, I proceeded as follows: I estimate the period of the oscillations (I know that it varies slowly), I build a low-pass filter with this cut-off frequency. Finally I recalculate the frequency when the signal-to-noise ratio becomes too high. I get something like this, but I think we can do better (it lags).


texts: Why would you use DCT as oppose to DFT for detecting oscillation in a signal?

texts:
For my project, I needed to detect the primary oscillation frequency in a signal data. As I googled around, it turns out that DCT is the best tool to find this (http://www.mech.pku.edu.cn/robot/teacher/wangjiandong/WangHuangLu_ImprovedDCT_CEP_2013.pdf)

My question is: why would you base the analysis on DCT, and not DFT? What would happen if I were to apply the same analysis but with DFT? I can't accept that DCT is "faster" since for the practice of detecting oscillation, even in real time, both are "fast enough" and so speed and computation complexity should not be a factor into deciding which to pick!


texts: Performance of Viterbi detector over non-minimum phase channels

texts:
For sequences that are transmitted over channels with memory $\mu=n$ and response H=$[h_0 h_1 \ldots h_n]$,Viterbi algorithm implements Maximum Likelihood (ML) detection and BCJR implements Maximum A-Posteriori (MAP) Detector. Trellis over which these detectors operate have total states = $2^n$.

While applying any trellis based detector either ML or MAP detectors, channels are always considered causal i.e. $h_i=0 \quad \forall i<0$. More over equalizers/detectors are tested for channels that have $h_0=\max(h_i)\quad \forall i=0, \ldots,N$.

My question is related BER vs SNR performance of these trellis based detectors (that jointly equalize and detect) when applied to channels that are not causal and have a peak at $t=k,k\neq 0$. Since a delay to shift response to right has no effect on the structure of trellis, one can easily achieve this. But now the peak is no more at $t=0$. Following is an example to make it more clear.

Let $h_{ij}$ represent the $j^{th}$ coefficient for channel $i$. Consider two channels,

\begin{align}H_1 &=\left[h_{10} \space h_{11} \space h_{12}\right]=[4 \space 2 \space 1]\\H_2&=\left[h_{20} \space h_{21} \space h_{22}\right]=[2 \space 4 \space 1]\end{align}

The performance of ML and MAP detector on $H_1$ is better than that of $H_2$ which is obviously because of high ISI in $H_2$ as compared to $H_1$.

What transformation on $H_2$ can be done so that the resulting channel has a BER vs SNR that is close to $H_1$?


texts:
I'm sampling two signals with fundamental frequency of 50 Hz. I want to sample them at the same instant, but there's a delay between the first and the second conversion. I don't keep the previous values of the signals in an array, at most I can store 10/20 samples.

I want to correct this delay. I thought of a FIR fractional delay, but i'm not sure is the right way to do it.


texts: I am recording ultrasonic sound using "Earthworks M50 50kHz Measurement Mic" and the sound card is "Rolando Quad-Capture USB 2.0 Audio Interface". The recording was done using Matlab into a wav file. Can anybody explain how can we determine the intensity of sound. What does the aptitude of a wav file represent? Is there any formula that we can use to find out SPL using the above information?


texts: How can we calculate the sharpness of Discrete Cosine Transform domain of an image?Is it worthy in image quality assessment?


texts: Calculate symbol rate for QAM modulation

texts:
Not sure if this is the right place to ask, feel free to move it if any other site suits this better.
Anyway I am referring to QAM modulation used in US Cable TV. I know it comes under Annex B which is related to FEC.
I know that 64 QAM has a symbol rate ~= 5057000 Symbols/s and 256 QAM 5360000Symbols/s
I would like to know how this is calculated, also what symbol rate will, say 128 QAM have for example?


texts:
I am trying to understand the basics of the cross/auto-correlation if the noisy signal $y(t)$ which is received from the channel at the receiver. Here at receiver we want to estimate the noise in the received signal and then get a clear signal of $y(t)$.

My questions are below:

How autocorrelation or cross-correlation is performed for this $y(t)$
signal? And what does tell us from the correlation function?
What does the Fourier Transform of the correlation function say about
the noisy signal?

Thanks in advance!


texts: Most appropriate spectral analysis method for a recording of a saxophone note?

texts:
I'm currently doing an investigation where I am attempting to resonant frequencies of an Alto Saxophone at various different notes. I have taken audio recordings of the notes with a sample rate of $44100\textrm{ Hz}$, and exported them into CSV files. Now, I am attempting to analyze this data using the signal processing plugin for MATLAB, but I'm feeling a little bit overwhelmed with all the different options, as I'm not sure which spectral analysis method is most suitable for the my task.

In MATLAB, I'm seeing a number of spectral analysis methods including FFT, Burg Method, Welch Method, Multitaper Method, and more - but I'm not sure of their specific applications.

Again, my goal is to clearly identify the major spectral peaks (formants) which correspond to the resonant frequencies of the Saxophone bore. The data was taken with a condenser microphone at a sample rate of $44100\textrm{ Hz}$, with the Saxophone bore exactly 1 meter from the microphone. Ultimately, I'm looking to create a plot similar to the image I have attached.

Please excuse my ignorance on this subject, this is my first time using MATLAB and I am not well-versed in digital signal processing. If anyone could help me with this, I would be extremely grateful.


texts: Laplacian Filter Implementation in MATLAB

texts:
I implemented a Laplacian filter for the Lena image, but I get an unexpected output.

For input:

I get output:

I used the mask

M =

     0    -1     0
    -1     5    -1
     0    -1     0

I is my Lenna Image rows and columns are I.rows and I.columns.

And this is my MATLAB function:

function IM = customMaskImage(I, rows, columns, M)
IM = zeros(rows,columns);
[mask_rows, mask_columns] = size(M);

for i = 1+(mask_rows-1)/2:(rows - (mask_rows-1)/2)
    for j = 1+(mask_columns-1)/2:(columns - (mask_columns-1)/2)
        tmpMat = I(i-(mask_rows-1)/2:i+(mask_rows-1)/2,j-(mask_columns-1)/2:j+(mask_columns-1)/2);
        IM(i,j) = sum(sum(customMatConv(tmpMat, 3, 3, M)));
    end
end

end

customMatConv.m is:

function IM = customMatConv(I, rows, columns, M)
IM = zeros(rows,columns);

for i = 1:rows
    for j = 1:columns
        IM(i,j) = I(i,j) * M(i,j);
    end
end

end

What am I doing wrong?


texts: limit of the integral in the anti-transform

texts:
if I have an autocorrelation on a limited domain

r($\tau$)=$\lim_{T \to \infty}\frac{1}{T}  \int_{0}^{T} u(t)u(t+\tau)dt$

The power spectral density, obviously will have an infinitive domain:

S(f)=$\frac{1}{2\pi} \int_{-\infty}^{\infty} exp(-i\tau 2 \pi f)r(\tau) d \tau $

If I do the anti-transform of the PSD, which will be the limit of the integral?

from -$\infty$ to $\infty$ or from $0$ to $T$??

Thank


texts: Question about normalization before estimate the spectrum

texts:
I work with a Electrophysiologist Team and i have seen something who interrogate me (i'm a noobs in DSP).

They acquires a signal into a brain structure (an LFP to be precise) :

in a first time they apply a zscore(standard score) normalization on the raw data
then they computes a spectral estimation with a CWT(continuous wavelet transform, morlet in this case)

Is that not a bias to use a normalization like a zscore before estimate the spectrum(or to do anything else in DSP)? Or is that a common way to deal?

Thank you for a potential answer.

Nicolas


texts:
While I was looking into ultrasonic transducer in order to transmit and receive a beam, I came across specification of a transducer stating driving voltage as 20Vrms. I am not sure what actually does it mean and where is the application of driving voltage in transducer(I mean is it used at transmitting or receiving end? or what is its function?). I wonder what parameters of the transducer will be affected due to application of driving voltage?
Below is the specification of the transducer.


texts: How to Quantify a Difference in Spectral Information of two Signals?

texts:
As the title states, I am looking for established methods to quantify the difference in two FFTs. I have come across methods such as using cross correlation in the time domain or the coherence estimate of the power spectral density of two signals, but these methods seem more geared toward finding similarities in signals rather than differences.
I am running an experiment with a treatment and control group and I think the treatment is causing a change in some periodic motion which I am measuring optically and ultimately I want to quantify that change into a single number or metric.
I have thought of perhaps normalizing the FFTs of the two signals I am comparing and finding what frequency value is 50% of the area under the curve for the FFT. The idea being that if the peaks of the FFTs in my treatment group shift then so should the point of 50% of the area under the curve. But I'm not sure if this is a sensible approach.
Thanks for any assistance!


texts: Is a Fourier transform a sound way to analyse a transient signal?

texts:
I am currently working on a project that involves analysing transient signals from sensors.

While not actually part of the analysis itself, I discussed it with the team, and they are using an fft to analyze the transient measurement.

From what i recall , Fourier Transform is a tool for periodic signals, not transient. Am I right? Am I missing something?


texts: Bag of Tricks for Denoising Signals While Maintaining Sharp Transitions

texts:
I know this is signal dependent, but when facing a new noisy signal what is your bag of tricks for trying to denoise a signal while maintaining sharp transitions (e.g. so any sort of simple averaging, i.e. convolving with a gaussian, is out). I often find myself facing this question and don't feel like I know what I ought to be trying (besides splines, but they can seriously knock down the right kind of sharp transition as well).

P.S. As a side note, if you know some good methods using wavelets, let me know what it is. Seems like they have a lot of potential in this area, but while there are some papers in the 90s with enough citations to suggest the paper's method turned out well, I can't find anything about what methods ended up winning out as top candidates in the intervening years. Surely some methods turned out to be generally "first things to try" since then.


texts:
This answer may be straight forward but I cannot figure out. One can understand the difference between cross-correlation and convolution from the link below:

What is the difference between convolution and cross-correlation?

The question is can there be two complex signal which are uncorrelated but their spectrum overlaps? In other words spectrum is not disjoint or product of power spectrum of each signal is not zero in each frequencies?


texts: What Is "Description Vector" in Image Processing?

texts:
When we want to use classifiers like SVM, we first should extract descriptors using algorithms like SIFT.

But I have a question which might call a silly one:
Let's assume
$$
\begin {equation}
D_a=\{d_{a,1},d_{a,2},d_{a,3},...,d_{a,M}\}
\end {equation}
$$
where M is total number of descriptors and $d_{a,?}$ denotes the description vector of mth descriptors.
My question is: what the sentence "$d_{a,?}$ denotes the description vector of m-th descriptors" means? Does it mean that we have 1000 interest point in the image that each of them has ,let's say, a 128-dimension SIFT descriptors? Do we have 128000 values?


texts: Representation, Bandwidth and composition of Digital Signals

texts:
I have started learning data communication and I'm not able to grasp certain topics.

First

(i) I know that analog signals are continuous and digital signals are discrete. Analog signal are represented by a continuous time-varying quantity like voltage. How are digital signals represented in actual practice? I mean to ask how are the 0s & 1s actually represented/transmitted over a transmission medium? Are they represented by a sudden spike then staying stable and then a sudden fall of the time-varying quantity like voltage?

Second,

(i) I know bandwidth is the range of frequencies that make up a composite analog signal. So, if there are two analog signal with frequency 5 Hz and 10 Hz making up a composite signal, will it's bandwidth be (10-5=) 5 hz?

(ii) When we say bandwidth of a transmission medium is 5 hertz, do we mean to say that it allows any composite signal to pass through it, in which difference between the upper frequency and lower frequency making up the composite signal is 5 Hz?

(iii) Can we define bandwidth of a single sine analog signal?

Third

(i) Are digital signal nothing but just superimposition of theoretically an infinite number of analog signals? If yes, then why and how?

(ii) How do we define frequency and bandwidth(in Hertz, not bps) of a digital signal?

Sorry if these questions seem a bit too easy for many but as a self-learner with no college help, It's quite tough for me.
Thanks in advance.


texts: How can I visualize the sEMG(Surface Electromyography Signals) using python?

texts:
I get surface EMG signals using a device called BioRadio and we got 3 channel signals, How can I visualize those signals in time domain and frequency domain in python. this is a sample of the data we got in .csv format.
Elapsed Time,EMG1,EMG2,EMG3,BioRadio Event,
00:00:00,0.000640869140625,-0.00468635559082031,0.0117015838623047,0,
00:00:00.004,0.000640869140625,-0.00469207763671875,0.0116958618164063,0,
https://github.com/theepag/Research_dataCollection/blob/master/sEMG%20Data/Kulanthaki/n.csv


texts: I am preparing an interview which may require some knowledges on DSP. Is there any questions, fundamental concepts, and theories that I would not want miss? Thanks a lot for the suggestions.


texts: linear phase and generalised linear phase filters

texts:
I know that for linear phase filters, all frequency components have equal delay times. That is, there is no distortion of signal due to the time delay of frequencies relative to one another.

However, for filters generalised linear phase, where the phase is of the form $a\omega+b$, and $b$ is not zero. Will the same be true for them? Thanks in advance!


texts: Fast Morphological Erosion / Dilation with Variable Window Size

texts:
I want to perform the following operation on an image: consider a square window around every pixel, find the maximum value in this window, and replace the central pixel value with this maximum value. If I consider a $n \times n$ square window around every pixel, this becomes the morphological dilation operation (with a square $n \times n$ structuring element).

In my work I need to have windows of different sizes around every pixel, i.e. I might need a $n \times n$ window around pixel $A$ and a $m \times m$ window around pixel $B$.

Questions:

(1) Does this operation have a name? Is it widely used?

(2) Do you know of any fast algorithm to perform this operation?

Relevant info: For fixed window sizes, there does exist a fast algorithm, for example Algorithm 1 in the following paper (which in fact requires just a constant number of operations per pixel, regardless of window size):

Chaudhury, K. N. "Acceleration of the Shiftable O(1) Algorithm for Bilateral Filtering and Nonlocal Means." IEEE Transactions on image processing, 22.4 (2013): 1291-1300.


texts: Apply Low pass Butterworth filter in Python

texts:
I want to use a low pass Butterworth filter on my data but on applying the filter I don't get the intended signal. Here is the dummy code:

Signal A:

import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
a = np.linspace(0,1,1000)
signala = np.sin(2*np.pi*100*a) # with frequency of 100
plt.plot(signala)

Signal B:

signalb = np.sin(2*np.pi*20*a) # frequency 20
plt.plot(signalb)

Let's combine signal A and B now to get signal C

signalc = signala + signalb
plt.plot(signalc)

The resultant signal C looks like this

Let's now apply the filter:

b, a = signal.butter(5, 30, 'low', analog = True) #first parameter is signal order and the second one refers to frequenc limit. I set limit 30 so that I can see only below 30 frequency signal component
output = signal.filtfilt(b, a, signalc)
plt.plot(output)

On applying above butter filter, I get an empty plot as

I don't understand where I am doing wrong? Any  help will be appreciated.


texts: ADC performance simulation: How to calculate SINAD from FFT?

texts:
While working on this problem, I started to have doubts that my initial definition of

$$SINAD = 10 \log_{10} \left( \frac{p_f} {\sum_i{(p_i)} - p_0 - p_f} \right)dB$$

is correct. In this equation, $p_x$ is the power the FFT bin at frequency $x$, $p_f$ is the power of the frequency bin containing the signal frequency $f$ and $p_0$ is the DC component. The sum over $i$ accumulates all frequency components, before removing the DC component $p_0$ and the the signal frequency $p_f$.

More specifically, I am unsure about the $\sum_i(p_i)$ part, which I interpreted from the Wikipedia description

  The ratio of (a) the power of original modulating audio signal, i.e., from a modulated radio frequency carrier to (b) the residual audio power, i.e., noise-plus-distortion powers remaining after the original modulating audio signal is removed. With this definition, it is possible to have a SINAD level less than one.

Comparing with the equation, the "original modulating audio signal" is at frequency $f$, which is accounted for in the $p_f$ term from the FFT. The $p_0$ term I got from the following paper, which says to remove the DC component:

In the "Understand SINAD, ENOB, SNR, THD, THD + N, and SFDR" document, it says

  Signal-to-Noise-and Distortion (SINAD, or S/(N + D) is the ratio of the rms signal amplitude to the mean value of the root-sum-square (rss) of all other spectral components, including harmonics, but excluding dc

Looking at these definitions, I can think of another possible definitions of SINAD, namely

$$SINAD = 10 \log_{10} \left( \frac{p_f} { \sqrt{ \sum_i{(p_i^2)} } - p_0 - p_f} \right)dB$$

which uses the RSS (root-sum-square) of the noise and distortion bins of the FFT result. But then, what exactly is meant by "mean value" in that document?


texts:
I'd like to simulate a certain $E_s/N_0$ in a baseband OFDM MATLAB modem to generate SER curves.

I randomize 50 QAM symbols with $N$ subcarriers each in frequency domain, add null frequencies (guard bands) to each symbol, perform IFFT and then add CP. Then I convolve the "time domain" symbols with a certain channel with taps of my choice and then I want to add noise, but I'm not sure about how to normalize it so that I obtain the correct SNR as generally reported in theoretical curves.

I get funky results with just MATLAB's agwn function with the measured flag.


texts:
I am familiar with both Nyquist frequency and Nyquist rate. What I cannot seem to find information on is the minimum time necessary to detect a signal.

In my use case I am using a multiplexer to measure signals from multiple analog sources, each source carrying information from 60 to 100 Hz. I would, ideally, like to take these samples as quickly as possible.

Lets assume that my lowest frequency is 10 Hz. to detect a 10 Hz signal, you need at least 200ms of data, right? You cant detect a signal that comes once every 100 ms without measuring for at least twice as long. Or can you? This is part one of my question.

Part two is, how does the signal appear if I tried to measure a 10 Hz signal using only a 100 ms bin? Obviously it appears as a random point, but does it mask itself as a higher frequency? Is it just combobulated noise? What does the aliasing look like?


texts: Multiplication and Convolution in Wireless Communications

texts:
In Wireless Communication, sometimes the received signal is expressed (in time-domain) as follows:
$$r=hx+n$$
where $h$ is called a fading coefficient
and sometimes it is expressed as:
$$r=h*x+n$$
where * is the convolution operator and $h$ is called the channel impulse response.

My question is: Are the fading coefficient in the first equation and the impulse response in the second equation the same thing? If so, why we use the multiplication instead of convolution?


texts: Why does it seem most of people will optimize the downlink rate,not the uplink rate?

texts:
I search for some papers about energy harvest,SWIPT and optimization.And i found that there is just one paper to optimize the uplink rate,the others are for optimizing the harvested power,power budget in the transmitter or downlink rate.

So i want to ask why ? why do most of researchers won't optimize the uplink rate?is there any reason or difficulty?

Because in IoT,we may control lots of things,and of course we do need to know some information of the devices or what happened with the devices,that is ,we do need to know some feedback about the device,so we need  the device uplink the information back to the transmitter,so i think optimizing the uplink rate is still a worth research topic,why  why do most of reseachers optimize the downlink rate instead of uplink rate?

By the way,i also want to ask is the throughput the same as the rate?what is the difference between the throughput and capacity?


texts: Can I measure non-linearity of a line echo path?

texts:
I'm dealing with an echo signal from a hybrid. An echo path includes DAC, the hybrid, ADC and the line infrastructure. I can see, that after using a digital linear echo-canceller the residual echo signal is still significant and I suspect that echo-path has additional non-linear components. Now I want to estimate, how much of the incoming signal is an actual echo and not a noise, and I want to do it before actually implementing or inferring any specific non-linear function (e.g. without assumptions regarding the order of Volterra series).
I've found the ITU-T O.42 recommendation, which suggests using the 4-tone intermodulation method to measure nonlinear distortion impairments on analogue circuits. But it doesn't suit me, since my echo path includes the DAC.
So is there a way to measure or estimate the level of the non-linearity in my echo path? I would highly appreciate any references. Also, if this question is more related to electronics, please feel free to migrate it to the corresponding site.
UPDATE:
Definition of non-linearity: based on the source, a non-linearity for an echo signal is anything that cannot be modeled with a linear filter: a dc component, a long tail and truly non-linear dependencies. So the question becomes: is there a way to measure or estimate the level of those components compared to noise? The peculiarity here is that both a dc component and a long tail are actually linear in their nature.
Signal measurements: Following are the data that I got by changing the power of transmitted signal (from 1 to 6).
Power spectral density plots (regular and normalized), where frequencies are limited by a sampling rate:

Left: echo mean z mean and variance z var and residual echo mean e mean and variance e var for a regular (random) transmitted signal (using some arbitrary length of a linear filter). Right: echo mean and variance and residual echo mean and variance (using filter weights from training on the regular signal) for a constant  transmitted symbol.

Observations:

The PSD plots look identical, except for unclear shift of a plot for the lowest power level (1).

Mean and variance plots do not resemble any obvious non-linearity, which would have shown as a power law dependency everywhere. Based on increased e mean for a constant transmitted symbol, there is a tail in the echo.

What puzzles me the most is a linear growth of a residual echo variance, which I cannot explain.

So the original question is still relevant. Additionally, can I actually use obtained plots to estimate the echo non-linearity and if so, how should I do it?


texts:
I have a set of objects, which may be spherical or elongated, which may or may not have a tail like structure attached to one or two ends. The tail may be long or short. It may also have a curve to it.

I'm currently looking over the information returned by regionprops and trying to see if anything jumps out at me which could be used to discriminate between normals and tails. I am also playing around with some morphological operations.

An opening operation followed by a comparison to the original mask is my current thought, but I'm not certain that this will be reliable enough in the presence of elongated cells, and I haven't yet found the "perfect" structuring element.

As I am not highly experienced in the IA field (more of an intermediate level), I am thinking that it may be a good idea to reach out and see if others have any ideas that I have not yet considered.

Test images are below.  The effective dynamic range is 12-bits, but I've normalized them so that they can be viewed more easily.

And here is a "normal" for comparison: