texts: what is $1/f$ property of the visual world?

texts:
I was watching a talk by Edward H. Adelson on the perception of materials and surfaces. He mentions a $1/f$ property of the visual world. He says:

  low frequencies are prevalent than high frequencies.

Also,

  the simplest model of the world is that it is random noise with a $1/f$ spectrum.

I didn't understand what he meant. Anyone willing to explain the concept he is talking about?


texts: Logic analyzer for acquiring EEG signals?

texts:
Is it possible? I haven't found anything about it on the internet.
I found a logic analyzer here, which is marketed as having the capability to monitor analog signals too:
"One useful feature of your Saleae Logic Analyzer is its ability to measure analog signals (from 0 to 5 V). As such, it can function as an oscilloscope with up to 8 channels (for the Logic 8 and Logic Pro 8) or 16 channels (for the Logic Pro 16)."
(https://support.saleae.com/tutorials/example-projects/how-to-measure-analog-signals)
Could that function as a 16 channel EEG recorder?
As I know, a human EEG electrode would pick up a signal peaking at around 0.1 V... would it be a problem?


texts: What exactly is transmit power in wireless communication?

texts:
My background is computer science. Recently, I had to come across some concepts in wireless communication/cellular mobile communication. Despite having gone through many materials, I am still having a hard time understanding some basic concepts, especially the concept of "transmit power".

So, what exactly is transmit power? Is it:

the electrical power needed by a transmitter to transmit a signal to a receiver?
or the amount of electrical power transmitted from a transmitter to a receiver via a channel?
or is it a different kind of power?


texts:
I generated an signal with a base frequency of $50\textrm{ Hz}$ and its harmonics and quantization noise in it (as an array in MATLAB). It's sampled fast enough to make sure there is no aliasing etc.

I calculate the PSD with a rectangular window in MATLAB. Due to the fact that the signal is synthesized in MATLAB I know where my harmonics are, so I chose length of my FFT to have a frequency resolution of $5\textrm{ Hz}$. I did this to be able to see my hamonics without the spectral leakage effect.

My problem is, that the PSD estimates differ from my expectations. I expected to see spikes caused by my harmonics and a kind of random noise floor. But what I get is kind of a continuous looking PSD with spikes as you can see in the image below:

The $x$-axis is the frequency in $\textrm{Hz}$ and the $y$-axis is in $\textrm{dBc/Hz}$ normalised to my base frequency power.

My Matlab code is:

NFFT = length(bitstream)-1; %df = fs / NFFT = 5 Hz
fVals = fs*(0:NFFT/2)/NFFT;

% calc fft
X_f = abs(fft(bitstream,NFFT));
% calculate periodogram (one sided)
pxx = ((X_f(1:NFFT/2+1))/NFFT).^2;
% plot
plot(fVals,10*log10(pxx/max(pxx)),'black');

The MATLAB function periodogram() as shown below (with rectangular window and same FFT length) produces the same output, so I thought my code is correct.

pxx = periodogram(bitstream,rectwin(length(bitstream)),NFFT);

Can you tell my why I see that?
Is the periodogram method not suitable for that case?
Is it caused by the rectangular window and/or the frequency resolution? If I use the built-in non-parametric estimation functions like pwelch(), periodogram(), pmtm() etc. without any further input it looks more noisy (as expected).
Or is it even better than expected because one of the frequencies in my simulation is the greatest common divider of the sampling frequency (using e.g. a signal with a different frequency like $49\textrm{ Hz}$ also leads to more noisy results)?


texts: How to get the values for C1 and C2 in Chan-Vese Model?

texts:
This question will consider the widely accepted segmentation algorithm of Chan-Vese, given in the following publications:

  T.F. Chan, L.A. Vese, An active contour model without edges, Lecture
  Notes in Computer Science, vol. 1682, pp. 141–151, 1999.

  T.F. Chan, L.A. Vese, Active Contours Without Edges, IEEE
  Transactions on Image Processing, vol. 10, no. 1, pp. 266–277, 2001

The main publication is accessible here:
http://www.math.ucla.edu/~lvese/PAPERS/IEEEIP2001.pdf

Equation 6 and 7 of this paper mentions $c_1$ and $c_2$ values. The energy function is also parameterized by these variables. My question involves the algorithm / method to compute these values. How can I do that?


texts:
What is the most reliable and agnostic way to correct for a phase rotation of I/Q downconversion - without time alignment of the signal and support different lengths of transmitted and received data?

To be more specific: Assuming perfect I/Q balance, there is still a phase rotation in the received I/Q data if the LO of the transmitter and receiver are not exactly phase locked. As an example, consider sending the following signal:

$$
x[n] = x_i + j \,0,\qquad x_i \sim \cal{N}(0,\sigma^2)
$$

The received signal will, in general, look like:

$$
y[n] = y_i + j y_q
$$

Multiplying $y[n]$ yb proper $e^{j\theta}$ should make $y_q$ zero and hence correct for the LO phase rotation.

If I transmit this $x[n]$, I could iterate over all possible $\theta$ values and find the one which minimizes $\mathbb{E}(y_q^2)$.

However, it would be desirable to find this constant for arbitrary $x[n]$.

Furthermore, I could cut and align the signals and then just find the complex constant via least squares.

However, there will also be a time delay associated between the sender and the receiver and I do not want to correct for this delay at this stage. Furthermore, $y[n]$ may be longer or shorter as $x[n]$ - in this case $y[n]$ is a part of $x[n]$ or vice versa.

I wonder if there is a reliable way for the general conditions above to find $\theta$ at a very early stage in the I/Q receiver (i.e., from uncorrected I/Q samples of the two ADCs).


texts: Spread Spectrum (CDMA) signal phase noise measurement

texts:
A CDMA signal is considered for this application.

I would like to have an information on the generated signal oscillator's quality using a phase noise measure. If the signal was a pure carrier, it would have been easy to make a spectral measurement using a Spectrum analyzer for example to estimate the phase noise and have an information on the oscillator.

Is it possible to estimate the phase noise using a spectral measurement on this modulated signal without demodulating the spread spectrum signal  ?


texts: Statistical properties of the Kalman estimates under Gaussian noise

texts:
For a linear state-space model with independent Gaussian state and output noises and perfect guess for initial state, do Kalman estimates have the following properties:
$$
E(\hat{x}_{k|k} - x_k) = 0
$$
$$
P_{k|k} = Var(\hat{x}_{k|k} - x_k),\text{ or }Var(\hat{x}_{k|k}),\text{ or }Var(x_k) ?
$$
where

$x_k$ is the state at time $k$, which is random
$\hat{x}_{k|k}$ and $P_{k|k}$ are Kalman esitmates, i.e. outputs of Kalman filter.

Are there references mentioning these?

Thanks!


texts: Could someone please explain to me about Directional Filter Bank?

texts:
I'm learning about Directional Filter Banks for my Thesis about Image Enhancement. I read it from some papers (Bamberger(1992) and Park(2004)) but I still cannot understand it clearly in detail. Could anyone here please explain it to me the process? Does it applied on Frequency domain or Spatial domain?

Thank you very much in advance.


texts: estimation of ARMA(1,1) with MA parameter greater than 1

texts:
I am working with the following simple ARMA(1,1) model:
$$
z_{t+1} = \phi z_{t} + \theta\varepsilon_{t} + \varepsilon_{t+1}
$$
In my case $\theta$ depends on some other parameters, and, therefore, I know that $\theta > 1$.

Let us generate 1000 ARMA(1,1) samples with $\phi = 0.95$, $\theta = 0.5$,
$\sigma = 0.08$  and estimate the parameters.

import numpy as np
import statsmodels.api as sm
from statsmodels.tsa.arima_process import ArmaProcess

process = ArmaProcess(np.r_[1, -0.95], np.r_[1, 0.5])
y = process.generate_sample(1000, scale=0.08)
model = sm.tsa.ARMA(y, (1, 1)).fit(trend='nc', disp=0)

The result is [0.96069232 0.51912881 0.080], which is quite close to the true values.

Next, lets us try parameters $\phi = 0.95$, $\theta = 2$,
$\sigma = 0.08$, i.e. change the following row in the code above:

process = ArmaProcess(np.r_[1, -0.95], np.r_[1, 2])

The result is [0.95668055 0.49700497 0.156] and there is no errors and warnings!

By default, in order to have distinguishable auto-covariance function we assume $|\theta| < 1$. Therefore, in the result the estimator is close to $\frac{1}{\theta}$. Though, the standard deviation of the variance is far from the true value.

Is there a way to estimate the case when $\theta > 1$? From what I can see, all packages use the fact that $|\theta| < 1$.


texts:
Hello everyone!
I have a graph, which is Spectra inside cavity. PSD vs. frequency.
I need to get velocity [m/s] from PSD [dB/Hz].
Does anyone know how to do that?


texts: what happens If I change the phase and magnitude of a signal

texts:
I have a speech signal. I want to know what happens when I make some changes on the phase of its frequency reaponse. When I set its phase to zero I observed that the new signal is even and the amplitude of the first sample became larger. Does it mean all the frequency components get the zero delay? But there is again amplitude in middle part of the signal. Is there any better interpretation for makeing the phase of signal zero?

When I set the frequency resposnse to the constant value of its average of magnitude what will extactly happen?

Thanks in advance for any help


texts: Faster R-CNN and 4-step Alternating Training

texts:
I am reading the paper Faster R-CNN available here. In section 3.2, page 6 bottom left, the authors describe what they refer to as a 4-step Alternating Training between the Region Proposal Network, used to obtain region proposals used in the Fast R-CNN method for object detection. They write:

  In this paper, we adopt
  a pragmatic 4-step training algorithm to learn shared
  features via alternating optimization. In the first step,
  we train the RPN as described in Section 3.1.3. This
  network is initialized with an ImageNet-pre-trained
  model and fine-tuned end-to-end for the region proposal
  task. In the second step, we train a separate
  detection network by Fast R-CNN using the proposals
  generated by the step-1 RPN. This detection network
  is also initialized by the ImageNet-pre-trained
  model. At this point the two networks do not share
  convolutional layers. In the third step, we use the
  detector network to initialize RPN training, but we
  fix the shared convolutional layers and only fine-tune
  the layers unique to RPN. Now the two networks
  share convolutional layers. Finally, keeping the shared
  convolutional layers fixed, we fine-tune the unique
  layers of Fast R-CNN. As such, both networks share
  the same convolutional layers and form a unified
  network.

What I do not understand is the third step. They say they use the detector network to initalize RPN training. I am not sure what this means. The detector network outputs bounding boxes and class labels for objects within a given image.

Consider the layers specific to RPN. We have a certain number of convolutional layers, followed by sliding windows with anchor boxes being fed to regression and classification (class label layers). Are the authors saying that the initially trained convolutional layers are now discarded for RPN and replaced with those trained by Fast R-CNN in step 2? Or do they mean something else.


texts: Increasing samples per symbol degrades correlation between signals

texts:
I am trying to implement a simple pseudo-noise (PN) ranging simulation.
I have used this GNU Radio example, and I have adapted it a bit to suit my needs.

Here is a screenshot of my flowchart:

The most important change is that I have introduced a new variable called 'bps' (bits per second). I use it and the 'samp_rate' to calculate the samples-per-symbol by the following formula:

sps = int(samp_rate/bps)

Here is where the sps variable is used (see the red blocks):

Question:

Why increasing the bits per second (bps) and therefore decreasing the samples per symbol (sps) gives better correlation between the reference and "transmitted" signals?

Correlation with bps = 1.2k:

Correlation with bps = 4.8k:


texts: How is a signal multiplied with the window functions?

texts:
How the input signal get multiplied with the window functions like Hamming, Hanning, Blackman, etc?

I have tried to multiply the input signal of $10\textrm{ MHz}$ sampled at $100\textrm{ MHz}$ using the Blackmann window function. The output graph is

How is the multiplication perfomed ?

The input signal is $1\times 64$ row matrix, the Blackman window generates its samples in $64\times 1$ column matrix. The multiplication generates a $64\times 64$ matrix i.e one sample of input signal is multiplied to 64 samples of the window function. For a particular point sample there are 64 sample value. I intend to calculate 128-point FFT with padding zeros.

So for a particular sample point which value should be considered to calculate FFT?

Here is my code :

N = 64; % signal length (power of 2)
T = 10*(10^-9) ; % sampling period (and rate) is set to 1
A = 1; % sinusoid amplitude
phi = 0; % phase of zero
f = 10*(10^6); % frequency (under Nyquist limit)
nT = [0:N-1]*T; % discrete time axis
w = blackman(N,'periodic');
x1 = A*cos(2*pi*f*nT);
x = w*x1  ; % windowed signal
subplot (311);
stem (x1);
wp = [w;zeros((zpf-1)*N,1)];
subplot (313);
stem (x);
subplot (312);
stem (w);
disp (x1);
disp (w);
disp (x);


texts: finding energy content of signal from "energy spectral density" function

texts:
from "Signals and Systems Demystified", 2006, page 142, Example 6-3: (http://www.gatestudymaterial.com/study-material/signals%20and%20systems/text%20books/SIGNALS%20AND%20SYSTEMS%20BY%20DAVID%20MCMOHAN.pdf)

Given signal:

$$x(t)=e^{-at}u(t)$$

has autocorrelation function:

$$R_{xx}(\tau)=e^{-a\tau}/(2a)$$

Find the energy content of the signal:

So I take the Fourier transform of $R_{xx}(\tau)$ to obtain energy spectral density $S_{xx}(\omega)$:

$$F\{R_{xx}(\tau)\}=(1/(2a))\text{ } F\{e^{-a\tau}\}$$
$$S_{xx}(\omega) = (1/(2a))\text{ }(2a/(a+j\omega))$$
$$S_{xx}(\omega) = 1 / (a+j\omega)$$

Now according to the book, equation 6.9, "if x(t) is real valued, then the energy spectral density (S) is:

$$ S_{xx}(\omega) = | X(\omega)|^{2}$$

However, when I look at my Fourier transform I find a complex number:

$$S_{xx}(\omega) = 1 / (a+j\omega)$$

my question is:  what is going on?  why is it complex when the book says it should be a real magnitude?

(I suppose I could look inside a real "signals and system" textbook and obtain the answer.  But, I've already went through half the "Demystified" book to turn around. I'm just curious, what they are doing here.)


texts: How to find SPL of a WAV file given a calibration tone in WAV format

texts:
My ultimate aim is to find the Sound Pressure level of a digital WAV audio file and represent this (say, in MATLAB) as a dB SPL re 20 uPa on y-axis and frequency on x-axis.

As this link mentions:

  Calibration Signal Recording – Record a WAV file with a tone or signal
  of a known level using the same recording input gain setting that were
  used to record the WAV file.  Sound Quality Analyzer will use the
  calibration recording to generate the proper normalization term for
  the WAV file to be analyzed.

Now, let'say I have a calibration tone which I know has a 94 dB SPL at 1 KHz frequency, how can I use this information to scale the pressure values my audio file to finally get to a dbSPL.

In the above equation, I know Po = 20 uPa (threshold of hearing). So if I am able to find the scaled P values of the audio file, I can use this equation to find the dBSPL.

Edit:

So the question boils down to this:

There is a noise.wav that needs to be analysed.
There is a calibration.wav that is recorded with 94 dB SPL at 1 KHz. This is the known calibration tone from a calibrator. The settings on the calibrator say 94 dB, 1KHz. Is this 94 dB SPL re 20 uPA? How do we find the SPL of this recording to get a normalization factor for the noise.wav to be analyzed? I am assuming the actual SPL of the recording will be different than what the calibrator says.
How will you use the normalization factor obtained above to calibrate and find the SPL of the original noise.wav? If noise.wav is a 1 minute recording - do we need to take n number of samples (window the signal), calculate the SPL re 20 uPa of each window and further normalize the SPL value obtained from the term obtained above?

Here, I am assuming that the WAV files (noise and calibration tone) are not recorded with a calibrated sound level meter but rather, say, a mobile phone.  So, essentially what I am trying to get at is to replicate the functionality of calibrating a sound level meter given these two recordings.


texts: How to Concatenate white noise signal and applying bandpass filter matlab

texts:
I created a white noise signal. I am trying to use the array I have created with the white noise to play in 2 channels. When the left channel I was trying to have 5000 samples and the right will have 0 and when in the right channel it will have 5000 samples and the left will be 0(which means no sound from this channel). I keep getting an error when trying to concatenate the sounds and I think I messed up with the loop because every time it loops it will do 5000 samples and I only need 5000 total with a 10000 sample pause in between the 2 sounds. I also had trouble writing the band-pass filter into the code but it worked when using the FDAToool. Any help would be appreciated.

fs = 44.1; %Sample Frequency khz
L=5000; %Sample length for the random signal
P=10000; %Sample Pause Gap
mu=0;
sigma=2;

Left_signal = [sigma*randn(L,1)+mu 0];
Right_signal = [0 sigma*randn(L,1)+mu];

%Loop thru all samples
for num = 2:L,
%Time
%t = num *(1/Fs);
Left_signal = [Left_signal; sigma*randn(L,1)+mu 0];
end

Pause = zeros(P,2);

for num2 = 2:L,
%time
%t = num2 * (1/Fs);
Right_signal = [Right_signal; 0 sigma*randn(L,1)+mu];
end

Long_signal = [Left_signal; Pause; Right_signal];


texts: How do you calculate/compute/determine the spectral coverage of a frequency spectrum?

texts: I'm comparing frequency spectrum of FSK, ASK, QPSK, and MSK. And I'm asked which has the least and greatest spectral coverage. Could someone enlighten me on how to get it?


texts: Face recognition using independent component analysis (ICA)

texts: Reading about independent component analysis (ICA), I learned that one of its applications is face recognition. I think in this problem we have a database of images and a test image to be recognized. However, I can't figure out what the independent components are and what the mixture (multivariate signal) is.


texts: Interpretation of system response to unit impulse

texts:
I want to understand the meaning of unit impulse response when time flows. An example is given below:

In the example the left signal depicts a $\delta[n]$ function value of which is $1$ only at $n=0$. The LHS signal is response of the system to the unit impulse.

I want to understand how to interpret this when time flows, i.e. at $n=-4,\ n=-3$, what is response of the system?
Or at $n=0,\ n=5$, etc. what is response of the system?


texts: Ways to compute the n-the derivative of a discrete signal

texts:
This is a pretty general question about how to compute derivatives of a digital signal $x[n]$.

I would like to know what are the different approaches (from naive to complex) and how are they compared to one another? Is it possible with FIR/IIR filters? What are the pro's and contra's. Which are better for real-time applications?


texts: Conceptually, how does real time convolution reverb work?

texts:
I've got an impulse response of a hall, it's 10 seconds long.

Now say I want to apply this reverb to a wav file of some singing. I would perform a convolution of the data in two wav files and that the result would be a third lot of data, this time with the reverb. Great.

But how would this actually work in a real time setting, in a program like GarageBand, using a live input like an electric guitar?

Garageband can't convolve the full guitar track because it doesn't yet exist (because it's being played live!) One way that I thought of, was if the program performed the convolution on say, the 256 most recent samples of guitar input.

But this raises 2 issues:

Would the computer be able to perform so many convolutions every second?
And surely this introduces some sort of delay while waiting for the calculations to be processed?

If anyone could help explain, that would be great.


texts: DTFT of window function applied to input signal

texts:
$$x[n] = cos(\omega_1n) + cos(\omega_2n)$$

$w[n] = 1/N$ for $0 \leq  n < N, 0$ for everything else

Find the DTFT of $y[n]=x[n]w[n]$ expressed by the DTFT of $w[n]$, $W(\omega)$

I was thinking that multiplication in time domain is convolution in frequency domain. But $X(\omega)$ is 0 except for two frequencies so the convolution integral is 0? Which can't be correct? What to do here?


texts: Cocktail Party Problem — audio source separation

texts:
I am trying to solve the Cocktail Party Problem. I am trying to separate these two mixed audio files:

mixed 1 [WAV]
mixed 2 [WAV]

into 2 separate audio files that contain the 2 original sources, like this:

source 1 [WAV]
source 2 [WAV]

I found that it can supposedly be accomplished fairly easily. I found many sources of code online that claim to solve this problem, but the only code I found that was actually giving me some kind of result is the following code in Octave:

[x1, Fs1] = audioread('mixed1.wav');
[x2, Fs2] = audioread('mixed2.wav');
xx = [x1, x2]';
yy = sqrtm(inv(cov(xx')))*(xx-repmat(mean(xx,2),1,size(xx,2)));
[W,s,v] = svd((repmat(sum(yy.*yy,1),size(yy,1),1).*yy)*yy');
a = W*xx;
audiowrite('refined1.wav', a(1,:), Fs1);
audiowrite('refined2.wav', a(2,:), Fs1);

When I say "some kind of result" I mean that it actually outputs working wav files, although it did not separate the two sources very well at all. It basically returned the original mixed files, in lower volume. All other code I could find either did not show how to actually extract the source audio files after processing (example 1), or gave back corrupt WAV files (example 2).

example 1
example 2

I also converted the corrupt WAV files to MP3 to see if that would let me use them, which it did, but unfortunately I found out it did not separate the 2 audio sources.

I want to be clear, I don't want to take two separate audio sources and mix them artificially and then separate them, as seen in the following example:

Cocktail party algorithm SVD implementation... in one line of code?

I want to actually record 2, or more, mixed audio sources and separate them. Which algorithm to use to implement this? (ICA,PCA,SVD, etc)


texts: Is Phase Locked Loop is essential for BPSK signal reception?

texts:
I'm noob in DSP studying BPSK communication between speaker and microphone using acoustic signal. I read article of this BPSK communication which says it needs Phase Locked Loop(PLL) sequence to match both ends communicate precisely. But in my textbook, there is no mention of PLL in BPSK demodulation.

I want to communicate Tx/Rx within close range to get channel tap corresponding to its multipath effects in my room. In this case, does PLL is essential to synchronize the signal in both ends? Or I can communicate well without PLL and can get channel tap?


texts: Gaussian Equivalent of Convolving an Image 50 Times with a Box Filter

texts:
I have a image that I'm convolving 50 times with a box filter, and I like to replace this with a single gaussian filter. Because both box filter and gaussian filter are separable I can just study the 1D case.
Therefore...
Let $l \geq 1$ be fixed and $n = 50 \approx +\infty$ The box filter I'm using is defined as
$$
h_l(x) = \frac{1}{2l+1} \begin{cases}
1 & -l\leq x \leq l \\
0 & \text{otherwise}
\end{cases},
$$
here $x \in \mathbb{Z}$.
After a while I got that the gaussian equivalent for given $l,n$ (large $n$) is given by
$$
f_{n,l}(x) = \frac{1}{\sqrt{2\pi \sigma_{l,n}^2}} e^{-\frac{x^2}{2 \sigma_{l,n}^2}},
$$
where
$$
\sigma_{l,n} = \sqrt{\frac{n(l+1)l}{3}},
$$
the proof is in the answer of Fourier Transform of a Sequence and Inverse Fourier Transform.
Therefore I approximated the operator
$$
A_{h_l,n}={\underbrace{h_l*h_l*\ldots *h_l}_{\text{n times}} * (\cdot)}
$$
with
$$
G_{l,n} = f_{l,n}*(\cdot)
$$
However for practical purposes I had to consider the $f_{l,n}$ defined on a compact support (like $\left[-k\sigma,k\sigma \right], k \in \left\{1,2,3\right\}$.
The questions are:

Does this approach make sense?
If yes, and I've already implemented it for some reason using a single convolution with a gaussian (large kernel though) with 50 times the one with the box filter (you can assume $l = 5$ for my experiments) yields worse results, timewise speaking, assuming the approach is correct what can the reason be?

So either my approach is wrong or I'm probably missing something.
Just to clarify I'm trying to replace
for(int i = 0; i < n; ++i)
 blur(image,image,Size(2*l+1,2*l+1);

With
GaussianBlur(image,image,Size(2*k*sigma,2*k*sigma),sigma,sigma);

in opencv, and hopefully gain a speed-up.


texts: In many of the papers it is said that the derivative filter transfer function is given by: $$H(z) = \dfrac{1}{8T}\left(-z^{-2} - 2z^{-1} + 2z + z^{2}\right)$$ But no one gave the detailed information about it. Anyone has an idea about this?


texts: what is endpoint? I have a sample code to detect endpoints . it finds endpoint with sample, but when i run for my sample tif image, it does not well. so I want know the exactly meaning of endpoint in image processing.


texts: If I have two noisy signals where the noise is not correlated and I know the SNR of each signal, how would I find the SNR after multiplying the two signals together?


texts: If the frequency response of a system is time-independent, is this system LTI?

texts: Intuitively, I feel like a time-variant system would necessarily have a time-dependent frequency response, and vice-versa. So, is the time-independence of the frequency response necessary and sufficient to say that a sytem is LTI ?


texts: Phase changes of BPSK modulated carrier after moving to baseband

texts:
Given a BPSK-modulated carrier what would happen to the phase changes in the signal after the carrier is moved to baseband?

Would the time intervals between the phase transitions in the time domain remain the same?


texts: How to filter and downsample before FFT?

texts:
I would like to perform STFT on musical signal with defined sampling rate (44100Hz).
I would like to get FFT result for smaller range of frequencies than are maximally available
(not 22050Hz but for 4000Hz) so the result will have better frequency resolution.
So I think I should downsample it, but how can you downsample to the frequency
that is not in integer relation to the input frequency (you cannot leave the kth sample)?
Do you do some kind of interpolation to get values of new samples?
How does it affect the signal?

I also know I should filter out the frequencies higher than 8000Hz otherwise
the signal would get aliased. Is there some kind of filter revelant for usage in STFT?

All I know about filters is that to get better (more sharp) filter
you need more coefficents and so it will take more time to calculate.
I know there are IIR filters and FIR filters.
I read IIR filters can be unstable but should I care about it if I use a ready implementation (and I assume it's done right)?

Is it better to filter the whole signal (whole audio file)
at once? If I get the infite response from the IIR filter and I filter
the whole signal at once will the energy be most smudged at the end part of the signal?

I also read filters can pose some kind of delay on the frequencies and it differs for different frequencies. How do you analyse and compensate this phenomenon?

Edit: I found that you can get FIR with linear delay and that now they are used more often than IIR. But there's still a delay, what does it mean? That the frequency events (like musical notes) will occur later in sample number time? What will be this delay?

Edit2: When I want to downsample to sampling rate of 8000Hz I have to filter so there won't be any frequencies over 4000Hz. Is this practically possible, because I looked at different FIR filters characteristics and they just seem to greatly damp the stopband frequencies not to eliminate them? If I will have just a bit of the high frequencies in the signal, will the signal look ok when downsampled (aliasing won't be noticeable)?


texts: How to apply Prewitt Edge Detection algorithm on a given image?

texts:
I am trying to figure out the answer to the following question:

As I understand it, I am supposed to apply the algorithm only on this part of the image

[2,5,6]
[4,2,7]
[1,3,5]

My question is how to apply the two gradients for x and y respectively on this part of the image? Thank you in advance!


texts: When does the convolution of $2$ signals equal zero?

texts: For example, how can I determine if the convolution of $x(t)$ with $y(t)$ is equal to $0$?


texts: Detection of circles (ellipses) in 2D point cloud

texts:
Given a set of points (2D) i.e., point cloud (PC), the question is about a robust, accurate and computing-friendly method to find circles (or ellipses in advanced version).

The intuitive idea is to use Brute-Force Search on all possible points (as center){infinite!} and radii (again infinite!). This is ultra-extremely slow and inefficient.

As demonstrated bellow each fitted circle would be ranked based on the number of points (nn) positioned on the circle-circumference in a distance shorter than a threshold (t). So there is derr to present an average distance.

In advanced form ellipses are of interest to be fitted.

Any ideas, brain-storming, experiences, comments?


texts: How does decimation work without losing samples?

texts:
For example, changing the frequency from 32.768Mhz to 2kHz there is a scale down of 16384.
From the algorithms I've seen you have to discard 16384-1 samples and only count the 16384th sample. However, that many samples being lost will lose important parts of the information.
How does decimation work then?
EDIT
A signal is sampled at 2kHz and then modulated with a carrier wave of signal frequency 8.192MHz which is sampled at 32.768MHz. I am trying to revert it back to 2kHz, by decimation. I assume pass it through a LPF and  apply decimation however, the points sampled at 32.768MHz are then lost?


texts:
I took a square wave signal and individually shifted all the rising and falling edges by a random amount of time, within certain +/- bounds (a random time for each edge, not shifting all edges by the same time). This is what the FFT looked like before the edge shifting:

After the random edge shifting, the FFT looks like this:

I did not expect to still see sharp peaks at the signal frequency and odd harmonics. Rather, I expected that the peaks would become wider, with a width corresponding to the maximum frequency deviation that the time shift bounds allowed. Can someone explain what is going on here?

Edit: How is it different than this?


texts:
I am very confused about how to get the transmit sequence of the DPSK signal.

In my lecture notes, teacher give as the following example.

Assume the following rule is apply

"no change" of sign for information 1
"change" of sign for information 0

if the data sequence is "0000 1010 1110 0011"
then the transmitted sequence is "+ -+-+ +--+ +++- +---"

if the data sequence is "1101 0000 0111"
then the transmitted sequence is "- --++ -+-+ ----"

I cannot understand why the data sequence is 0000 and the transmit sequence is -+-+ instead of ++++? and When should I use + or - in the transmitted sequence?


texts:
I am new to EEG and signal processing, anyone can please check if I fill in the right numbers? I am confused about those terms.
For example, the recording using 22 EEG channels and 3 EOG channels, should I put 22 or 25 in the "Number of Channels"? Also, is the "Time points per epoch" equal to (seconds of motor imagination) * (sampling frequency)? I am so confused about each of the terms in the form...

Also, this is the dataset description: https://lampx.tugraz.at/~bci/database/001-2014/description.pdf
Many thanks!


texts: Steady State of a Difference Equation using MATLAB

texts:
I'm given this difference equation, and I'm being asked to plot its response to an input $x[n] = 4\sin^3\left(0.25\pi n+\frac \pi 3\right)u(n)$:

$$
y(n) = 0.9051y(n-1)-0.598y(n-2)+0.29y(n-3)-0.1958y(n-4)+0.207x(n)+0.413x(n-2)+0.207x(n-4)
$$

Using MATLAB's filter function, I implemented the following code:

num = [1 -0.9051 0.598 -0.29 0.1958];
den = [0.207 0 0.413 0 0.207];
x = 0:75; b1 = sin(0.25*pi*x+pi/3);
for i = 1:length(b1) sincub(i) = b1(i)*b1(i)*b1(i); end
inp = 4*sincub; z = filtic(num, den, [0 0 0 0]);
y = filter(num, den, inp, z);
stem(x, y, 'linewidth', 2);grid on
xlabel('Time-index, n'); ylabel('Amplitude'); title('Response to x(n)');

The plot of the input function is attached and so is the response.

The problem I'm facing is that I'm being asked to find the steady-state value of the output when the output appears rather periodic in nature (if x = 1:100 or 1:200 this will be clearer). Where is the transient response in such an output and what can be the steady state? Or is there something wrong in my code?

Any help would be much appreciated.


texts: What input to use for an AR model of a vowel sound?

texts:
I've recorded a 2-sec pronunciation of a vowel sound. The first 0.12 or so seconds of the signal are shown below.

Now, I've constructed an auto-regressive (AR) 8th-order model to compress this signal. (Actually, I'm just modelling 160 samples or 0.02 sec at a time.) The ar function in Matlab's System Identification Toolbox can estimate the parameters for an "optimal" spectrum fit.

My problem is choosing the stochastic input to the model filter. I suppose there's something better than white noise. The periodicity (14 periods per 0.02 seconds) leads me to think that an impulse train with the same period would be suitable.

If so, how would I choose the amplitude, and how would I find the periodicity? ACF and PSD estimations are quite noisy. Am I even on the right track?


texts: Radar for Vital Signs – Matlab Simulation

texts:
Interested to design and simulate FMCW radar for Vital Signs sensing.
The initial signal parameters are(1):

When using the following Matlab code to generate the waveform:
fc = 77e9;
c = 3e8;
tm = 50e-6;
bw = 4e9;
fs = 4e9;
waveform = phased.FMCWWaveform('SweepTime',tm,'SweepBandwidth',bw,...
    'SampleRate',fs);

sig = waveform();
subplot(211); plot(0:1/fs:tm-1/fs,real(sig));
xlabel('Time (s)'); ylabel('Amplitude (v)');
title('FMCW signal'); axis tight;
subplot(212); spectrogram(sig,32,16,32,fs,'yaxis');
title('FMCW signal spectrogram');

The results are:

When the fs is increased to 4GHz, the results are as expected.

Wondered what is the sampling frequency to be used in the Matlab simulation.
(1) https://www.diva-portal.org/smash/get/diva2:1326071/FULLTEXT02.pdf


texts:
I've started a hobby project which is to detect and count the number of impacts (for example someone clapping, bouncing a ball or hitting a boxing bag).

I've been reading and playing around (in java) with a few variations of total amplitude, FFT, IIR etc but with so much information and concepts to grasp (I'm normally a web/database developer) I can't figure out which is the right path to follow.

practically speaking I know i'll need a high frequency sample rate in order to distinguish between peaks and i think i'll need some form of filtered amplitude to distinguish between the crisp leading edge of the impact and the rumble noise that may follow.

I'm hoping someone here can point me in the right direction.

Thanks for your time!


texts: How to normalize frequency response charts

texts:
I want write a simplistic program that can transform a high-quality voice recording in a way that it sounds like it was recorded using a specific low-quality microphone.

I have obtained the mic's FR using a program that uses sine sweeps in a sort-of-anechoic room since there is no official spec available. Sine sweep was played by a good loudspeaker of which I have the FR specs.

Now these FR charts have different "dB ranges":

Mic FR: -90dB to -10dB
Speaker spec: starts at -45dB, moves to 85dB and stays mostly linear.

The goal is to normalize the mic FR data w.r.t to the speaker's FR spec and then use that result to create an (inverse) FIR filter.

Question: How to read, interpret and normalize these charts so I can do the math on them?

My guess would be to choose mic amplification during the sine sweep so that the max amplitude observed is 0dB (is this the same as the mic's clipping threshold?), and then divide by the min amplitude observed. And for the speaker, normalize in the 45–85dB range.

Example speaker frequency response chart:

Example microphone frequency response chart:


texts:
Recently I was reading a paper about the pink noise generation. But I don't have any background of this field.

I am confused with some part in the paper.

First, the Voss's algorithm generated a sequence of numbers, how do they use this sequence of number generated figure 1.

Second,in section 5.2, how do they get the melody shown in figure 11, figure 12 and figure 13?

Here is link of the paper: Generating 1/f Noise Sequences as Constraint Satisfaction: The Voss Constraint.


texts: Combining compressed measurements from the same source

texts:
Suppose I want to measure a signal $x \in \mathbb{R}^n$ subject to i.i.d. noise $\epsilon$.
In traditional Nyquist Sampling, I can increase my signal-to-noise ratio by measuring $x + \epsilon$ for $k$ times and averaging over the measurements.

$$\overline{x} = \frac{1}{K}\sum_{k=1}^{K}{(x +\epsilon_k)}$$

Instead of $x$ i now have $k$ compressed measurements $y \in \mathbb{R}^m$ and their corresponding k differing measurement matrices $\Psi  \in \mathbb{R}^{m*n}$ with $m<n$, that contain e.g. gaussian random entries so that $y = \Psi*(x+\epsilon_k)$. Assuming $x$ is sufficiently sparse so that reconstruction via $l_1$-Norm minimization is possible.

Can I also improve my SNR in the second case?

What are the noise implications if I reconstruct each of the $k$ measurement pairs $(y,\Psi)$ and take the average of the reconstructed signals?
What will be the noise implications of taking the average of all measurements $\overline{y}$ and $\overline{\Psi}$ and recover the signal from the single pair?


texts: how to chose independent sample from a non linear regression problem

texts:
I would have a question concerning the first part of my assignment here below: (in bold)

In this problem, the objective is to approximate a nonlinear function using a feedforward artificial neural network. The nonlinear function is unknown, but you are given a set of 13 600 datapoints uniformly sampled from it.

You have to build your individual dataset from 5 existing nonlinear functions f1, f2, . . . , f5. In the given matlab datafile, you
will find the following variables: X1,X2, T 1, T 2, T 3, T4 and T 5. The vectors X1 and X2 contain the input variables (in the domain [0, 1] × [0, 1]). The vectors T 1 to T 5 are the 5 independent nonlinear functions evaluated at the corresponding point
from (X1,X2). In other words, f1(X1(i),X2(i)) = T 1(i), f2(X1(i),X2(i)) = T 2(i), . . ., f5(X1(i),X2(i)) = T 5(i), for i = 1, . . . ,N, where N is the length of the vectors mentioned above. The datapoints are noise free (the evaluation is exact).

the new target T new, which represents an individual nonlinear function to be approximated by your neural
network:T new = (9T 1 + 8T 2 + 4T 3 + 2T 4 + 2T 5)/(9 + 8 + 4 + 2 + 2).

Define your datasets: your dataset consists now of X1,X2 and T new. Draw 3 (independent) samples of 1000 points
each. Use them as the training set, validation set, and test set, respectively. Motivate the choice of the datasets. Plot the
surface of your training set


texts:
For the Rayleigh fading model, I want use four multipath components,  each component has its delay and gain.

Can the gain in $\textrm{dB}$ of any of the individual four components be positive value?

I can understand that it can be zero or maybe negative indicating reduction in its amplitude due to delay and effects of channel, but I can not understand how it can be positive.

The overall signal resulting from the four components at the receiver may be with positive gain. This is reasonable, due to constructive addition of maybe inphase components, but how can a single component be with positive gain?


texts: Why are 8 points needed to compute a fundamental matrix?

texts:
Homograpies have 8 degrees of freedom.
Fundamental matrices have 7.
Essential matrices have 5.

To the best I could find, all those matrices are obtained by using the 8 point algorithm.

I don't see why the fundamental and essential matrices can't make do with less points.

Please enlighten me


texts: How to find the inverse Z transform of this function in z domain?

texts:
i have a function
$$F(z)=\frac{z-0.4}{z^2+z+2}$$ i need to find the inverse z transform of it , i have tried it with residues but the roots are too much ugly and it involves lots of messy calculations , is there any other way to proceed ?


texts: Why Shannon Theorem has nothing to do with frequency?

texts:
According to Shannon theorem
$$C= B \log _2(1 + S/N)$$
My question is, why there is no frequency in this formula?

Let's say we have 2 channels, both of them have same 20 MHz bandwidth,
one is from 100 MHz to 120 MHz,
another is from 1 GHz to 1.02 GHz.

Does this formula mean that these two channels have the same transmission speed?

Cause I think the one from 1 GHz to 1.02 GHz is faster, since it has a higher frequency.


texts: Biquad high-pass filter - calculating filter slope

texts: I have to design high-pass IIR Biquad filter with cutoff frequency of 80Hz, sampling frequency 24kHz, and filter slope of 24dB/oct @ 80Hz. I have used formula for HPF biquad coefficients from here. However, the slope is less steep for frequencies lower than 80Hz, please see the picture. How I can design a filter to give me 24dB/oct for the frequencies lower than 80Hz, to match the reference curve on the picture?


texts: Designing filters vs. editing fft components

texts:
What is the difference between designing high-complex filters to reduce/remove frequencies in a signal and calculating the fft, reducing/removing those frequencies manually, and reconstructing the signal? Although the latter seems to be easier, I am pretty sure there must be compelling reasons to use filters instead of editing frequencies.
Thanks.


texts: What is a correct way to find or "guess" a kernel which transforms an image into another image using Fourier Transformations?

texts:
Assuming I have two images, apple and orange; also assuming a filter kernel that transforms an apple image into an orange image possibly exists, how would some series of Fourier Transformations (and other spectral operations) get me a filter kernel? Is this possible? If possible, can it be immune to rotations/scaling/translation in spatial domain? (apple vs rotated apple)

In another way, if orange is

IFT(FT(apple) * FT(filter))

then how can filter be found using only apple and orange? If it is something like

filter = IFT(FT(apple) @@ FT(orange))

then what could @@ be? Is this possible?

Side question: if this is possible, are we able to extract "similarness" of an apple and an orange, just by looking at the result kernel form @@ operation? I mean, if kernel has only 1 on center and 0 on all other parts, this would be totally equal (both are apple or both are oranges) but what about other cases? Something like root mean squares of all kernel points?


texts: Is it possible to just remove the noisy part of signal?

texts: Is there a way to scan through a signal and remove the parts that don't look "normal". This would mean using more advanced then a simple pass band filter, but something that can look at a period in the signal and remove it if that period didn't fit into a "template".


texts: The meaning of the sign in a phase difference

texts:
Say I have 2 signals:

A = 1kHz Sine
B = 1kHz Sine, 30° lagging the first one.

If I plot the FFT-Phase of these 2 waveforms, and get the Phase values at 1kHz, I would get:

A = -90°
B = -120°

Questions:

Should the phase difference be (B - A) or (A - B)?
What is the conventional meaning for a negative phase difference?  Lagging or leading?


texts: Key detection Dance Music inaccuracies - matlab

texts:
I have been working on a project with a vide variety of functions for DJ'ing. I am nearing the end, however, the accuracy rate on the key detection part of it is not pleasant when fed tracks of Dance music. With classical music, the algorithm returns a very better accuracy rate.

First of all I must explain how I never studied Signal Processing at University and I had to learn the concepts on my own, so excuse my lack of extended knowledge in the subject (hence why I am asking here).

I spent most of my time researching and at the end I came up with an algorithm that is a mixture of techniques suggested in literature.

Summary of Implementation: The audio is split into 5.5 second sections and translated to mono, downsampled to 11025hz and translated into the frequency domain using STFT technique. The STFT result in hz is translated into real music notes by a Chromagram. The chromagram is a 12 dimensional chroma vector in which each bin represents a real pitch class i.e. the first bin represents A, the second represents A#, third represents B etc. Each chroma vector is then correlated against 24 key templates. A coefficient is obtained for every key and a weighting system rewards the highest correlating keys when the difference between the other correlating keys is significant, and penalises when the difference is minute.

I perform the STFT and Chromagram steps with the help of a package by Dan Ellis, that I found online.

Now in the original code the parameters are: w (4086) is the basic STFT DFT length (window is half, hop is 1/4)

In the paper written by the same person there is this section: http://imgur.com/0EVyjFc, where he explains how the STFT is performed.

First question: I am not understanding why he divides the window by half before passing it to the STFT function?

Now, I am using an FFT length of 8192 samples unlike the 4086 of Ellis, after performing parameter testing which gave me best results at that length.

Before the hanning window is calculated these are the values of the parameters..

sr =

11025

N =

8192

W =

4096

 H =

2048

The second question: what could be the reason for such inconsistent and inaccurate results with dance music? Is it perhaps some characteristic of dance music that makes it difficult for the chromagram to match the notes in hz from the STFT to real music notes? Perhaps because of the Kicks, or something to do with the lower frequency ranges? What do you suggest can be done to the audio prior to performing STFT? may be some kind of filter? Can you suggest trying any different parameter in the STFT? or in general any other suggestion / extra step to make the final detection better? Suggestions that would alter the main steps of the key detection completely would be a bit out of reach, however, as I dont have much time left to submit the project.

Thanks in advance!


texts: What exactly is Savitzky-Golay differentiation filter?

texts:
I could understand Savitzky-Golay filter as being smoothing filter, but then there also seems to be Savitzky-Golay differentiation filter, though for some reason, details do not seem to be clear.

So is Savitzky-Golay differentiation just about inferring first-order derivative from a local polynomial used for each data point? (This local polynomial least square method is another way of thinking about Savitzky-Golay, so by local polynomial I mean exactly that.)

If so, would frequency response of such a differentiation filter be simply multiplying $i\omega$ to frequency response of an original Savitzky-Golay filter?


texts: How can I tune into two FM frequencies at the same time?

texts:
I have a file source for a FM radio capture and have a working FM tuner. I need to tune into two frequencies and listen at the same time.

Any help to accomplish this would be appreciated!

Current setup:


texts:
I am looking for a low MIPS, low compression video encoder. This is for a 10fps, VGA type quality compression. What are my options? I need to be able to do this compression using a 150MHz ARM M4 CPU with Floating point support. (STM32F4)..

My idea is to push this compressed data out of the CPU with a parallel bus, there will be no processing done on the data. Compression rate wise, as much as possible, I just want to see the boundaries. This is for a low cost CCTV application, I like to see what I can achieve with a 5USD cpu and lots of transmission band with vs. a 30USD encoder with low data trasnmission bw.

10fps, VGA will generate roughly 25Mbit/sec data. This is fairly high data rate for anything out there. If I can bring this down to 5Mbit/sec, I think I can build a very low cost CCTV system. Once I get the data to the base, I can re-encode the data, therefore it doesn't matter what the compression mechanism is, as long as it is not very lossy.

Monochromatic video is what is necessary at moment over color.

Update

This CPU has 120MHz allocated to this task.
Memory interface is 16 bit, therefore external memory write/read is slower compared to internal memory.
Internal memory is 120KByte and it has 32 bit access fast access. Both cases the memory is accessed via AHB bus which we should assume 60MHz as the clock frequency.
Following data flow is expected:

Camera ->DMA ->External Memory (no cpu involvement)
External Memory -> CPU ->Compression ->Internal Memory
Internal Memory -> DMA -> Data Bus -> External Device

CPU will only read a chunk of data compress and write to its internal memory (the compressed data), later start a DMA transfer.


texts: What's the use of the ripple in the Equiripple method and their effect in the filtering process?

texts:
I read about the design methods of FIR filter which are:
windowing method, sampling frequency method and Equiripple method. And I don't understand the use of the ripple in the Equiripple method and their effect in the filtering process. Can anyone help me?


texts:
This is a close up of a Pokémon (Teddiursa):

How do I achieve this same effect in GIMP- i.e. a line that is kind of blurry on the edges? I'm sure there's a term for this, and I'm sure there is a really easy solution- I'm just not sure what to google.

Note: I may have asked this on the wrong site (I just searched image in the bar and this site came up). If I did, feel free to redirect me to where I should ask!

Thanks in advance!


texts: How does delta modulation work practically?

texts: How does delta modulation work in practice? And where is it used? I find it confusing that, in 1-bit quantization we use only 2 level; if we apply this quantization, there will be loss in information. So, why do we use this technique?


texts:
We are using a 16-bit DAC for a waveform generation between  to $500\textrm{ MHz}$ with the sampling frequency of $1200\textrm{ MHz}$. The specification for the waveform generation is $10\textrm{ Hz}$ frequency resolution throughout the band  $>60\textrm{ dB}$ SFDR. The spectral performance of the DAC is fine (more than $65\textrm{ dB}$ SFDR) for the frequencies which is satisfying the condition:

$$\frac{F_s}{F}=k \quad\big\vert\quad k\in \mathbb Z$$

The frequencies which is not satisfying the above condition yields some spurious which is not meeting my SFDR specification. Since the samples of every cycle will not be same, it's creating an envelope over the waveform, due to a phase values repeating itself periodically over a number of cycle. This envelope causing a spurious.

If we generate a frequency of $200.01\textrm{ MHz}$ in MATLAB with $F_s = 1.2\textrm{ GHz }$, we can clearly notice the envelope with periodic time period of $16.65\textrm{ $\mu$s}$ ($60\textrm{ kHz}$). The figure below is the MATLAB time-domain plot for $200.01\textrm{ MHz}$.

With my DAC, I'm getting a spurious at $\pm 60\textrm{ kHz}$ and $\pm 30\textrm{ kHz}$ apart from my generated frequency($F$).

The image below is the DAC output spectrum for $200.01\textrm{ MHz}$ captured with spectrum analyzer.

Is the spurious observed is due to the envelope?

MATLAB Simulation Code;

Fs = 1200e6;    %Sampling Frequency
T = 1/Fs;       % Clock Period
N = 2^18;       % No. of samples
t = (0:N-1)*T;  % Linear time interval
F = 200.01e6;   % Required Frequency
phase = 2*pi*F*t; % Consecutive Phase values in rad
sig = sin(phase); % Time Domain Signal
figure;
plot(t, sig), xlabel('Time in Sec'), ylabel('Amp'), title('Time Domain Plot for 200.01MHz');
wrap_phase = mod(phase, 2*pi);
figure;
plot(t,wrap_phase), xlabel('Time in Sec'), ylabel('Phase in rad'),           title('Phase values for 200.01MHz');

Suggestions are greatly appreciated.

Loganathan N


texts:
In my work i need to generate circularly symmetric complex gaussian random variables with non zero mean and certain variance in matlab.

I know the command for generating in case of zero mean , but how to do it for non-zero mean.


texts: How to get relative rotation matrix from two orientation values in android?


texts: Using overlap add for drawing spectrogram

texts:
I'm confused with overlap-add (OLA) in the following two scenarios

filtering/convolution an input signal;
applying an STFT on input signal only and draw its spectrogram.

When applying OLA to filtering/convolution, I'd take overlapped signal blocks, window them, take FFT of each windowed block, multiply filter core in frequency domain, IFFT the block, then apply  OLA to the current block with buffered previous block in time domain.

When drawing spectrogram of the signal, I assume I must take overlapped signal blocks, window them, take FFT of each windowed block. Now I'm not sure how I would draw the spectrogram with the magnitude response with the block.

Which way of the following is correct?

Apply window function to each overlapped window, and then simply draw the FFT magnitude response of each window, making the windows next to each other as if the spectrum of each window corresponds to the center time or left edge of the window.
Apply window function to each overlapped window, add up the windowed time-domain signal between adjacent blocks. Then take FFT of the current block and draw it. This requires caching one signal buffer.

The first approach seems to give the wrong timeline, if we consider the block signal starts at its left edge and ends at its right edge, because it's overlapped with the next block, unless we say the resulting frequency response represents the non-overlapped portion of the window only.

The second approach seems to counteract the windowing and thus beats the purpose, because adding the overlapped portion in time domain will cancel out windowing on the overlap.

I'm confused which way would be the correct OLA for deriving the spectrogram of the running signal.


texts: Butterworth Polynomial from Butterworth Filter

texts:
For the butterworth filter, in Matlab command:

[B,A]=butter(2,0.5,'low')

I find this result:

B = [0.29289  0.58579  0.29289]
A = [1  -3.33067e-16  0.17157]

From here I cannot reach the Normalized Butterworth polynomial:

G = [1  1.4142  1]

Nor the poles:

P = [-0.7071+i0.7071  -0.7071-i0.7071]

Which is the relation or the proper parameter i am missing, if any?


texts: Fast greyscale image segmentation on 16x16 image

texts:
I have a 8-bit greyscale 16x16 image where I want to extract coherent shapes with a more or less consistent pixel arrangement if possible (like: a rectangle, staircase, line). Currently, I'm doing this in two simple steps:

Find all pixels which have a value above a fixed threshold.
Group all pixels which share at least one edge with another pixel (find coherent areas by checking if pixels are neighbours).

Here, you can see an example image with the shape segmentation I would like to have and the one I get with the thresholding algorithm:

The main problem is that there are sometimes small overlaps of different shapes, where my current algorithm will extract it as one shape (see third image). It could even be that there is an additional pixel which adjoins the red, the blue and the green shape, which would lead to having only one big shape extracted in this example image.

One solution I was thinking about was generating a convex hull around a found shape and try to split the shape if it contains a too high percentage of black (below-threshold) pixels, but I would need to find a way of where to split it. If possible, I would also like to get rid of thresholding and maybe use deformable image contours (snakes) or another gradient-based method. On the other hand, I want to keep the algorithm as simple/fast as possible as it is only a sub-step of a obstacle detection pipeline which runs at 90 Hz (the image represents a u-disparity which is a histogram of a disparity image).

Does anyone have a suggestion what I could try?


texts:
I am using the FFT to calculate the amplitude and phase of AC cos signal. Regarding amplitude it gives me an accurate result but I get wrong result for a phase: 6 degrees instead of 36 degrees.

My MATLAB code is as follows:

fs=3840;                 % sampling frequency
N=64;                    % number of sample
f=60;                    % signal frequency in hz
w=2*pi*f;
amp=220;                 % ampitude of signal
delt=[1:N]*2*pi/N;       % sampling time interval
noise=randn(size(delt)); % added noise

sig=zeros(size(delt));
for i=1:1:length(delt)
    sig(i)=noise(i)+amp*cos(w*delt(i)+pi/5);
end

FF=fft(sig,N);
stem(abs(FF))
grid on

REAL=real(FF);
SUM_REAL=sum(REAL)
IMAG=abs(imag(FF));
SUM_IMAG=sum(IMAG)

% *******************************PHASOR REPRESENTATION*******************

real_amp=sqrt(SUM_REAL)                  % Amplitude of real part
imag_amp=sqrt(SUM_IMAG)                  % Amplitude of imaginary part
sumation=real_amp+imag_amp;
amplitude_nominal=sqrt(sumation)/N
phase=atan(abs(imag(FF))/abs(real(FF))) % phase in radians
PHI=abs(phase)*180/pi                   % phase angle in degrees


texts: Testing for Linearity and Shift-Invariance

texts:
I started school a week and a half ago and we have gotten already a big chunk of material and I wanted to check if what I am currently doing is correct. Here below are the problems to work out that help us for the exam in the future. (This class is signal processing)

for part (b)


texts: Convolution v.s. Cross Correlation in Digital Image Processing

texts:
I understand that from mathematical point of view, only difference between Convolution and Cross Correlation is that Convolution is commutative, while Cross Correlation is not.

In many articles Cross Correlation is explained as measuring similarity between two signals, and Convolution is explained as calculating relationship between two signals.

My question is this, what is the point of commutative property? How does it make Convolution different from Cross Correlation in practice? Or is it just there for "better" mathematics and easier proofs?


texts: What are the measurable factors of image sharpness?

texts:
I need a way to present data on an essay written about image sharpening algorithm. So I've thought that if I measure a factor of sharpness from image or relative sharpness (between test img and reference img) and another factor like PSR for noise, then I could analyze resultant data with maths and build the essay around that. Is it the right approach to measure image properties?
I'm novice when it comes to photography and graphics so any kind of help is much appreciated.


texts: Why we need Frequency and Time information at the same time

texts:
The big disadvantage of a DFT is that it has only frequency resolution and no time resolution. This means that although we might be able to determine all the frequencies present in a signal, we do not know when they are present. So we go for Wavelets.

My question is, What are the applications (other than music & speech processing ) that require both the time and frequency information at same time  ?

How do you relate that we require both spatial (time) and frequency information in an image at a same time ?

Give me some good examples and suggest a book (PDF links) to learn Wavelet Multiresolution Analysis (For Dummies)


texts: Aliasing due to the Convolution of Gaussian Functions

texts:
For two discrete-time sequences $f[n]$ and $g[n]$, their linear convolution $(f*g)[n]$ is also given by
$$f*g = \mathcal{F}^{-1}(\mathcal{F}(f) \cdot \mathcal{F}(g)),$$
where $\mathcal{F}$ and $\mathcal{F}^{-1}$ denote the DTFT (discrete time Fourier transform) and IDTFT (inverse discrete-time Fourier transform) respectively.

Let us consider two Gaussian sequences $f[k]$ and $g[k]$ in the momentum space and we want to convolve them using the formula above.

import numpy as np
import matplotlib.pyplot as plt

L = 17.5
N = 48
dx = L/N
dk = 2*np.pi/L
x = np.arange(N)*dx - L/2
k = 2*np.pi * np.fft.fftfreq(N, dx)

alpha = 1
beta = 1

def f(k):
   return np.sqrt(np.pi/alpha) * np.exp(-k**2/(4*alpha))

def g(k):
   return np.sqrt(np.pi/beta) * np.exp(-k**2/(4*beta))

fs = np.array([f(k_) for k_ in k])
gs = np.array([g(k_) for k_ in k])

fftconvfg = np.fft.ifft(fs * gs)

plt.plot(ks, np.fft.fftshift(fftconvfg))

I get the following plot.

Question

How can I demonstrate that my plotting is (or, is not) subject to the aliasing artifacts? And if there are aliasing artifacts, how can I get rid of it?


texts:
I am experimenting with HRTFs.

Specifically I'm trying to create 12 impulse responses that the brain can easily differentiate.

The more distinct they are from one another the better.

So I'm trying to figure out ways of making them as distinct as possible.

My best attempt so far is to use HRIRs on the horizontal plane with varying azimuths.

I could use HRIRs for 12 equally-spaced points (i.e. azimuth 0 30 60 90 ... degrees),  but human beings can perceive tiny differences in angle directly in front (as opposed to the sides), so a more sensible spacing would be something like 0 10 20 45 90 135 160 170 180.

That's the sort of thing I'm looking into...  I give it as an example as I would be grateful for guidance in this more general enquiry, and also it shows my motivation for this question: maybe I should drop this line of enquiry as it won't help?

Anyway, I'm wondering whether HRIRs from an echoic environment may present more cues, and hence provide better localisation.

And if this is the case, is there any shortcut to actually recording the HRIRs in a cathedral (which has actually been done: http://www.ind.rwth-aachen.de/en/research/tools-downloads/aachen-impulse-response-database/)?

i.e. is it possible to take an impulse response for a cathedral,  and convolve it with each HRTF?

π


texts: What factors should I consider when choosing an IIR filter realization?

texts: IIR filters may be implemented as direct form 1 or 2. But how do you decide which form to use? What are the pros and cons of each?


texts: How do you find the phase and inverse Fourier transform of this frequency spectrum?


texts:
I'm working on a real time beat detection algorithm. The first step, I believe, is to detect onsets (sudden volume increases). Then, in simplified terms, I can correlate these to find the tempo and use the strongest onsets to guess the beat position.

Say we are reading the audio in with 20ms chunks. My first guess was to just subtract the volume of one chunk from the previous one. The "volume" for a chunk would be a sum over the absolute value or squared signal, or maybe just the peak value (not sure which approach would be best). Then I can threshold these values to find the biggest volume changes.

To my surprise, according to papers like these (page 3) it seems that we often do onset detection by splitting into frequency ranges. For each audio chunk, they get the power for each of 7 frequency ranges, and compare it to the power of the previous chunk at that frequency (and the two neighboring frequency ranges), taking successive differences.

Then we have onset strengths, i.e. changes in power, for the 7 distinct ranges. And sum them back up across frequency to get the overall onset strength for that time.

Why is this done instead of just using the signal (no FFT required)? This seems to me to be just deconstruct and reconstruct the same information. The only thing I can think of is that the intermediate information of the power at different frequencies could be useful (isolating a kick drum, etc.)


texts:
I'm new to Radar in general, and I'm studying RADAR using online resources.  I came across the following slide which shows the process flow of the Radar signal processing.

The thing I don't get in the figure is the signal processing block and the general purpose Computer block. The following is my basic understanding of the process flow which is very different than the flow in the picture:

Pulse compression -> matched filter -> Threshold -> Range Detection -> Clutter rejection (Doppler processing) -> Doppler Detection.

The reasoning is that we need to find the target's range gate before we can process the target's Doppler information, and to detect the target's range, we need to set some threshold to separate our target from other clutters and noise. After we locked the target into certain range gate, we can process the target's Doppler information from the I-Q data obtained after processing the received echo. Any clutters in the same range gate can be rejected by using a set of Doppler filter banks as the target and clutters have their respective Doppler characteristics/frequencies.
Could someone explain to me where was my misunderstanding? I just got started, so there must be many things I got misunderstood. So thank you for your time, patience, and help.

regards,
zhengguo Sun


texts: Why does power spectral density of OFDM signal changes with number of zero subcarriers

texts:
I am trying to plot the power spectral density (PSD) of an OFDM signal with $N_{dsc}$ subcarriers and $N_{zeros} = N_{fft}-N_{dsc}$ zero subcarriers.

I am using the matlab function pwelch() to plot the PSD. However, every time I change $N_{fft}$ or equivalently $N_{zeros}$, the PSD plot shifts. I was wondering why does this happen? In the plots, I align the the PSD curves for different $N_{fft}$ to show the shift in PSDs. The trend is, the PSD decreases (also the power decreases) with increasing $N_{fft}$ (i.e. higher sampling frequency in time). I am wondering why the PSD curves would shift or the power would change.

clc
clear all
Nsymbols = 100;% Total number of OFDM symbols
Bandwidth = 50e6;
Ndsc = 990;
SCS = Bandwidth/Ndsc;

NfftOriginal = 1024;% Original FFT size
SamplingRateOriginal = NfftOriginal * SCS; %
OSR_set = [2 4 8];
for l = 1:length(OSR_set)
%% Oversample to see wider spectrum than nyquist
OSR = OSR_set(l);%  %Oversampling parameter
SamplingRate = SamplingRateOriginal*OSR; % New sampling rate
Nfft = SamplingRate/SCS;%FFT size with oversampling
Nzeros = Nfft - Ndsc;
psd = zeros(1,Nfft);
for k = 1:Nsymbols
% Generate random data block.
M = 4; %Modulation order
x = randi([0 M-1],1,Ndsc);
inputSymbols = qammod(x,M);

%% Create OFDM symbols
rr1 = 1:Ndsc/2;rr2 = Ndsc/2 +1:Ndsc;
if Nzeros~=0
inputSymbols  = [0 inputSymbols(rr2) zeros(1,Nzeros-1) inputSymbols(rr1)];
else
inputSymbols  = [0 inputSymbols(rr2) inputSymbols(rr1)];
end

ofdmSymbol = ifft(inputSymbols,Nfft);

window= [];
[P_Hz,W] = pwelch(ofdmSymbol,window,[],Nfft,SamplingRate);

psd(k,:) = P_Hz;

end
f = [-Nfft/2:Nfft/2-1]*SamplingRate/Nfft/1e6;
PSD = mean(psd);
power = sum(PSD)*SCS
plot(f,10*log10(fftshift(PSD))+(0-10*log10(max(PSD))), 'LineWidth',1);
hold on
end
xlabel('Frequency [MHz]')
ylabel('PSD [dBW/Hz]')


texts: How to construct marginal Hilbert spectrum

texts:
Suppose $f$ is a signal of duration $t_d$ sampled each $0.01 sec$. After employing empirical mode decomposition (EMD) to $f$, $n$ number of intrinsic mode functions (IMF) would be extracted. Using Hilbert transform, instantaneous frequencies ($\omega$) and instantaneous amplitudes ($H$) were calculated. As a result the $\omega$ is a matrix with the number of rows equal to length of signal f and number of columns equal to $n$ (so is $H$).
Now I want to construct marginal Hilbert spectrum using $\omega$ and $H$. I found the following formula in literature:
$$h(\omega) = \int_0^{t_d} H(\omega,t)dt$$
What confuses me is that the result of integration is a vector of length n (that is the number of IMFs). On the other hand, the values of $\omega$ for each IMF differs from others and they are not increasingly sorted (like what we have in wavelet transform).
I hope the above clearly explains my problem.


texts: What is the rate of change of amplitude? Frequency?

texts:
I know that frequency is not the same as the rate of change of amplitude, but why?

Surely a high frequency is when your amplitude changes rapidly. Does an FFT perform something similar to differentiation of a function?

Furthermore, what else is needed other than my amplitude values to plug into an FFT to get frequencies?


texts: How to choose sampling rate for non-band limited signal given as an expression?

texts:
I have a signal given as an expression $x(t)$.  In frequency domain most of the information is around 0 and higher frequencies progressively get smaller and smaller compared to DC component.

I was wondering how to determine the sampling rate I should use if I wanted to compute discrete samples and pass them through some filter?

I was considering that if I pick some $F_s$ sampling rate, aliasing will cause frequencies above $|F_s/2|$ to be folded back into the region $F_s/2$.  Using Parseval's theorem the sum of square errors because of this appears to be $\int_{|\Omega > F_s/2|}|X(j\Omega)|^2d\Omega$ .  So I could try to figure out the acceptable error and pick $F_s$ based on that.  But that integral goes to infinity and what if the integral doesn't converge, or it's not something I can compute?

I've also seen discussions on anti-aliasing filters that mention the stop band attenuation should be higher than the SNR (eg anti-aliasing filter).  In my case I don't really have an anti-aliasing filter because I'm just computing x(t).  But it seems if I want 16 bits resolution, SNR=98dB so if I compute the frequency at which $20log(\frac{|X(j\Omega)|}{|X(0)|})<-98$ it will be as if I used anti-aliasing filter.  However, I don't understand why the stop-band attenuation is chosen to be equal to SNR, and what that means in terms of signal error.  Because while -98dB is really small compared to the rest of the signal, there are infinitely many aliased frequencies being folded and added up.

Thanks for any clarification.

Edit

I have frequency vs relative magnitude (relative to magnitude at 0 frequency) plot calculated by sampling at 100kHz and 1MHz and taking DFT of the samples.

What reasonable conclusion about required sampling rate can I make based on something like this?  How can I justify it?

For example at sampling rate 100kHz, the smallest frequency component appears to be 158 dB smaller than the largest (or 10^(7.9) times smaller).  Is that small enough to be unimportant to overall signal?  How should I go about determining what's small enough?


texts:
I've implemented the least squares method to find the homomorphic image to fix the rotation and projection in an image.

Now I'm trying to implement the OpenCV warpPerspective method in order to "fix" my image, my python implementation is like:

def fix_image(img, t):
    new_image_map = {}
    minx, miny = img.shape[0], img.shape[1]
    maxx, maxy = 0, 0
    for i in range(img.shape[0]):
        for j in range(img.shape[1]):
            xy = np.array([i, j, 1], np.float64)
            uv = np.matmul(t, xy)
            uv = uv / uv[2]
            minx = min(minx, uv[0])
            maxx = max(maxx, uv[0])
            miny = min(miny, uv[1])
            maxy = max(maxy, uv[1])

            new_image_map[int(uv[0]), int(uv[1])] = (i, j)

    minx, miny = int(minx), int(miny)
    maxx, maxy = int(maxx), int(maxy)
    final_img = np.zeros((maxx - minx + 1, maxy - miny + 1)) \
        if len(img.shape) == 2 else np.zeros((maxx - minx + 1, maxy - miny + 1, img.shape[2]))

    for k, v in new_image_map.items():
        final_img[k[0] - minx, k[1] - miny] = img[v]

    return final_img

I know that I still need to interpolate the empty points but the problem is that the shape is not right, I'm checking the results by comparing with the actual OpenCV implementation.

dst = cv2.warpPerspective(storm_img, tr, (1448, 1456))

As you can see, it is far from the expected.

resp = fix_image(storm_img, transformation)

I do not want to just use the OpenCV method because I want to learn how to implement it.
What am I getting wrong?


texts:
Why do we need an oversampling in OFDM signal? and how to do it?
If around half of the Sub-carriers are only used to send data, then do we need to perform oversampling to the signal? Is it necessary to have LPF in OFDM transceiver?


texts: Iterative Blind Sinus Signal Suppression

texts:
There are two real signals in the form of $A_i sin(wt+p_i), i=1,2$. Suppose frequency $w$ of both the signals is the same and amplitude $A_i$ and phase $p_i$ are different. The first signal has unknown $A$ and $p$, but they are constant in the time of observation (for simplicity only, actually they aren't). The second signal is under control. We only have it's difference $x(t) = s_1(t)-s_2(t)$. Some iterative algorithm is needed to minimize power of $x(t)$. So $x(t)$ is available input and $A_2(t)$, $p_2(t)$ are parameters under control.

The question is: is it some robust and rapid algorithm for jointly control both amplitude and phase to minimize power of $x(t)$? My idea was to implement complex gradient method: phase and amplitude at each step are represented as a complex number $C(t)$. Signal $s_2(t)$ can be set as $Re[C(t) exp(iwt)]$. But I can't understand how to define cost function and gradient in this case and also this approach seems to be computationally redundant. Any ideas?

Thanks in advance!


texts: Applying the CUSUM algorithm to a correlated random process

texts:
As far as I know, the CUSUM algorithm is meant for detecting change points on discrete-time uncorrelated random processes.

For instance, to apply the CUSUM algorithm to a discrete Gaussian process, we must know for sure that each sample is statistically independent from the others. I have seen this assumption in the CUSUM algorithm demonstration.

However, I have not found the CUSUM alternative for a discrete-time correlated random process. Let's say, for a realization of a band-pass filtered Gaussian process $X[n]$ with a changing variance at a certain sample $n_c$.

What to do in such a scenario? Can I still apply CUSUM?


texts: How to smoothen signal with missing values before differentiation?

texts:
I want to differentiate a noisy signal with many, randomly located, missing data values. Which smoothing techniques should be applied before differentiating the signal?

I have a velocity signal at 200 Hz, but due to wireless transmission about half the data values are missing (NaN), up to 8 in a row (40 ms between data points). I would like to get the derivative signal (acceleration), but without smoothening, it is too noisy. I'm mostly interested in a rough (!) estimation of maximum acceleration. What is the best techniques to handle the missing data? Linear interpolation between known data points?


texts:
T = 3*(1/25);
fs = 1000;
t = 0:1/fs:T-1/fs;
x = sawtooth(2*pi*25*t,1/2);
x = (x + 1)*0.5;
subplot(3,1,1)
plot(t,x)
grid on
xlabel('Time t (sec)')
ylabel('Amplitude')

I want to take DFT(Discrete Fourier Transform) of my signal using FFT and FFTShift and find frequency spectrum. However,the graphics I found did not seem right to me. Is there anyone who can help? If there are errors in what I do, I want to find and fix it.

Following code for second graph:

y = fft(x);
n = length(x);
f = (0:n-1)*(fs/n);
power = abs(y).^2/n;
subplot(3,1,2)
plot(f,power)
xlabel('Frequency')
ylabel('Power')


texts:
I am trying to use the dsp.CICDecimatior function and comparing the output to a C code algorithm that I have. The CIC decimator is configured as decimation factor of 8 , 3 sections and differential delay equals 1.
below is the code used:
CIC1 = dsp.CICDecimator(8,1,3);
k=0;
step1_sig=zeros(1,128);
for i=1:16
    step1_sig(1,i)=CIC1(real(normalRx(1+k:8+k)'));
    k=k+8;
end
step1_sig'

The output looks mirrored as you can see in the figure below:

I am confident that the C code output is correct, because I have compared it to the following C++ :
https://github.com/EsonJohn/CIC-filter
Both produced the same output, so the issue have to be in my Matlab code.
In the traditional CIC decimator algorithm, the delay unit in the integrator is used in the feedback path, but in the MATLAB block it uses the unit delay in the feedforward path of the integrators:
https://www.mathworks.com/help/dsp/ref/dsp.cicdecimator-system-object.html#d120e192907

Although the filter will be equivalent (same frequency response), the numerical output of the two implementations are a different (I guess it is the mirrored look that I mentioned above).
As it seems that the reason to the problem might be the way the CIC filter is implemented in MATLAB with the unit delay in the feedforward path of the integrator, the question now becomes:
Is there a way of using the dsp.CICDecimator with the unit delay on the FEEDBACK path of the integrator?
It should be like this:


texts: Is multiplying by Ts faster than dividing by fs?

texts: Say fs = 1000 and Ts = 0.001. Would it be faster to compute Ts at the beginning and subsequently multiply by 0.001 instead of dividing by 1000 when computing frequency-dependent quantities?


texts: What does one need to know in order to build a software synthesizer?

texts: For someone who has some experience in software development, loves his synths and knows the [very] basics of digital audio representation, what are the first steps he should follow in order to program a music synthesizer, DSP-wise?


texts: I am having little difficulty to understand that why most of the adaptive algorithms use error power or addition of error power as cost function/minimization criterion. I have read that minimization of error power criterion gives us best results from estimation mean point of view. I am not being able to grasp that either. So can someone please tell me in simple language what are the actual reasons to use above criterion? Why cant we simply use error as the minimization criterion?


texts: Reduce the number of frequencies after FFT

texts:
I have a long signal (1 day sampled at 500 Hz), which results in many frequencies if I calculate the amplitude spectrum (see e.g. here). However, I am only interested in the "big picture", let's say only frequencies of natural numbers (i.e. 1, 2, ..., 250 Hz).

Should I simply remove all other frequencies? Should I do something like a binning? Or is there even a better solution?


texts: Matlab, incomplete code for spectrum estimation ; Hamming window, plotting the density against periods rather than frequency bins

texts:
I've got some quarterly time series(see google drive link at the bottom), from which I should be getting a spectral density estimate that looks like the black line in the figure in the pdf (also provided in the link). I have verified that the data I'm using is exactly what goes into that spectral density. The zero-padding parameter the authors use is 1024, and the length of the Hamming window is 13. Also, the time series is demeaned. So far, what I have is the following code:

clc;
close all;
A = xlsread('nonfarmhours.xls','B2:B263');
xn=detrend(A)';
N=1024;
L=length(xn);
xn=[xn zeros(1,N-L)];
ymtlb=fft(xn);
ssd=abs(ymtlb).^2/length(xn);
plot(k,ssd);

Two obvious points-I haven't been able to include the effect of the Hamming window and to convert frequencies into periods on the x axis. Hopefully this is all that is missing. At the moment, I cannot proceed, so I'd greatly appreciate any input in reproducing that figure as far as the code is concerned.data and figure


texts: Parallel equalizer, working for boosts but not cuts

texts:
I am trying to replicate the behaviour of a parallel equalizer.

The approach is to use a parallel sum of bandpass filters like so:

$Response = 1 + bandpass1 * (gain1 - 1) + bandpass2 * (gain2 - 1) + ...$

Boosts and cuts are separately grouped and run in series.

I have successfully got the model working for two boosts in parallel. But running two cuts in parallel produces an unexpected result.

The figure below illustrates the problem. The thick blue line illustrates two boosts in parallel (thin orange and red line show the individual boosts that are being combined). The thick purple line illustrates two cuts in parallel (thin green and light-blue line show individual cuts that have been combined). As can be seen the individual cuts are a mirror image of the individual boosts but the parallel sum doesn't work for cuts.

Does anyone know what I'm missing so that that the thick purple line is a mirror image of the think blue line?

Here as my matlab code:

% boost 1
f1 = 176;
g1 = db2gain(12);
q1 = 1;

% boost 2
f2 = 672;
g2 = db2gain(12);
q2 = 1;

% cut 1
f3 = 176;
q3 = 1;
g3 = db2gain(-12);

% cut 2
f4 = 672;
g4 = db2gain(-12);
q4 = 1;

% bandpasses for boosts
[b1, a1] = bandpass(f1, proportionalQ(q1, g1));
[b2, a2] = bandpass(f2, proportionalQ(q2, g2));

% bandpasses for cuts
[b3, a3] = bandpass(f3, proportionalQ(q3, g3));
[b4, a4] = bandpass(f4, proportionalQ(q4, g4));

f = logspace(log10(20), log10(20000), 10000);

r1 = response(b1, a1, f); % bandpass response for boost 1
r2 = response(b2, a2, f); % bandpass response for boost 2
r3 = response(b3, a3, f); % bandpass response for cut 1
r4 = response(b4, a4, f); % bandpass response for cut 2

% run the analog bandpass filters in parallel as two boosts (OK)...
p1 = 1 + r1 .* (g1 - 1) + r2 .* (g2 - 1);

% run the analog bandpass filters in parallel as two cuts (NOT OK)...
p2 = 1 + r3 .* (g3 - 1) + r4 .* (g4 - 1);

figure;

semilogx(f, response2db(p1), 'LineWidth', 2); % parallel boosts (OK)

hold on;

semilogx(f, response2db(1 + r1 .* (g1 - 1))); % individual boost plot 1
semilogx(f, response2db(1 + r2 .* (g2 - 1))); % individual boost plot 2

semilogx(f, response2db(p2), 'LineWidth', 2); % parallel cuts (NOT OK)

semilogx(f, response2db(1 + r3 .* (g3 - 1))); % individual cut plot 1
semilogx(f, response2db(1 + r4 .* (g4 - 1))); % individual cut plot 2

xlabel('Frequency');
ylabel('Magnitude (dB)');

axis([20, 8000, -16, 16]);
grid;

hold off;

bandpass.m

function [b, a] = bandpass(f, q)
    b = [0, f / q, 0];
    a = [f * f, f / q, 1];
end

response2db.m

function [db] = response2db(r)
   db = 20 .* log10(abs(r));
end

db2gain.m

function [g] = db2gain(db)
    g = 10 .^ (db ./ 20);
end

proportionalQ.m

function [q] = proportionalQ(q, g)
    q = q .* sqrt(g);
end

response.m

function [r] = response(b, a, f)
    s = 1i .* f;

    r = (b(1) + s .* b(2) + s .* s .* b(3)) ...
        ./ (a(1) + s .* a(2) + s .* s .* a(3));
end


texts: How to Mesure the smoothness of a signal

texts:
so how can i determine if a signal is smooth or not ? And if its possible to get something indicating the level of the smoothness of my signal.

I looked at the r-squared and hurst exponent but i wanted to know if they where others methods.


texts: Should I Use a High Pass Filter (HPF) or Low Pass Filter (LPF) to Enhance the Features for Image Splicing Detection?

texts:
I'm recently learning image splicing detection. I've already known image splicing can bring some abrupt changes to an image,which generate the sharp edges.And sharp edges correspond to high frequency. And I want to extract features from images for splicing detection.
In my opinion,I should use a high-pass filter to enhance the edges,but I've read some papers which mentioned using a low-pass filter for gradient detection techniques applied in discontinuity detection.
Now I am very bothered with this.Which kind of filters should I use?I would really appreciate if someone can help me!


texts: Need help deriving the energy of a signal

texts:
I am solving old exam problems in preparation of my exam in signals, and I'm having trouble with a question.

For a continuous aperiodic signal with the spectrum $X(\omega)=\exp(-\omega^2)$
I am to derive the energy of the signal. I have made it this far, in agreement with the solution manual:

$W = \frac{1}{2\pi}\int_{-\infty}^{\infty}
\exp(-(\sqrt{2}\omega)^2)\,\mathrm{d}\omega$

The assignment then suggests substituting in the error function

$\mathrm{erf}(z) = \frac{1}{\sqrt{\pi}} \int_{-z}^z \exp(-y^2)\,\mathrm{d}y$

and exploiting that $\mathrm{erf}(z) \rightarrow 1$ towards infinity, which makes good sense, but the result in the solution manual before reducing the expression is

$W = \frac{1}{2\pi} \sqrt{\frac{\pi}{2}}
\mathrm{erf}(\sqrt{2}\omega)\Big\rvert_{\omega \rightarrow \infty}$

I don't understand where the $\frac{1}{2}$ in the square root comes from, so I would appreciate if anyone could help me understand this.


texts: confused about time shifting property of Laplace Transform

texts:
In book signals and systems 2 edition a question is given which is as follows:

$$      x(t)=e^{-3(t+1)}u(t+1)      $$

and we are asked to find the unilateral Laplace Transform of the signal. The method that is given in the solution manual is as follows:

Using Table 9.2 and time shifting property we get:

$$     X_2(s)  = \frac{e^s}{s+3}      $$

Now I am given a question which is as follows:

$$      e^{-2t}u(t-1)       $$
and asked to find the Laplace Transform. Now can I apply the method as used above for unilateral Laplace Transform and get:

$$             \frac{e^{-s}}{s+2}       \rightarrow A   $$

Or does that method only holds true for unilateral Laplace Transforms? Because the answer marked A is wrong when I use this method. Also tell me when can I apply the property?


texts: Correlation of discrete time periodic sequences

texts:
So I was reading this textbook -  Digital Signal Processing by Proakis and Manolakis. The authors define the cross-correlation operation for 2 energy signals $x(n)$ and $y(n)$ in section 2.6.1 as:

$$ r_{xy}(l)=\sum_{n=-\infty}^{\infty}x(n)y(n-l) $$

In section 2.6.3, they define the cross-correlation operation of two power signals as:

$$ r_{xy}(l)=\lim_{M\to\infty}\frac{1}{2M+1}\sum_{n=-M}^{M}x(n)y(n-l) $$

My question is, why do we need to have a separate definition for power signals? Are these two definitions the same? If they aren't same, what is the intuition behind defining them like that?


texts: Is a Kalman filter suitable to filter projected points positions, given Euler angles of the capturing device?

texts:
My system is the following. I use the camera of a mobile device to track an object. From this tracking, I get four 3D points that I project on the screen, to get four 2D points. These 8 values are kinda noisy, due to the detection, so I want to filter them to make the movement smoother and more realistic. As a second measurement, I use the device's gyroscope output, which provides three Euler angles (i.e. the device attitude). Those are more precise and at greater frequency (up to 100 Hz) than 2D positions (around 20 Hz).

My first attempt was with a simple low-pass filter, but the lag was important, so I now try to use a Kalman filter, hoping it will be able to smooth the positions with little delay. As seen in a previous question, one key point in a Kalman filter is the relation between the measurements and the internal state variables. Here the measurements are both my 8 2D point coordinates and the 3 Euler angles, but I'm not sure about what I should use as internal state variables and how I should connect the Euler angles to the 2D points. Hence the primary question, is a Kalman filter even suitable for this problem? And if yes, how?


texts: unit step signal as sum of impulses from MIT OCW video

texts:
From MIT's OCW on Signals and Systems by A. Oppenheim, at 4:30 mark https://www.youtube.com/watch?v=jGk3w1b7UXQ&index=3&list=PLLNp7XoiSLQYygYw8Mzt763zZCQdzCZcd

He said that by forming the sum from minus infinity to some value n of a unit impulse function is equal to the unit step function.
$$u[n]=\sum_{m=-\infty}^n \delta[m]$$

At n<0 the sum is accumulating nothing. We see that indeed it is equal to the unit step since the unit step is zero at n<0.

However, I am confused why at n>0, the sum can be equal to the unit step. From the diagram in the video, we see that there is only one impulse value that can be accumulated in the sum. But then the unit step is not composed of just one impulse, rather it is composed of an impulse train.

The expression is not adding an impulse train since the impulse function is defined only at m=0 which is 1. At m=1,2,3..the impulse function is already zero, so there is just one impulse that is contained in the expression.

What is my wrong assumption/understanding?


texts:
I need to control crane trolley (pendulum), I have state space representation as:

$
A=\begin{bmatrix}
 0 & 1 & 0 & 0  \\
 0 & 0 & \frac{m_b}{m_j}g  & 0  \\
 0 & 0 & 0 & 1  \\
 0 & 0 & \frac{m_b+m_j}{m_j L}g  & 0  \\
 \end{bmatrix}
$

$
 B=\begin{bmatrix}
 0 \\ \frac{1}{m_j} \\ 0 \\ -\frac{1}{m_j L}
 \end{bmatrix}
$

$
 C=\begin{bmatrix}
 1 & 0 & 0 & 0
 \end{bmatrix}
$

$
 D=\begin{bmatrix}
 0
 \end{bmatrix}
$

I have been told that if I want to use state feedback, I need to extend this system with integrator. Why?

(I could provide any other possible information, just ask in comment)


texts: Why do we need deterministic measurement matrices in compressed sensing?

texts:
I recently introduced myself into the field of CS, but I do not understand why some people try to find deterministic measurement matrices?
If I am correct, gaussian random matrices are very powerful with their properties. They are easy to create, their reconstruction power is very good (having a low RIP constant) and so on.


texts: Continuous and discrete-time raised cosine filter properties in frequency domain

texts:
In communication systems, the raised cosine (RC) filter is split into root-raised cosine (RRC) filter at the transmitter and the receiver. The combined response of both RRC filters is the RC filter.

If the transmit RRC filter is analog (continuous-time or CT), how the combined response of both filters change if the receive RRC is placed (a) before digital sampling and (b) after?

For example, let $h_{\rm T_{RRC}}(t)$, $h_{\rm R_{RRC}}(t)$ and $h_{\rm RC}(t)$ be the impulse responses of the transmit RRC, receive RRC and RC filters, respectively. Let their frequency responses be $H_{\rm T_{RRC}}(f)$, $H_{\rm R_{RRC}}(f)$, and $H_{\rm RC}(f)$, respectively. Let the symbol period be $T_\rm c$.

Case 1: Receive RRC filter is continuous-time

Here the system is as follows:

Transmit RRC $\longrightarrow$ Receive RRC $\longrightarrow$ Sampling at rate $1/T_c$

The combined response of the filters before sampling is
$$H_{\rm T_{RRC}}(f)H_{\rm R_{RRC}}(f) = H_{\rm RC}(f) \tag{1}$$

After sampling, the RC filter has the following desired property in time-domain
$$h_{\rm RC}[n] = h_{\rm RC}(nT_\rm c) = \begin{cases} 1, \: n = 0 \\ 0, \: \text{otherwise}\end{cases}\tag{2}$$
$$\textrm{or,}\quad h_{\rm RC}(t)\cdot\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_\rm c) = \delta(t)\tag{3}$$

In frequency domain, this becomes

$$H_{\rm RC}(f)\star\frac{1}{T_\rm c}\sum\limits_{k=-\infty}^{+\infty}\delta\left(f - \frac{k}{T_\rm c}\right) = 1\tag{4}$$
$$\textrm{or,}\quad\frac{1}{T_\rm c}\sum\limits_{k=-\infty}^{+\infty}H_{\rm RC}\left(f - \frac{k}{T_\rm c}\right) = 1.\tag{5}$$

Case 2: Receive RRC filter is discrete-time

Here the system is as follows:

Transmit RRC $\longrightarrow$ Sampling at rate $1/T_\rm c$ $\longrightarrow$ Receive RRC

Here, the sampled transmit RRC response is
$$\frac{1}{T_\rm c}\sum\limits_{k=-\infty}^{+\infty}H_{\rm T_{RRC}}\left(f - \frac{k}{T_\rm c}\right).$$

Would the following hold true now:
$$H_{\rm R_{RRC}}(f)\cdot\frac{1}{T_\rm c}\sum\limits_{k=-\infty}^{+\infty}H_{\rm T_{RRC}}\left(f - \frac{k}{T_\rm c}\right) = 1?\tag{6}$$

-ryan


texts:
There is a recording which contains very noisy voice. (voice
  with a low Signal-to-Noise ratio).

It is a female voice of a stationary speaker (right in front of the microphone) and there are many other recordings of the same
  speaker with much better quality.

What can be done to denoise the audio?

From the other recordings, it might be possible to extract statistical values that allow some model to filter the speaker's voice.

Existing questions only address snoring, have non-random noise, want to identify a specific artifact or a moving speaker. The question is-it-possible-to-filter-out-a-persons-voice-out-of-100-of-other-voices is similar, but the answer there lacks details and is more about distinguishing, less about extraction.

Some of the tapes are direct copies, some are copies of copies, which have also been recorded using a lower speed setting (4.75 cm/s). This affected the quality prior to digitalization.


texts: Fourier Transform of the full Morlet wavelet

texts:
In 2014 someone asked here the Fourier transform of the Morlet wavelet; link below:

Fourier Transform of Morlet wavelet Function?

However, it was the approximated Morlet wavelet not written with the canonical Gaussian function.

Can somebody help to find the Fourier Transform of the full scaled Morlet wavelet below:

$$\psi_{\mu}(\tfrac{t}{\mu}) = \frac{1}{\mu} \times \frac{1}{\sqrt{2\pi} \, \sigma} \, e^{\frac{ -\left(\frac{t}{\mu} \right)^2}{2\sigma^2}} \big[e^{j\omega_c \frac{t}{\mu}}-e^{-\frac{1}{2} \omega_c^2}\big]$$

where $\omega_c = 2\pi f_c$ and $f_c$ is the centre or carrier frequency of the wavelet (the frequency to which the wavelet oscillates in the temporal domain). Also, $\mu$ is the scaling factor defined as $\mu = \frac{\omega_c}{\omega_{\mu}}$, where $\omega_{\mu}$ is the analysing frequency. Indeed, when $\omega_{\mu} = \omega_{c} \Rightarrow \mu = 1$ we have the mother Morlet wavelet.

In addition, the second term in the brackets is the correction term necessary to enforce zero mean to the Morlet wavelet.

I'd much appreciate a detailed step-by-step demonstration if possible to check where I'm getting stuck in my own demonstration. It could be done in a paper if quicker and a photo sent to me; I'll then publish here the full demonstration here.

Thanks in advance for any help.


texts:
I am trying to digest this paper.
[2002] Anna Usakova. Using Of Discrete Orthogonal Transforms For Convolution
So far, I've been successful with DFT and DHT.
Could someone give a hand with DCT?
I am trying to reproduce the convolution theorem for DCT-I and DCT-II. But my results never match the same as the result I get with DFT and DHT.

I am reading reference 9 of the paper

RAO, K. R.—YIP, P.: Discrete Cosine Transform — Algo- rithms, Advantages, Applications, Academic Press, Inc., Lon- don, 1990.

But it puts the conv. theorem of DCT-II in other terms.
I have also read other works, such as

[1994] Martucci. Symmetric Convolution and the Discrete Sine and Cosine Transforms
[2011] Roma. A tutorial overview on the properties of the discrete cosine transform for encoded image and video processing

and others. But I am interested on the Conv. Theorem on a similar fashion as the first two references.


texts: Extracting color information from lit regions to adjust shadow regions, HSV space

texts: If I wanted to match the color of a shadow region to the color it is supposed to be in the lit region, would this, purely color information, be preserved in the hue of the HSV space of the image?


texts: Adaptive thresholding based on number of pixels

texts: I'm thresholding an image where the threshold value is a count of the pixels such that for instance if the threshold value is 100, any color value which has less than a 100 pixels is classified black and any color value which has greater than 100 pixels is classified as white. Right now, I'm using a manual method of specifying a threshold value. Are there any options that I can use for automatically finding the threshold in this case ?


texts: Why does the Hilbert-Huang transform not suffer from the uncertainty principle, and what are the implications of this?

texts:
I have been studying the Hilbert-Huang transform, which I understand is a frequency analysis technique that uses the adaptive IMFs basis components to decompose a signal using EMD.

I understand that frequency analysis techniques such as the STFT (short-time Fourier transform) and Wavelet transform involve the convolution of a signal with a predefined basis in order to extract frequency information.

Several articles from Huang and others state "convolution processes involve integration, which makes the results suffering the limitation imposed by the uncertainty principle".

http://web-static-aws.seas.harvard.edu/climate/pdf/Zhaohua.pdf
https://pyhht.readthedocs.io/en/latest/tutorials/hilbert_view_nonlinearity.html

I also understand that the frequency of each IMF is extracted by finding the time rate of change of phase of the analytic signal for each IMF (which would involve differentiation of the phase with respect to time).

Why does this differentiation mean that the uncertainty principle is avoided?

I have a vague idea that it's due to operators associated with time and frequency that don't commute, but I have struggled to find any sources that approach this from a signal processing/mathematical perceptive rather than in a quantum mechanical sense.

Furthermore, if this kind of signal processing circumvents the uncertainty principle, does that mean time and frequency events can be resolved with arbitrary precision?

(In my head, this, in turn, would have implications in quantum mechanics, but I imagine this would be outside the topic of this site.)

Any insights and/or articles are gratefully received.