texts:
In this paper on content-aware seam carving, they have given an equation:

  $$ w^{s}(k)=\frac{1}{n^{k}} \sum_{i=1}^{N}\left[\mathcal{N}\left( \|z_{i}-o| |_{2} \; | \; 0, \sigma^{2}\right) \cdot \delta\left[b\left(p_{i}\right)-C^{k}\right]\right] $$

  where $δ(.)$ and $o$ represent the Kronecker delta function and the
  center of image, respectively. Gaussian kernel $\mathcal{N}(.)$
  calculates the Euclidean distance between pixel $z_i$ (normalized
  location of the pixel $p_i$) and image center $o$. Variance $σ^2$ is
  the normalized radius of the image, and the normalization coefficient
  $n^k$ denotes the number of pixels in cluster $C^k$.

  Pixel $i$ and its normalized location in the image are denoted by
  $\left\{p_{i}\right\}_{i=1}^{N}$ and $\left\{z_{i}\right\}_{i=1}^{N}$ respectively, $N$ is the total number of pixels. And the function $b : \mathbb{R}^{2} \rightarrow\{1 \ldots K\}$ associates the pixel $p_i$ and the cluster index $b(p_i)$.

What exactly does $\mathcal{N}\left( \| z_{i}-o| |_{2} \; | \; 0, \sigma^{2}\right)$ mean here?

My understanding is that $\mathcal{N}\left(0, \sigma^{2}\right)$ denotes a normal distribution with mean = $0$ and variance = $\sigma^2$. So how should the calculated $L_2$ norm be used here?


texts: Reconstruction of BandPass Signal from Complex Envelope

texts: From what little I've been able to gather, the complex envelope preserves all information required for the reconstruction of the original signal and that it basically sends a low pass version of a bandpass signal.(Correct me if I'm wrong).I need an explanation for how the complex envelope is being created as per this text book? And also of how the original signal is obtained at the end?


texts: Should the phase coefficients of the DFT of a real, even input signal all be zero?

texts:
The phase coefficients of a real, even input signals should all apparently be $0$ or a multiple of $\pi$. That's a property of the DFT I've learned about in the Audio Signal processing course on coursera. However, the example they use completely confuses me.

They create a triangle wave that looks like this:

and then showed the phase spectrum to be this:

They explained that this phase spectrum was not zero, because the original triangle function wasn't even because it wasn't centered around zero - it had a phase shift that was messing things up. So they adjusted the positioning of the triangle wave so the peak was at zero, like this:

And the phase spectrum duly went to zero (note the minuscule scale on the $y$-axis)

Bearing in mind I'm new to DSP, the thing that is really confusing is that surely both forms of the triangle wave are even - shifting by half a wavelength just creates another even function, doesn't it? Why must the triangle wave be positioned so the peak is at the center rather than the trough, or vice-versa?


texts:
I have a basic understanding of HMM's and as a final year project at school wanted to expand my knowledge further.

My basic idea was to create an algorithm that determines if someone is saying either Yes or No. As interesting as this sounds, it's relatively easy and I want something that challenges me even more and wanted to know if my idea was possible.

My idea:

The algorithm will be able to answer certain questions (given samples).. E.g.

Q: Is this person saying either Yes no No?

A: Yes

Q: Is this person male or female?

A: Male

Q: Is this animal a bat?

A: No

Obviously, my data-set will be massive, but is this possible using HMM's? So, in theory, instead of handling whether someone is saying yes or no, the algorithm becomes universal and I can determine many many things.

I hope someone can help me.


texts: Calculating Phase Response for 2 microphones given the input

texts:
I want to measure and compare the phase response of two identical microphones. To do this, I have a pressure chamber, which allows to apply the same pressure to both microphones.

I apply a sweeped sine wave to the chamber to measure the freq. range of interest.
As Data I have the applied pressure and the measured pressure of the two microphones.

Right know I do the following:

fftChamber = fft(chamber_sig)
fftMic1 = fft(mic1_sig)
fftMic2 = fft(mic2_sig)
G1 = fftMic1./fftChamber
G2 = fftMic2./fftChamber
phaseResponse1 = angle(G1)
phaseResponse2 = angle(G2)

This method gives me the most reasonable result, but I'm not sure why dividing should be right or appropriate, as this is not really a transfer-function?


texts: What is the real difference between DSP and AI/data science?

texts:
I am very much into DSP, but lately everybody is talking about "Data science" and "deep learning", and from what I understand the whole thing about data science is to take a huge row of data, and extract meaningful data only from it.

Isn't it what you do with DSP, when you have a signal with noise and you extract the data from a raw of sampling? Or for example when you auto-correlate to find matches between signals?
Do you use the same statistical tools in both cases?


texts: Unit impulse response $h[n]$ of a discrete time system with multiple characteristic roots 0

texts:
I am trying to obtain the unit impulse response of a system in the form:
$$y[n+N]+...+a_{N-1}y[n+1]+a_{N}y[n]=b_0x[n+N]+...+b_{N-1}x[n+1]+b_{N}x[n]$$
$$Q[E]y[n]=P[E]x[n]$$
(where E is the unit advance operator)
Using the following formula:
$$h[n]=\frac{b_N}{a_N}\delta[n]+y_c[n]u[n]$$
Or if $a_N=0$
$$h[n]=A_0\delta[n]+A_1\delta[n-1]+y_c[n]u[n]$$
Where $A_0$ and $A_1$ are determined through iterative calculation of initial values of $h[n]$ and $y_c[n]$ is a combination of the systems characteristic roots that satisfies $Q[E]y_c[n]u[n]=0$
The system in question is:  $y[n]=0.5y[n-1]+x[n]-(0.5)^4x[n-4]$
Upon converting the system to using the operator E notation to obtain the characteristic roots, I obtain 4 roots 3 of which are repeated zeros.
$$(E^4-0.5E^3)y[n]=(E^4-0.5^4)x[n]$$
$$\gamma_{1,2,3} = 0, \gamma_4=0.5$$
Using the relations described above and by simply discarding the repeated zero roots I then obtain the answer:
$$h[n] = (0.5)^nu[n]$$
However, when replacing $x[n]$ and $y[n]$ with $\delta[n]$ and $h[n]$ respectively in the original system difference equation, I obtain:
$$h[n] = (0.5)^n(u[n]-u[n-4])$$
Which is matching with my model answer.
I figured that maybe there is a mistake in my original solution due to the discarding of the repeated zero roots. How should I approach solving systems with zero repeated roots?


texts: Speech signal Quality & Speech signal improvement

texts:
I'm trying find authoritative references for

[1] Which analyzing techniques (time/frequency domain) i should use for determining the quality of a speech signal.

[2] Which algorithms i should run for improving speech signals( As "cheaply" as possible)

There are no constraints for the first requirement as it will be done "offline". But I'm inteding to do the second "on the fly", So i need algorithms which will do its job as economically as possible. In the second case, dedicated DSP hardware may or may not be available. I've to explore both options.


texts: Exponential weighted moving average time constant

texts:
I think it is an easy question but I am stuck.

I want to derive that $$ \alpha = -e^{\frac{-T}{\tau}}\,. $$

Can someone provide me with an answer?

[EDIT] Sorry guys, this was really a senseless question. Here are some more informations. The differential equation of the EWMA:
$$y(n)=\alpha\cdot x(n)+(1-\alpha)y(n-1)$$
and the corresponding frequency magnitude response:
$$H_E(z)=\frac{\alpha}{1-(1-\alpha)z^{-1}}$$
and in the frequency domain for $\omega_s=1 \rightarrow T=1 $ :
$$H_E(\omega)=\frac{\alpha}{\sqrt{1-2(1-\alpha)\cos(\omega)+(1-\alpha)^2}}$$
$$\tau=\frac{1}{2\pi\omega_{3dB}}$$

Hence
$$H_E(\omega_{3dB})=\frac{\alpha}{\sqrt{1-2(1-\alpha)\cos(\omega_{3dB})+(1-\alpha)^2}}\overset!=\frac{1}{\sqrt{2}}\text.$$

I'm looking for $\alpha$, given an $\omega_{3dB}$.


texts: What is the first derivative of Dirac delta function?

texts:
Could you please help me in a simple way, what is the first derivative of a Dirac delta function?
I found this answer:

The informal answer is a positive Delta function immediately followed by a negative-going Delta function.

Could you please explain this?


texts:
I'm working on XILINX FFT IP(PG109) in pipeline mode, which uses radix 2 DIF Lattice to perform FFT/IFFT operation. How to perform scaling of each stage in FFT, such that the effect of saturation or underflow will be less?

Input Data: An OFDM Symbol from channel.

My work :
1) Data growth will be due to addition/subtraction and rotation of vector done by twiddle factor.

2) Because of addition/subtraction there will 1 bit growth(when extreme values involves)

FOR DIF ARCHITECTURE BIT GROWTH IN LAST TWO STAGES IS PURELY DUE TO ADDITION/SUBTRACTION AS TWIDDLE VALUES ARE +/-1, +/-j.

3) For rest first N-2 stages, data grows as per note 1 . The max. real/imaginary can go to 2*sqrt(2).

4)Always data growth in every stage can't lead to overflow.(when input values are small).


texts:
I am working with a signal that describes energy consumption in some house as a function of time and I am trying to find time intervals that correspond to some particular type of dish washer.

What do we know about this dish washer:

It has 4 heating pulses.
Each pulse has amplitude around 2000 and lasts for at least 120 seconds.
Heating pulses are not periodic.
If there is such a dish washer it was used at least twice in a given period of time.

Question that I am trying to answer:

Was such a dish washer used in this house during given time interval?
If yes, I would like to identify all time intervals when this happened.

Example:

csv with whole signal

Let's say I identified one occurrence of this dish washer, like on this figure and trying to find if there are other similar intervals. At the moment I am doing convolution of the whole signal with this dish washer signal and pick time intervals that give high convolution score. Problem is that signal is additive and if person is using other appliances at the same time I may get high score when there is no dish washer there and low score when it is.


texts:
If we insert a tanh function (or any other activation function) between the feedback summation and the unit delays, how will such an IIR filter behave for values of $|a| < $1 and $a > ±1$ ?

The filter becomes stable for all values of $a$ but what happens to the frequency response of the filter?


texts:
I have problem with upsampling implementation in the following way:

My code:

def expand(x, L, t=None):
"""
This function expands a given signal L-times. It also returns new timestamps if they were given.

Parameters:
    x - Vector to expand.
    L - Expansion factor. It should be an integer.

Returns:
    y_L - Expanded signal.
    t_L - New timestamps.
"""

n =  L * len(x)

y_L = np.empty(n)
t_L = np.zeros(n)
#delta_t = np.abs(t[0]-t[1])

#delta_t_L = delta_t/L

for i in range(n):
    if i % L == 0:
        y_L[i] = x[i//L]
    else:
        y_L[i] = 0

t_L = np.arange(n)/L

#t_L = np.arange(0,len(x),delta_t_L).tolist() (Working only for [1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1])

if t is None:
    return y_L

return y_L, t_L

The problem is with 't_L' array. I don't know how to define it correct.

It's working for this signal '[1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1]' but then I tried to decimate this signal and then extend it in this way

K = 5
L = 3

y_K, t_K = decimate(x, K, t)
y_L, t_L = expand(y_K, L, t_K)

For [1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1], L = 2:

For [1. 6. 3.], K = 5 (Decimation factor):

Could you help me find the solution for this problem?


texts:
I have two images for the same object from the almost same perspective (no more than 1-2 degrees or 1-2 mm is acceptable).
I want to change the perspective of one of them to match exactly the other so I can make subtraction between them successfully to get a complete black result if there is no change of the content of the object.
many thanks


texts: what are frequencies in a digital image?

texts:
I don't completely understand the term " frequency" with respect to digital image processing.
for 1D electrical signals , its pretty easy to understand , visually too.
higher the frequency - more packed( or closer) the signal looks in a given time interval than its lower frequency counterpart.

But when it comes to images , with parameters like intensity, 8-bit gray scale, pixel value,etc. - what does frequency mean ?


texts: What Is the Difference between Difference of Gaussian, Laplace of Gaussian, and Mexican Hat Wavelet?

texts:
There are three techniques used in CV that seem very similar to each other, but with subtle differences:

Laplacian of Gaussian: $\nabla^2\left[g(x,y,t)\ast f(x,y)\right]$
Difference of Gaussians: $ \left[g_1(x,y,t)\ast f(x,y)\right] - \left[g_2(x,y,t)\ast f(x,y)\right]$
Convolution with Ricker wavelet: $\textrm{Ricker}(x,y,t)\ast f(x,y)$

As I understand it currently: DoG is an approximation of LoG. Both are used in blob detection, and both perform essentially as band-pass filters. Convolution with a Mexican Hat/Ricker wavelet seems to achieve very much the same effect.

I've applied all three techniques to a pulse signal (with requisite scaling to get the magnitudes similar) and the results are pretty darn close. In fact, LoG and Ricker look nearly identical. The only real difference I noticed is with DoG, I had 2 free parameters to tune ($\sigma_1$ and $\sigma_1$) vs 1 for LoG and Ricker. I also found the wavelet was the easiest/fastest, as it could be done with a single convolution (done via multiplication in Fourier space with FT of a kernel) vs 2 for DoG, and a convolution plus a Laplacian for LoG.

What are the comparative advantages/disadvantages of each technique?
Are there different use-cases where one outshines the other?

I also have the intuitive thought that on discrete samples, LoG and Ricker degenerate to the same operation, since $\nabla^2$ can be implemented as the kernel
$$\begin{bmatrix}-1,& 2,& -1\end{bmatrix}\quad\text{or}\quad\begin{bmatrix}
0 & -1 & 0 \\
-1 & 4 & -1 \\
0 & -1 & 0
\end{bmatrix}\quad\text{for 2D images}$$.

Applying that operation to a gaussian gives rise to the Ricker/Hat wavelet. Furthermore, since LoG and DoG are related to the heat diffusion equation, I reckon that I could get both to match with enough parameter fiddling.

(I'm still getting my feet wet with this stuff to feel free to correct/clarify any of this!)


texts: Differences between filtering and polynomial regression smoothing?

texts: What are the differences between classical low-pass filtering (with an IIR or FIR), and "smoothing" by localized Nth degree polynomial regression and/or interpolation (in the case of upsampling), specifically in the case where N is greater than 1 but less than the local number of points used in the regression fit.


texts: Converting a lowpass filter to a highpass filter. FIR filter-type 1

texts:
I was told that in the FIR filter type I, the impulse response
of a highpass filter $h_H[n] $can be obtained as follows,
$$h_H[n] = \delta[n − m] − h_L[n]$$
where $h_L[n]$ is the impulse response of a lowpass filter, $\delta$ is a Dirac pulse (Dirac delta function), which delayed by an appropriate value of $m$.
I've computed the impulse response according to the formula in MATLAB and observed the frequency response. I noticed that when $m=\frac{M+1}{2}$, where $M$ is the number of filter taps, the formula is indeed correct. However, I don't understand Why and How it possible.


texts: Defining an average in time for a density in time

texts:
I'm reading the text book "Time-Frequency Analysis" by Leon Cohen and I've made my way through a decent portion. There is however a conceptual issue I keep coming back to. The book states:

  If we consider $\lvert s(t)\rvert^2$ as a density in time, the average
  time can be defined in the usual way any average is defined:

  $$  \langle t \rangle  = \int t \lvert s(t)\rvert^2dt$$

I don't understand conceptually why multiplying by $t$ in the integration will provide us with an average. I didn't know that was the typical way to define an average either despite the books insistence that this is common knowledge (which it very may well be I'm just not interpreting it correctly). I've always thought about an average as dividing by some base, say by the total period of time $T$ NOT multiplying by $t$ inside the integral. It states earlier that:

  $\lvert s(t)\rvert^2$ is the energy per unit time.

So I was thinking that perhaps mathematically multiplying by $t$ which has units of $s$ would get rid of the per unit time portion, but the units of $\lvert s(t)\rvert^2$ aren't actually $v^2/s$ as that would be the derivative, it's just $v^2$ so that doesn't make much sense (assuming the signal is an electrical signal and the unit time is seconds). Can someone point me in the right direction on how to think about this? I know it's a simple concept but I'm just having trouble making it over this hurdle. Thanks!


texts: I’ve read that that frequency is a ‘window’ in weather, impacted less by raindrops for example. I otherwise would’ve thought that simply increasing the wavelength would decrease impact. I don’t understand why 1575 MHz is a ‘window’. Also, what factors other than weather impacted the decision to use 1575 MHz?


texts: Division by zero in Levinson–Durbin recursion?

texts:
I am doing a LPC analysis of a speech signal using the autocorrelation method. To calculate the LPCs I am using the Levinson–Durbin recursion. In my literature the error is initialized with the first element of the autocorrelation sequence. The algorithm later uses the error (from the previous pass) to calculate the reflection coefficient. However, the error is used as divisor in a division. Thus, in case the first element of the autocorrelation sequence is zero this leads to a problem in my C++ implementation of LPC analysis.

I have seen implementations setting all LPCs to zero in case the first element of the autocorrelation sequence is zero. Other implementations ensure that the first element of the autocorrelation is always at least 1.
Matlab gives me LPCs of NaN if the first element of the autocorrelation is zero in a call to its levinson function.

What is the "correct" way to cope with this divison-by-zero-problem? Or what is the most suitable for LPC analysis of a speech signal?


texts: Guitar pitch detection with autocorrelation

texts:
This link provides code for an autocorrelation-based pitch detection algorithm but says:

  Cons: Not as accurate, doesn't work for inharmonic things like musical instruments, this implementation has trouble with finding the true peak

Why is that? What implications will it have if I want to create a guitar pitch detector (let's assume that I am only working with monophonic audio for now). Is it the noise that creates those implications? I thought that musical instruments are harmonic things, not inharmonic.

Is the YIN algorithm an improvement in this aspect? If not, what does it improve?


texts: What is obtained from the cross correlation plot?

texts:
Let’s assume that we have two audio signals, x(t) and y(t) affected by the noise as shown below.
And we would like to cross-correlate these two signals and the cross-correlation plot is shown as below.

In this correlation plot there is a peak value around -11 msec.
I am trying to understand how we interpret this peak in this plot? What does it mean?
Please also explain me what do we obtain from the Fourier transform of the correlation function.

Thanks in advance!


texts: Correct scaling for AWGN noise in OFDM system after adding Preambles

texts:
I have a two-part question:

Question 1

I wonder if anyone can explain about the scaling factor that is used for AWGN noise in OFDM system. For example I know about the scaling factor for normal OFDM system for wasted energy due to cyclic prefix. For example assume
\begin{align}
\textrm{N}&=64\quad\text{is the number of subcarriers}\\
\textrm{CP}&=16\quad\text{Cyclic prefix length}
\end{align}

then we usually boost the signal energy by $\sqrt{80/64}$ to compensate for the wasted energy then we add a noise to the signal.

Now my question is assume I have short, long preamble and signal filed (L-sig) and I concatenate it with OFDM symbols. Do I need to have extra scaling factor due to short, long preamble and signal field since I am thinking that AWGN noise is added to the entire packet plus the preamble?

If an expert can comment on correct method of adding noise to this system and how to take these field into account and compensate for the wasted energy.
Question 2

Does MATLAB command awgn(TX_signal,SNRdB,'measured') already takes the correct scaling factor into account or not? I have seen many simulations in the web are using this command for OFDM system.


texts:
Anyone can explain me about how measure side lobe roll-off rate of kaiser window from Spectrum in matlab where side lobe roll-off rate is the asymptotic decay rate, in decibels per octave of frequency.

How adjust Frequency axis if length of FFT = "500" by padding "473" zeros  with length of window= "27" to frequency in Hz.


texts:
I want to work on co-frequency and co-time blind signals separation or carrier-in-carrier signal separation project. In articles published under the heading of blind separation of these signals, it is always assumed that one of the signals is known and the other signal is obtained by using that. I couldn't find an article in which both signals were unknown and separated. This has confused me. Is there anyone who has worked on this and guided me? Is there anyone who has worked on this and guided me?

Patent articles indicate that carrier-in-carrier separation is done by using adaptive filter. In this way, the received signal (which is the sum of the first and second signals) enters the filter with one of them and by subtracting it from the received signal, another signal is obtained. Some articles have also pointed out that if the power difference between the two signals is significant, the second signal is obtained by using a trick.

However, various articles have suggested that if the power difference between the two signals is 0 dB, it is possible to obtain both signals blindly and without any of them. Is such a claim true?


texts:
I was wondering which is the best language for image processing? I know MATLAB has a good library and user community for it. I havent checked it out, its there for python as well.

What is the most efficient language for this?


texts:
We got this question to solve:

Calculate the power of the signal:
$$s(t) = 8\cos\left(20\pi t-\frac \pi4\right) + 4\sin(15\pi t)$$

Now, I thought of two approaches :

Use Parseval theorem, so first find Fourier transform, then calculate the required integral, but then we get a impulse function in it and I don't know how to integrate square of $\delta$.

Using the normal formula to calculate the power of a signal, and again in that, we get 3 terms, $\sin^2$ which is easy, then $\cos^2$ again simple, and then $\sin\cdot \cos$, which I know how to solve, but will be lengthy and I think there should be some another proper way to solve this question.

Any guidance would be appreciated.


texts: Should i high pass audio for real time frequency detection?

texts:
Haven't been able to find a clear answer on this. I'm interested in 75-500Hz bandwidth. It's for a tuner(android app) so i want a pretty quick response time.

Is it worth the computational time to high pass the signal?


texts:
How to detection of the boundary of the left ventricle from MR images, the crucial step is to determine the region of interest (ROI) or the center point (CP) of the left ventricle.

I just want to show this marker over the Left ventricle of heart of MR Dicom Image


texts:
For my application, I have to downsample a bandpass complex signal which spectrum is located on the second Nyquist zone.
Knowing that this processing will cause a spectrum inversion, what would be the additional side effects (SNR reduction, less amplitude ..) ?
Will the phase's linearity be conserved (supposing that the pass-band anti aliasing filter has a linear phase) ? Does anyone have a reference detailing those side effects of the downsampling ?
Thanks for any help.
Mourad.F


texts: Kalman Filter - combining data from sensors with different measurement rates, does one have a good source where i can get more information about it?

texts:
someone already wrote a question about the topic, and thats exactly what i am looking for but i need a source to get more information and to cite from
in my work i combine 2 kalman-filter for different times with slightly different statespace modells to combine the measurements with the diffrerent frequencies, lets say one is availeble every second the other one every minute. the one of the 2 filter runs at a time, and then they switch and take over the initial state and kovariance
does anyone have a source where i can research more on this specific topic?


texts: Noise addition for aesthetic 'film-grain' modification of RGB channels in GLSL

texts:
forgive me for the lack of knowledge on this, but I'm hoping someone can point me in the right direction.

I'd like to know the best technique for adding noise to RGB channels individually so that magnitude can be varied individually.

What algorithm of noise is the most aesthetically pleasing, or organic looking?

Many thanks.


texts:
I have a recorded audio signal that I would like to convert into spectrogram with the highest possible yield of information.
The audio clips I am working with is about 30 ms long and contains frequencies between 20 Hz - 20 kHz. The sampling frequency used is 44.1 kHz.

What I have done:

In Python I have used the library librosa to create amplitude spectrograms. Here I have used the length of the signal as number of points for the FFT, hop length (number audio of frames between STFT columns) of 1 and window length (Each frame of audio is windowed by window()) of 64.

For reference, the code used to generate and display the spectrogram is as follows:

plt.figure()
librosa.display.specshow(librosa.power_to_db(
                         np.abs(librosa.stft(signal, len(signal), 1,64)) ** 2,
                         ref=1.0), y_axis='linear', sr=fs, cmap='coolwarm')
plt.axis("off")
plt.savefig(SAVEDIR_spec_cw+"spec_"+str(i)+".png")
plt.close()

This seemed (visually) to give the best image result as seen below:

Is this as good as it gets?

I do have access to MATLAB as well, if someone can suggest a better method using that instead.


texts: What is the functional difference between DSB and 2SB mixers, and why exactly would 2SB be better for radio astronomy?

texts:
The Astronomy SE question 2SB mixer in radio astronomy? asked in 2014 in its entirety:

In literature about the instrumentation of radio astronomy, I frequently come across a type of mixer described as "2SB".  I'm familiar with single-sideband (SSB) and double-sideband (DSB) mixers, but I have never studied a 2SB mixer.
What is a 2SB mixer and how does it compare to a DSB mixer?  Ideally, I would also like to know of formal references that directly address the topic for further reading.

is interesting, but its lone 2014 link-only answer in its entirety:

2SB is Dual Sideband, as opposed to DSB - Double Sideband. Here are a couple of papers you might find relevant and interesting:
a 2SB upgrade replacing a DSB1
a paper that mentions the advantages of 2SB over DSB2

leaves me still not really understanding the difference between 2SB and DSB mixers nor exactly when one would choose one over the other.
My impression is that DSB mixers suppress the carrier while allowing both sidebands to pass through a single output, while 2SB mixers further separate each sideband to a separate output.
Question(s):

Is the separation of the two SBs to two outputs the functional difference between 2SB and DSB? If not, what would it be?
The abstract of the second linked paper says that 2SB mixers' "main advantages being to avoid spectral confusion and to diminish effective system temperature by a factor two with respect to double sideband (DSB) receivers." Is it possible explain in fairly simple terms what that is so?

1Hesper et al. A Sideband-Separating Mixer Upgrade for ALMA Band 9 from the 20th International Symposium on Space Terahertz Technology, Charlottesville, 20-22 April 2009
2A calibrated digital sideband separating spectrometer for radio astronomy applications
2Finger et al. A Calibrated Digital Sideband Separating Spectrometer for Radio Astronomy Applications also available at Pub. Ast. Soc. Pac.


texts: Interpreting scipy spectrum from audio signal

texts:
I have recorded some audio and would like to obtain a spectrum from it. As the audio is a real valued signal, I figure that I could perform a FFT with some window and obtain a spectrum for that period. There is the scipy.signal.spectrogram function which can just do this in one go. This is the code that I have thrown together:
import numpy as np
import matplotlib.pyplot as pl
import scipy.io.wavfile
import scipy.fftpack
from scipy import signal

rate, data = scipy.io.wavfile.read('audio.wav')
N = rate // 10
f, t, Sxx = signal.spectrogram(data, rate, window=signal.blackman(N), nfft=N, mode='magnitude')
pl.pcolormesh(t, f, 10 * np.log10(Sxx), shading='auto', cmap='jet')

The sampling rate is 44100 Hz. I thought that using a window of 100 ms should give me a lower frequency of 10 Hz, which is fine for my purpose.
Looking at the resulting spectrum plots I see that the upper half of the frequency seems to be different from the lower part.

From the documentation I would have expected that I just get the real amplitude as return_onesided defaults to True. In general I would expect to have amplitudes and phases, or real and imaginary part. But with the spectrum I just want the amplitudes. Are they just the lower part?
And if so, why is the maximum frequency just around 11 kHz whereas the sampling frequency is 44 kHz and from the Nyquist–Shannon sampling theorem I'd expect to be able to resolve like 22 kHz?
Update: Other recording
Using my laptop with Audacity instead of my phone with SmartRecorder to record some audio, I have no strange upper half in the spectrum.

Update: Jet colormap
I was asked why I have been using Jet instead of Viridis. When using the latter for the spectrum plot, one cannot see so much of the structure.

I know that Jet isn't so great, but I just want to have more contrast.


texts:
I can't seem to get the right answer for this. Could someone show me the procedure?

As shown in the figure a system is constructed by cascading four FIR filters having the following frequency responses,

If the input signal is $x[n] = 0.9n(u[n] - u[n - 20])$, compute the value of $y[10]$.

[Edit] working thus far

H[z] = (1 - e-jω)x(1 + e-jω)x(1 + e-2jω)x(1 + e-4jω)

 = (1 - e-2jω)x(1 + e-2jω)x(1 + e-4jω)
 = (1 - e-4jω)x(1 + e-4jω)
 = (1 - e-8jω)

y[n] = x[n] - x[n-20]

From this point i'm not sure how to proceed.


texts: signal construction based on cross correlation

texts:
Consider we have to design a signal $
\mathbf{x} \in \mathbb{C}^{1_{} \times N_{\mathrm{}}}
$ that needs to have the lowest correlation with an unknown signal $\mathbf{y} \in \mathbb{C}^{1_{} \times N_{\mathrm{}}}:
$
\begin{equation}
\begin{array}{cc}
\text { minimize } & E\left[\mathbf{x}_{} \mathbf{y}^{H}_{}\right] \\
\text { subject to } & \mathbf{x}_{} \mathbf{x}^{H}_{}=1
\end{array}
\end{equation}
Is it optimum to make $\mathbf{x}$ to be Gaussian?  I am trying to prove that based on Entropy of $\mathbf{x}$.


texts: What is the best file format to save short signal samples?

texts:
We have the need to save signal samples measured with an arbitary sampling rate. The samples are usually about one second in duration. Currently we save them in a text file format which consumes a lot of disk space and is very slow. Also this type of format doesn't suit for streaming applications.

I have been searching for a binary file format for this kind of data, but I'm not sure what factors I need to consider when choosing a format.

The sampling rate of our data varies from 1kHz to 152kHz and currently 16 bits would be enough to represent the data (varies roughly from -1000 to 1000). This is vibration data measured from different sensors if it makes a difference. Also we would need to save pre-calculated FFT's in the same format. Is this possible?

Just to point out, I have no education in signal processing. I have the task to implement the system to be used in the analysis.

Currently the best option seems to be WavPack, which is basically a compressed WAV file and supports sampling rates from 1 to 4.3GHz and the compression is lossless.

WavPack is released in 1998 so I'm thinking are there any newer or more efficient formats available today?


texts:
I'm trying to understand how a particular equation works.  The scenario is: there is a load of some resistance connected onto an amplifier with some noise figure.

The thermal noise of the load alone is:
$$
\langle i_{th}^2 \rangle = 4kTB/R
$$
but since there is an amplifier before it, the noise at the input of the amplifier is
$$
\langle i_{th}^2 \rangle = 4kTBF/R.
$$

I know that
$$
F = \frac{SNR_{in}}{SNR_{out}} = \frac{S_i}{S_o} \frac{N_o}{N_i} = \frac{1}{G} \frac{N_o}{N_i}
$$
and I'm not seeing why multiplying $4kTB/R$ by $F$ is going to find the noise at the input of the amplifier.

Advice much appreciated.

Thank you.


texts: Is it applicable to implement a cascaded moving average filter with variable window on real-time?

texts:
I am using a 3-pass cascaded moving average filter for smoothing noisy data. I applied some optimization algorithms to determine the optimal length of the MAF window.
For different amplitudes of data variation, I got different optimal window lengths.
Is it meaningful or applicable to implement an adaptive window size MAF for online data streams?
If so, how can I switch between different window sizes without causing spikes in filtered data or abrupt changes in the rate of the smoothed data?


texts: Difference of doing a PSD estimate of data and logarithmic transformed data?

texts:
What is the difference between doing a PSD estimate with data and the same data but which is logarithmically transformed before the estimate? Does it make the data more sinusoidal in nature?

An exercise in a book asks this question:

"For the lynx data, compare your spectral analysis results from the original data, and the data transformed first by taking the logarithm of each sample and then by subtracting the sample mean of this logarithmic data. Does the logarithmic transformation make the data more sinusoidal in nature?"


texts: Yule walker equation limited matrix size

texts:
Definitions

For an ARMA model

$$x_n=-\sum_{p=1}^P a_px_{n-p}+\sum_{q=0}^Qb_qw_{n-q}$$

where $w_n$ is zero mean stationary white noise with unit variance.

It is straightforward to show that the autocorrelation of $x_n$, $R_{XX}[r]$ is given by:

$$R_{XX}[r]=-\sum_{p=1}^P a_pR_{XX}[r-p]+c_r$$

where

$$c_r = \begin{cases}\sum_{q=r}^Qb_qh_{q-r} & r\leq Q \\ 0 & r>Q \end{cases}$$

where $h_n$ is the impulse response of the system, i.e. $x_n=\sum_{m=-\infty}^{\infty}h_mw_{n-m}=h_n*w_n$

Question

I have seen in textbooks that the equation for $R_{XX}[r]$ expands to

$$R_{XX}[0]+\sum_{p=1}^Pa_pR_{XX}[-p]=c_0$$
$$R_{XX}[1]+\sum_{p=1}^Pa_pR_{XX}[1-p]=c_1$$
$$\vdots$$
$$R_{XX}[Q]+\sum_{p=1}^Pa_pR_{XX}[Q-p]=c_Q$$
$$R_{XX}[Q+1]+\sum_{p=1}^Pa_pR_{XX}[Q+1-p]=c_{Q+1}=0$$
$$\vdots$$
$$R_{XX}[Q+P]+\sum_{p=1}^Pa_pR_{XX}[Q+P-p]=0$$

These can then easily be put into the classic matrix form $\mathbf{R}_X'\mathbf{a}'=\mathbf{c}'$.

This makes perfect sense except for one detail - why do the textbooks stop the equations at $R_{XX}[Q+P]$? Why do they not continue to $R_{XX}[Q+P+1]$ etc.?

I have tried fruitlessly to show that $\sum_{p=1}^Pa_pR_{XX}[Q+P+1-p]=0$ meaning $R_{XX}[Q+P+1]=0$ so that there isn't any point in considering these equations.

I also tried to show from $x_n=-\sum_{p=1}^P a_px_{n-p}+\sum_{q=0}^Qb_qw_{n-q}$ that $R_{XX}[Q+P+1]=0$. I would really appreciate it if someone helped me out here, I'm sure the answer is simple and obvious but I just can't see it.


texts: Is a high-passed signal the same as a signal minus a low-passed signal?

texts:
My question is, if I want to high-pass a signal, is it the same as low-passing a signal and subtracting it from the signal? Is it theoretically the same? Is it practically the same?

I have searched (both on google and dsp.stackexchange) and I find conflicting answers. I have been playing with a signal and here are the results. I can't make much sense of it. Here is the signal with the sampling frequency once every four seconds. I designed a digital low-pass filter with the transition band from 0.8 mHz to 1 mHz and filtered the signal. I then also designed a high-pass filter with the same transition band and filtered the signal. Here are the results.

This first picture shows the original signal in black and the low-passed signal in blue. They are almost on top of each other but not quite. The red curve is signal minus the high-passed signal which is right on top of the signal.

This second image is just the first one zoomed in to show what's happening. Here we see that clearly the two are not the same. My question is why? Is it something about how I have implemented the two filters or is it something theoretical independent of my implementation? I don't know a lot about filter designing but I do know that it is notoriously counter-intuitive. Here is the full MATLAB code to reproduce all of this. I am using the filtfilt command to eliminate phase delays. But another thing to point out here is that the filters are not normalized. When I do sum(Hd.Numerator), I get 0.9930 for the low-pass and 0.007 for the high-pass. I don't see how to account for this. Should the output be scaled somehow because the coefficients don't add up to one? Could this scaling have something to do with this?

close all
clear all
clc

data = dlmread('data.txt');

Fs    = 0.25;    % Sampling Frequency
N     = 2674;    % Order
Fpass = 0.8/1000;  % Passband Frequency
Fstop = 1/1000;   % Stopband Frequency
Wpass = 1;       % Passband Weight
Wstop = 1;       % Stopband Weight
dens  = 20;      % Density Factor

% Calculate the coefficients using the FIRPM function.
b  = firpm(N, [0 Fpass Fstop Fs/2]/(Fs/2), [1 1 0 0], [Wpass Wstop], {dens});
Hd = dsp.FIRFilter('Numerator', b);
sum(Hd.Numerator)
datalowpassed = filtfilt(Hd.Numerator,1,data);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Fs    = 0.25;    % Sampling Frequency
N     = 2674;    % Order
Fstop = 0.8/1000;  % Stopband Frequency
Fpass = 1/1000;   % Passband Frequency
Wstop = 1;       % Stopband Weight
Wpass = 1;       % Passband Weight
dens  = 20;      % Density Factor

% Calculate the coefficients using the FIRPM function.
b  = firpm(N, [0 Fstop Fpass Fs/2]/(Fs/2), [0 0 1 1], [Wstop Wpass], {dens});
Hd = dsp.FIRFilter('Numerator', b);
sum(Hd.Numerator)
datahighpassed = filtfilt(Hd.Numerator,1,data);

figure
subplot(2,1,1)
plot(data,'-ko')
hold on
plot(datalowpassed,'-bo')
plot(data-datahighpassed,'-ro')
legend('Original Signal','Low-Passed','Signal - High-Passed')
subplot(2,1,2)
plot(data-datalowpassed,'-bo')
hold on
plot(datahighpassed,'-ro')
legend('Signal - Low-Passed','High-Passed')


texts: 100 kHz sinewave contaminating a signal sampled at 48 kHz

texts: If sampling at a rate of 48 kHz, with no anti-aliasing filter on the input, and the input signal is contaminated by a 100 kHz sine, at what frequency would the sinewave signal appear in the output spectrum?


texts: Unexpected frequency components found in Periodogram

texts:
I am trying to make sense of Digital Signal Processing with the help of R language. So, the issue came up when I tried to create a periodogram for a simple sine wave. The regular periodogram shows 2 frequency components as expected (expected frequency & aliased frequency). However, when I looked at the contents of the Power values for this periodogram, I realised that these apart from these 2 frequency components there are other components too, which have relatively very small values(order of e-30). Since, compared to the major 2 frequencies, all the other frequency components appear to be ~ 0, therefore the simple periodogram plot doesn't show them. However, if I plot the periodogram, after applying log function, then these frequency components(the insignificant ones) become visible.

Code :

t = 1:100            #Time instances
freq_t = 0:99/100    #Fundamental frequencies : t-1/n ,where n is the no. of time instances
y = sin(2*pi*0.06*t) #Sine wave with the time instances 't'
fft_y = fft(y)       #Performing FFT on the 'y' signal
spec_y = (abs(fft_y)^2)/100 #To obtain the modulus values of the complex values present in 'fft_y'
log_spec_y = log10(spec_y) #applying log at base 10 to the 'spec_y'

Note : The major frequency components (0.06 & 0.94) are marked in red

So, my issue is :

Why do these unwanted frequency components even exist? Shouldn't
they have their corresponding power values as 0?
How will these minor frequency components affect any sort of analysis that can be performed in the frequency domain?

Speculation for the first issue:
Now, for existence of those minor frequency components, the only reason that I can come up with is that the sine wave I made, is basically a sampled signal, hence discrete in nature. In order to approximate this sampled signal, apart from the major frequency components a lot of other minor frequency components should have been used, and that's the reason they show up like this. For instance, consider the Fourier series for square waves. Here, the fitted Fourier series looks like a summation of multiple sine/cosine signals with different frequencies. And the highest frequency of all those sine/cosine signal determines the frequency of the square wave.

As far as the second issue is concerned, I am pretty much clueless about that.
Hence can you help me resolve these 2 issues?


texts: Does anyone know how to overlay a equalized CDF plot with equalized histogram in matlab?

texts:
I am willing to overlay a equalized cdf with equalized histogram in matlab.
But it's really hard to find any recommends.
so if you can, would you please let me know about that?


texts: Error plot between known and estimated data

texts:
The channel is an FIR model with input $u$. The input takes in values which are symbols from some constellation. Using an equalizer such as the Least Mean Squares (LMS), I estimate the input to the channel from the known noisy observations and the channel coefficients. Let the estimated input to the channel be denoted by $\hat{u}[n]$.

The coefficients of the channel are denoted by $c$ of length $L$. The noisy output of the channel is $y$. Therefore we have, $y[n] = \mathbf{c}^H*\mathbf{u} + v[n] \tag{1}$ for $n = 1,2,\ldots,N$ where $v[n] \sim N(0,\sigma^2)$ is a Gaussian noise. The weights of the equalizer are given by $w$ and the equalizer is of length $2L+1$. The input to the equalizer is $y$. The output of the equalizer is given by $\hat{u}[n] = y*\mathbf{w}$ where $*$ denotes the convolution. My questions are:

1) Mean Square error between the estimated input and known / desired input to the channel for different values of Signal-To-Noise ratio (SNR) --The result of equalization will give us the estimates of the input to the channel. The estimate of the input to the channel is $\hat{u}[n]$. If I need to calculate the error between the estimated input and the known input, I should probably use the formula: $MSE = \frac{1}{T}\frac{\sum_{n=1}^{N}\hat{u}[n] - {u}[n]}{N}$ and $T$ denotes the number of independent trails. As an example, the input can take values from the set $\{1,2,3,4\}$. The first 10 symbols of the data can be $2,1,3,1,1,2,4,1,2,3$. These are the known values. Then to validate the model after equalization,let the estimates input symbols to the FIR channel be $\hat{u} = 1,3,1,1,1,2,4,1,2,2$. The error, $e = (u[1]-\hat{u}[1])^2+(u[2]-\hat{u}[2])^2+(u[3]-\hat{u}[3])^2 + (u[4]-\hat{u}[4])^2 +(u[5]-\hat{u}[5])^2 + ...+(u[10]-\hat{u}[10])^2$
Is this the correct way?
I am not using the communication tool-box in Matlab, and building my own code

2) Symbol error rate -- In communications, I have seen the symbol error plot (please refer :http://www.dsplog.com/2008/03/29/comparing-16psk-vs-16qam-for-symbol-error-rate/).

How is Using the same data which is used to obtain the MSE plot between the estimated symbols and known symbols, how can I obtain the SER plot? An example in Matlab will be very helpful.

Thank you.


texts: Bitmap comparison bounded by limitations in human visual perception?

texts:
I need to do a pixel-for-pixel comparison between a 'candidate' image generated by a deep-neural-net against an 'ideal' image. Rather than just comparing RGB values, I'd like to do a comparison that is bounded by limitations in human visual perception; i.e., if a human can't tell (or almost can't tell) the difference between the two images, then the difference returned would be zero (or almost zero).

BEGIN EDIT {

Put another way, before comparing my two RGB images, I'd like to convert them into some color-space with the following characteristics:

Adjacent colors in the (discreet) target space are just above the difference threshold for human perception.
The same is true for luminance.

Obviously, this conversion would be lossy. But, two images that are perceptually equivalent in the RGB space would map to the same pattern of ones and zeros when converted into this target space.

If this target space was constructed such that any non-linear features of human visual perception were (more or less) linear in the target space, then it ought to be much simpler to establish a perceptual difference threshold using only a single real value.

} END EDIT

The human vision limitations I remember are something along the following lines:

Color ranges for the three different types of cone cells
(i.e. low/high frequency limits)
Color resolution
(i.e. minimum distinguishable difference between colors)
Luminance resolution
(i.e. minimum distinguishable difference between brightness levels)
Frequency limitations for one or both?
(e.g. at what frequency does alternating black and white become indistinguishable from gray, or yellow and blue from green)?

I know that JFIF's lossy compression algorithm was based partly on this kind of perceptual information.

I searched for articles, but kept coming up with stuff like the PerceptualImageDiff (PID) project on SourceForge/GitHub. PID might do what I need but it definitely does a whole lot more I don't need. It's also big and slow, and it's in C++. My images are tiny, so performance in a Python implementation should be fine. I'm leaving PID as a my last option, because teasing out just the relevant algorithms/formulas I need may be more work than just starting from theory/formulas/algorithms in some online resource.

Can anyone point me to a good resource for theory/algorithms/formulas pertaining to this perceptual stuff?


texts: Handling stride>1 in FFT-based convolution

texts: The Fourier transform of the convolution of two signals with stride 1 is equivalent to point-wise multiplication of their individual Fourier transforms. I need to perform stride-'n' convolution using FFT-based convolution. For some reasons I need to operate in the frequency domain itself after taking the point-wise product of the transforms, and not come back to space domain by taking inverse Fourier transform, so I cannot drop the excess values from the inverse Fourier transform output to get equivalent stride - 'n' convolution. How can I handle the stride in the frequency domain? Thanks.


texts:
I'm new to Discrete Cosine Transform (DCT) and I have a question relating to basis functions.
In DCT, basis functions are defined by:

$$\alpha_p\alpha_q\cos\frac{\pi
\left(2m+1\right)p}{2M}\cos\frac{\pi
\left(2n+1\right)q}{2N},\quad \begin{align}0&\leq p\leq M-1\\0&\leq q\leq N-1\end{align}$$

If $M = N = 64$, we'll have $64$ basis functions. These functions have two variables including $p$ and $q$. Now, to verify, I take the first basis function with $m = n = 0$. Clearly, this function changes with different values of $p$ and $q$. Why it's drawn with same color in the following image (the upper left gray square)?


texts: Checking linearity/time-invariance etc. for recursive system

texts:
I'm familiar with the general methodology for checking if a system is linear:

Define output $y_1[n]$ for input $x_1[n]$, define output $y_2[n]$ for input $x_2[n]$
Define $x_3[n] = ax_1[n] + bx_2[n]$
Compute output $y_3[n]$ for input $x_3[n]$ and verify whether $y_3[n]=ay_1[n]+by_2[n]$. If it is, the system is linear.

However, I am having trouble applying this method to systems that are recursive. Some recursive systems can be converted to an iterative form by inspection. For example:
$y[n] - y[n-1] = x[n] \implies y[n] = x[n] + y[n-1] \implies y[n] = \sum\limits_{k=-\infty}^n x[k]$

For others, I am having more trouble, such as $y[n]+y[n+1]=x[n]$

First, I do a change of variables:

$k = n+1 \implies y[k]+y[k-1]=x[k-1]$

Following the general approach:

$y_1[k]+y_1[k-1] = x_1[k-1]$

$y_2[k]+y_2[k-1] = x_2[k-1]$

$x_3[k] = ax_1[k]+bx_2[k]$

$y_3[k]+y_3[k-1] = x_3[k-1] = ax_1[k-1]+bx_2[k-1]$

Here is where I got stuck. I was anticipating that the system should be linear, but due to the recursive term, I do not see how the approach I took could yield $y_3[n] = ay_1[n]+by_2[n]$.

Does anyone know where I made a mistake, or if there is a different approach I should be taking? (For instance, is there a general process for going from a recursive expression to an iterative one that I could use?) I'm a student using Oppenheim and Schafer for reference.


texts:
I'm a noob on DSP in general. But I'd like to understand this graph. It is the phase response of a band-stop filter, from Wikipedia:

I get the magnitude graph above: at some frequencies, the gain go down, than up, after the cut. But what about the phase?

I don't understand...

Why at the cutoff point, the frequencies (at that point) are drifted -90°/90° moved? What does it means? Is it the same phase as sin(90°) = 1?

I really don't understand that graph (visually). Is there any tool online maybe to show what is happening?


texts: There are many face detection and recognition algorithms and APIs out there; however, most of them can produce same results for paintings and avatars as for human face. So, is there any specific algorithm or tool to distinguish real human face and a simulated/fabricated one?


texts: Finding the fundamental frequency from Autocorrelated data

texts:
I'm writing an app in which I need to find the fundamental frequency of a note produced by a trombone. To do this I'm taking the FFT of audio data from a microphone and then using autocorrelation code taken from this question.

Once I've done that I'm then attempting to find the fundamental frequency by finding the highest and second highest peak locations and how many samples they are apart. I then find the amount of time one sample lasts with a sampling rate of 44100 and multiply that by the number of samples between the two peaks to give me the period of the fundamental frequency. Finally I use 1/period to find the fundamental frequency itself. Here's the code I've written for that (in Java):

public double findFundamentalFrequency(double[] autoCorrelatedData){

    double max = Integer.MIN_VALUE;
    double secondMax = Integer.MIN_VALUE;
    int maxLoc = Integer.MIN_VALUE;
    int secondMaxLoc = Integer.MIN_VALUE;

    for(int i = 0; i < autoCorrelatedData.length; i++){
        if(autoCorrelatedData[i] > max){
            secondMaxLoc = maxLoc;
            secondMax = max;

            max = autoCorrelatedData[i];
            maxLoc = i;
        }
        else if(autoCorrelatedData[i] > secondMax){
            secondMax = autoCorrelatedData[i];
            secondMaxLoc = i;
        }
    }

    double samplingPeriod = 1/44100.0;
    //Log.i("a", String.valueOf(maxLoc));
    //Log.i("b", String.valueOf(secondMaxLoc));
    double period = samplingPeriod * Math.abs(maxLoc - secondMaxLoc);
    double fundamentalFreq = 1.0/period;
    return fundamentalFreq;
}

Is this the correct way to find the fundamental frequency using autocorrelation? The answers this gives seem to be incorrect so I'm unsure if I've made a mistake somewhere or if I'm going about this the wrong way.


texts: I would like to ask about smoothing data by using Kalman filter. Due to quantization, I have data that is not smooth. How can I smooth this data by using Kalman Filter. For your information, the data is not constant and have some gradient.


texts:
anybody knows what this is?

Mat mat = (Mat_<double>(3, 4) << 0, 0, width, width, 0, height, height, 0, 1, 1, 1, 1);

I dont know what mat would be in this case.. furthermore i got no idea how to fix this error for the above declaration:

Error: Mat and int are incompatible

I know that Mat_ will call

template<typename _Tp> inline Mat_<_Tp>::Mat_(int _rows, int _cols)
    : Mat(_rows, _cols, DataType<_Tp>::type) {}

But i do not understand the purpose of this:

<< 0, 0, width, width, 0, height, height, 0, 1, 1, 1, 1);

Kindly Tape


texts:
I am trying to find a general way to find system stability.I have applied these methods and struck in confusion
For eg:
If
$$y(t)= \int_{-\infty}^{t} x(\tau) \sin(4\tau) d\tau$$
then find whether the system is stable or unstable?

Process (1):
If $$y(t) = \int_{-\infty}^{t} x(\tau)\sin(4\tau) d\tau$$
then
$$h(t) =  \int_{-\infty}^{t} \delta(\tau) \sin(4\tau) d\tau$$
$$\implies h(t) =  \int_{-\infty}^{\infty} \delta(\tau)\sin(4\tau)  u(t-\tau) d\tau$$
$$\implies h(t) = [\sin(4\tau)u(t-\tau)]|_{\tau=0}$$
          $$\implies h(t)=0$$.

so system is stable as $$\int_{-\infty}^{\infty} |h(t)| dt= 0 < \infty$$ ;

Process (2):
If $$y(t)= \int_{-\infty}^{t} x(\tau)\sin(4\tau) d\tau$$
then when $x(t)=\sin(4t)$
$$y(t)= \int_{-\infty}^{t} \sin(4\tau)\sin(4\tau) d\tau  = \infty $$
so the system produces unbounded output $y(t)$ for bounded input $x(t)= \sin(4t)$
Hence the system is unstable

Thus actually what will be the system stability and which process is right and which is wrong and how it is wrong?? please explain....


texts:
I have a set of data which consists of male and female voices. They are pronunciation of a same sentence. What's the appropriate method for getting an average spectrum for the male and female voices separately and comparing them? I can take fft of each voice but what's the next step to get an average spectrum? Also Welch's method can be applied to one voice each time. I know that this is in fact a random process and each of the voices is a realization but how can we estimate PSD using these realizations?
Edit: Thanks to Marcus Müller, here is the result which I've got using $$\frac{1}{N}( |\text{FFT}(x_1)|^2 + \dots + |\text{FFT}(x_n)|^2)$$
And here is the code:
  male = fft(k.');  %k: male voices
  male1 = (abs(male)).^2;
  male2 = sum(male1.')/36; %36: number of male voices

  female = fft(s.');  %s: female voices
  female1 = (abs(female)).^2;
  female2 = sum(female1.')/13;    %13: number of female voices

  plot(f , fftshift(male2) , f , fftshift(female2))
  legend({'male','female'},'Location','southwest')`

It would be really nice to see the other ways for estimation of PSD in this case.


texts:
I'm new at signal processing. I also don't know if this is the right section to post. I have this problem: I must calculate the Fourier transform of the signal shown in the image below

I have expressed this as $$\require{cancel}\cancel{\Delta\left(\frac{t-4}{4}\right)\textrm{rect}\left(\frac{t-2}{4}\right)}$$

I read that the Fourier transform of a time-domain product equals the convolution of the two transforms in frequency domain but I don't know how to proceed, can you kindly help me?


texts: Decoding images from NOAA satellite APT signals

texts:
I've been working on a decoder for these APT images for a while now. I started years ago, in Python, and was able to implement a working decoder quickly. A few months ago, I came back to the project and decided to move to C++. I have not been making good progress, and I don't know what I am doing wrong.
See here for a description of the signal. Briefly, 256-level 4160 Bd image data is amplitude modulated onto a 2400-Hz subcarrier, which is frequency modulated onto a 137-MHz RF carrier.
Question the first: how is it possible (or rather, how it is meaningful) to use a carrier with frequency lower than the message? Is my misunderstanding perhaps to do with the frequency content of the message itself, rather than the rate it has been sampled at? Or something else?
I have the signal stored as a WAV file, 16-bit LPCM at 20800 Hz. I read these samples into an array, working one line of decoded image at a time. APT is two lines per second, so my array contains 10400 elements.
Now, the problem seems to come down to AM demodulation. It is my understanding that the proper way to do this is via computing the magnitude of the analytic signal. I do so by taking the DFT of my array, setting the negative frequency components to zero, and doubling the positive elements. Then iDFT back, and take the magnitudes as the demodulated signal.
I do some median filtering, do a naïve low-pass by zeroing bins in DFT, scale to 256 levels, and generate an image. Seems relatively simple -- so why does the output look so horrible? I am not sure what else to try. From my explanation, is there something I am doing I ought not be, etc.?

The bars on the right side look to me to be the telemetry frames, so it seems that my process is "working" in some sense. I'm not sure what the source of the high-frequency "circle" curves are you can see in the image.


texts: Explanation of fundamental filtering's consequences on signal

texts:
Can anyone explain why exactly an "Overshooting" phenomena is observed when the fundamental harmonic is removed as seen on the figures? Is it technically right to call this "overshooting" at all ? If not, how is it referred to ?

Signals in time-domain:

Spectra:


texts: Convolution of Input signal and Impulse response

texts:
I can solve the output if the input is

$$ x[n] = \delta[n+1] + \delta[n] + 2\delta[n-1] + \delta[n-2]$$

and the impulse response is

$$ h[n]= 3\delta[n] − 2 \delta[n−1] − \delta[n−2] + \delta[n−3]$$

I calculate the convolution between the strings [1 1 2 1]  and [3 -2 -1 1].

But I got a problem in computing the output when the input is
$$ x[n] = (\frac{1}{4})^{-n}  \left( \delta[n +1]  − \delta[n −4] \right)$$

and the impulse response is

$$h[n] = \delta[n] −\delta[n −5].$$

I took different strings but actually could not find what should be input and impulse response string and why?


texts:
I'm working on a project bass guitar with individual outputs per string using Nu pickups from Cycfi Research: https://www.cycfi.com/
The common sense approach is to simply take their circular connector and use this to interface, but I'd like to know how realistically could I use a multichannel ADC/MCU to convert the 4 (or more with scalability accounting for 5 strings or two pickups) outputs serially to an RJ45 in real-time?  The goal would be to preserve each individual output to process digitally in a box or use a DAC to split the channels back out to process with analog pedals (for example).
This is a question of "could" not "should," and it comes from a place of learning, tinkering, desire to use a more commonly available cable for lower cost (the circular is a good deal for its quality, but it's $84 and not common), and the ability to send power all in one cable.  Development time, headache, and cost of electronics inside or outside the guitar are not a factor, this is a hypothetical since I just don't have experience working with multichannel ADCs or ethernet and I'd like to use this as an alternative project to learn from.
I don't mind if this is wrong, I'd just like to understand if this is a rabbit hole or the elusive unobtainium.  Thanks in advance!


texts:
In Mengyu Liu, Yuan Liu, "Charge-then-Forward: Wireless Powered Communication for Multiuser Relay Networks", it is said that

  while information signals are conveyed by using FDMA over $N$
  sub-carriers (SCs) in the next phase of WIT(wireless information
  transmission). For information transmission, we deﬁne a binary SC
  allocation variable $x_{k,n}$ with $x_{k,n} = 1 $ representing that SC
  $n$ is allocated to pair $k$ for WIT and $x_{k,n} = 0 $ otherwise. Each
  SC is allocated to at most one pair at slot 1 for WIT to avoid
  interference

Does it mean that if the source transmits information to relay, it needs a carrier to help it send the message, so if I have $K$ source, then I have $K$ subcarrier?

If so, why does it still need two different variables? And I can't understand that if my thinking is right, why does it still have two situations, $x_{k,n}=0$ and $x_{k,n}=1$, for that?


texts: Transfer Function to go from a Step Input to a Linear Ramp between the two step values

texts:
I want a very basic simulation of a linear axis that can be given a position demand, and it will move to that position at a constant speed. At this point, I do not care about acceleration, but if I can modify the TF to incorporate it that will be a bonus.

I will program this simulation using scipy
This is a discrete-time system
The position the axis moves to is exactly the demand (no steady-state
error, gain 1)
The speed is constant. Ideally, I would like this to be configurable. But for the sake of this example, lets say it is 0.2m/s.
There is no overshoot
It is the same for both positive and negative steps, i.e increasing or decreasing the position demand
I do not care about the delay between the demand change and when it starts to respond. Ideally, it would be 0 or 1 time steps, but this is a really simple simulation so I do not care that much.
If it is given an impulse input then it will either move slightly or not at all, but I am not that interested in simulating this
If it is given a ramp input, then it will behave similarly to the step input if the slope of the ramp is steeper than the velocity of the axis, and will still move at the constant velocity even if the demand ramp is less steep (hence it will stop and start to track the demand). But again, I do not really care about simulating this, and would rather have a simplified solution.
A very rough approximation is fine, I do not need to identify the system to a realistic level.

So basically, the transfer function that represents the system is one that turns a step input into a ramp that goes between the start and end values of the step. If we also include acceleration, then it will turn a step input into a sigmoid looking signal.
What is this transfer function?
I could also represent this as ZerosPolesGain, or StateSpace within scipy, so either of those will also suffice as an answer.
Thanks


texts: Harris corner detection shape of $E(u,v)$

texts:
I am taking a computer vision class and I have just learnt about the Harris corner detection concept. A corner is detected when a small shift in a window function defined around the corner results in a large $E(u,v)$ term, which is the sum of squared difference of pixels between the previous window and the next window. There is a post on this forum that has a very nice conceptual explanation about harris corner detectors.
However, given that $E(u,v)$ should be large for small changes in $(u,v)$, why is $E(u,v)$ function usually depicted as a function that has a negative maxima ? Shouldn't $E(u,v)$ value be high when $(u,v)$ is close to $(0,0)$


texts: Scale and Rotation invariant feature descriptors

texts:
Can you list some scale and rotational invariant feature descriptors for use in feature detection.

The application is for the detection of cars and humans in video captured by a UAV, using a multi-class classifier.

So far I have been looking at SIFT and MSER (which is affine invariant). I have also looked at LESH, LESH is based on the local energy model, but is calculated in a way that is not rotationally invariant, I have been trying to think of a way to make use of the Local energy, to build a rotationally invariant feature descriptor, I read here What are some free alternatives to SIFT/ SURF that can be used in commercial applications? ,that " if you assign orientation to the interest point and rotate the image patch accordingly, you get rotational invariance for free", but don't know if this is even relievent or how i could apply this to my problem, any help would be appreciated, thanks


texts: Are there any signal processing libraries that implement TD-PSOLA?

texts: For such a popular and old algorithm, I've had surprisingly little luck finding implementations. I've got it working in MATLAB, but am curious if any other languages have libraries containing it (python?). I've googled extensively to no avail.


texts: The Fourier transform of a damped cosine and the units of the result

texts:
If I take a simple transient voltage signal of the form
$$f(t) = V_p e^{-t/\tau} \cos(\omega_0 t)$$
and take the Fourier transform in the normal way
$$F(\omega) = \frac{V_p}{\sqrt{2 \pi}} \int^{+\infty}_{0}  e^{-t/\tau} \cos(\omega_0 t)  e^{-i \omega t} \ \ dt $$
giving the result
$$F(\omega) = \frac{V_p}{2\sqrt{w\pi}} \left( \frac{1}{1/\tau - i (\omega_{0} - \omega)} + \frac{1}{1/\tau + i (\omega_{0} + \omega)} \right)$$
Seeing as I am interested in a Lorentzian like function, I ignore the second term in the bracket -- and then take the absolute-squared value of what is left giving
$$\left|F(\omega)\right|^{2} = \frac{V^{2}_{p}}{2 \pi}\frac{1}{(2/\tau)^{2} + 4(\omega - \omega_{0})^{2}}$$ which when making the approximation of $2/\tau = \Delta\omega$ the linewidth gives a quantity in units of $[V^{2}/Hz^{2}]$. Consistent with a power spectrum density.

This is the crux of my question as if I consider what really happens with a measurement say on a signal/spectrum analyser, the time transient voltage is dissipated over the input impedance of the signal/spectrum analyser, which will have a thermal Johnson-Nyqist noise of $[V/\sqrt{Hz}]$ -- and define my noise floor.

I feel that my result should somehow have the same units, that a spectral lineshape, originating from the FT of a time transient voltage signal should have either units of $[V/\sqrt{Hz}]$ or $[V^{2}/Hz]$. How can I rectify my inconsistency with units as in the end I wish to write something like
$$PSD = \sqrt{\left|F(\omega)\right|^{2} + e_{n}^{2}}$$
Where $e_{n}$ (units of $[V/\sqrt{Hz}]$) is the noise floor of my spectrum.

Some additional thought. I believe this problem can be rectified by the definition of the Power Spectrum density
$$S(\omega) = \lim_{T \rightarrow \infty} \frac{1}{T} |F(\omega)|^{2}$$
this factor of $1/T$ takes care of the dimensionality problem -- however I am unsure how to apply this equation as it seems to be in the limit just sends the function to zero because of the $1/T$ factor.


texts:
I started working on a autonomous robot project in my spare time. Everything is finished except the image proccessing part. I want my robot to follow an object with particular properties. For the start, I decided to use color as the particular property. For example if object's color is yellow, then I want my robot to chase it. I am using OpenCV and tried some of the sample codes but the problem is that in real world lightning is not uniform and the sample codes which I tried did not do a good job because of the changing threshold.

So what can I do? What do you prefer to me? (Are there any better sample codes, algorithm suggestions etc?) I will appreciate if you explain your suggestions as if you were explaining it to someone with nearly none experience with image processing.

Regards,

Amadeus


texts: If low frequency travels longer distance, why our speech is not travelling longer distance?

texts: It is know that low frequency signals travel longer distance that of high frequency signal. If so, our speech signal is low frequency signal, why it is not travelling further?


texts: Confusion about spectrograms: conceptual problem

texts:
The following code generates a spectrogram as shown in the image. The matrix s which is the spectrogram is of size 129x40 for a signal of length N=80. Based on my understanding, this means that the number of frames, frames = 40 which forms the X axis of the spectrogram image. Using the following values
step_size =1; w=2 (window),   into the formula of nfft (the number of frequency datapoints in each frame), I obtain :

nfft = 2 * ((step_size) - 1) = 78 (Y Axis)and
frames = floor((N - w) / step_size) + 1 = 40. (X axis)

So frames form the X axis of the spectrogram and labelled as Time in the graph/image plot.
Q1: Can somebody please explain how the matrix s is formed and the meaning of the dimensions? The following code segments the time series into chunks of data by sliding a window of size w=2 that creates 40 frames each containing nfft = 78 frequency datapoints. I thought there should be nfft = 78 data points in each frame of size w=2. I recall that we take half of the frequency points since the other half is repeated due to the complex conjugate. I don't quite understand what the Y axis 129 points denote and how they come.
Q2: In the Matlab documentation, it is mentioned that nfft has to greater than 256. But I am getting 78. So is my spectrogram construction incorrect?
Please correct me where wrong.
t = 0:0.001:2; N=80; %signal length (shortening it)
signal  = chirp(t,100,1,200,'quadratic');
signal  = signal(1:N);

noverlap = 0;
w = 2;
noverlap = 0;
s=spectrogram(signal,w,noverlap);
specto= (20*log10(abs(s)));
imagesc(specto)
colormap Jet;
h = colorbar;
set(get(h,'label'),'string','power (dB)/freq (Hz)');
axis image;
xlabel('Time','FontSize',14,'FontWeight','bold');
ylabel('Frequency','FontSize',14,'FontWeight','bold');


texts: Cannot recreate a simple Nyquist series in Matlab

texts:
a Nyquist series should look something like {...-1, 1, -1, 1, ... }, which i think means it is a sine wave sampled at the peaks and valleys exactly.

Now, given a sampling rate of 48 Hz, the Nyquist frequency should be 24 Hz.

If I am not mistaken, Nyquist series is basically the the dataset of a sine wave of frequency = Nyquist Frequency, sampled at the sampling rate given above.

in short, these are my matlab vars:

SR = 48;             //sampling rate (hz)
X  = 0:1/SR:2*pi;    //domain (time in general)
fNy= SR/2;           //nyquist frequency
Y1 = sin(2*pi*fNy*X);// a sine wave with freq = nyquist frequency.

when i plot X and Y1, i get a really messed up plot. (i think its zero since its so small in magnitude)

I believe that Y1 should be exactly = 1, -1, 1, -1, 1, -1 ...
Where did I go wrong? thanks


texts: Why the error probability is given by this expression?

texts:
I have seen this equation:

$$
\Pr({\epsilon})  = Q({\sqrt{2E_b/N_0}}) \,.
$$

where these definitions hold:

$$N_0/2  - the \ spectral \ density \ of \ white \ noise$$
$$E_b = PT_b - the \ energy \ per \ transmitted \ bit$$
$$P - Power $$
$$T_b - the \ time\ the \ bit\ transmitted \ in$$

Q - is (this) function, how do I derive this equation?


texts: How to normalize output of $\tt scipy.signal.correlate$

texts:
I have 2 different signals and I'm trying to cross-correlate then using Python 2.7 and scipy.signal.correlate. How do I normalize my results (such that the max amplitude is 1.0? I tried the following:

import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0,2*np.pi,num=1000)
x1 = 10*np.sin(2*np.pi*t)
x2 = np.sin(2*np.pi*t+np.pi/2)
x12 = scipy.signal.correlate(x1,x2,'full')
plt.plot(x12)

results in the following plot


texts: Why does my plot of the Blackman window not match everyone else's in literature?

texts:
I've seen the plot for Blackman window as so in a bunch of books, as on this website:

But plotting the same equation on Wolfram Alpha yields a different plot:

Why is their graph not centered around 0? And why is their peak at y=1?


texts: Does Mutual information utilize spatial information to calculate image similarity?

texts:
To calculate images similarity based on Mutual Information (MI), histogram and join histogram is required. In the literature, there are 2 contradict opinions about MI operation. 1. MI does not utilize image spatial information to calculate the similarity. 2. MI is embedded spatial information indirectly by joint histogram. I thought that may I misunderstand the MI methodology.

First opinion

  ... mutual information (MI) considers only statistical information, while
  spatial information is completely neglected. (Abdel-Basset et al. 2017)

Second opinion:

  Several works (Gao et al., ..) have adopted the joint histogram
  of the image pair to embed spatial information into an intensity
  distribution. (Xu et al. 2016)

I believe the second opinion is the right one. But I find many papers agree with the first one.  Which of the two groups do you believe in? why is another group wrong?


texts:
I have following two related questions concerning unit step function.

1-I want to sample the following signal. What will be the sample value at t=0? The signal takes 0 time to change from 0 to 1. So I  am confused what should be the sample value at t=0: 0 or 1?

2- This signal is having infinite bandwidth (This signal is not possible in real world as all physical systems takes certain time to change its values, but here the value is changing in 0 time ). What is its counterpart in discrete domain (again with infinite bandwidth).


texts: How to express time delayed discrete signals

texts:
Hi sorry this question might sound silly but,

a signal $$x[n]=[ 6 \: 4\: 0\: 2]$$ what is $$x[n-2]$$ then?


texts:
I have a little problem with the subject Theory of signal. We were told to make amplitude and phase spectrum of cosinus in MATLAB, but we don't have results nor materials from our teachers, so we have to study from many different materials and you can imagine what this is like. So I'm a little confused.

However, I did some graphs, that should be what I want, according to instructions, but I have never seen something like that, so I'm not sure, if that's right.

Do these graphs make any sense to you? I used fast Fourier transform (fft(y) in MATLAB) on the signal and then plot the result of transform versus sample frequency and I thought it's possible to get phase of the signal by angle(fft(y)), so I plotted this on the last graph. I'm very unsure especially by the third graph.

I would like to apologize for incorrect notions I might use, 'cause I'm not a native english speaker.

Thanks for any help.


texts:
The input function is a 60Hz square wave. From Fourier Transform I know that the frequency on the spectrum is 60,180,300....(2k-1). But there's a series of 120,240,360...(2k) signals appear.
I've googled but all I found is Fourier Transform issues, not Fast Fourier Transform. I'm wondering why there are some 2k terms appearing on the spectrum.
Thanks!


texts: FIR filter design with matlab firls() function

texts:
I have defined the following linear phase filter of order 4 (real and symmetric) in matlab:
h_d = [0.8367 -1.537 1 -1.537 0.8367]
I calculate the frequency response (for many points) and then I use firls function (which is supposed to give the least-squares solution) to find a linear phase FIR filter (5 taps) that matches the desired response. However the filter is nowhere close to h_d. What am I doing wrong?
Here is the code:
f = [0:1/(2^14-1):1];
[a,~] = freqz([0.8367 -1.537 1 -1.537 0.8367],1,f*pi);
a=abs(a);
n = 4; % Filter order
b_lp = firls(n,f,a);
[h,w] = freqz(b_lp,1,512);
figure(1)
plot(f,20*log10(abs(a)),'-s')
hold on
plot(w/pi,20*log10(abs(h)))

I appreciate any insights.


texts: How to calculate this energy for a given signal?

texts:
So the question Im asking can be seen in the picture below.The d at the end of the question stands for the minimum euclidian distance.

Mostly I just want to know how to calculate the energy for each signal. I know how to calculate the energy efficiency between two constellations (10 * log(E1/E2)).

Thank you


texts:
I am trying to generate a set of linear block codewords of length n and have minimum hamming distance dmin. I understand Hamming codes but they are not flexible with n. One possible way I can think of is brute force search. But when trying to code this in MATLAB I am not sure how to proceed.

Google search helped me find this link where it does exactly what I want.
Code Generation Tool

Also I would appreciate any other methods/algorithms which can achieve this in a more efficient way.


texts:
I want to implement the Fast Cosine Transform. I read on wikipedia, that there is a fast version of the DCT which is similarly computed to the FFT. I tried to read the cited Makhoul* paper, for the FTPACK and FFTW implementations that are also used in Scipy, but I were not able to extract the actually algorithm. This is what I have so far:

FFT code:

def fft(x):
    if x.size ==1:
        return x
    N = x.size
    x0 = my_fft(x[0:N:2])
    x1 = my_fft(x[0+1:N:2])
    k = numpy.arange(N/2)
    e = numpy.exp(-2j*numpy.pi*k/N)
    l = x0 + x1 * e
    r = x0 - x1 * e
    return numpy.hstack([l,r])

DCT code:

def dct(x):
    k = 0
    N = x.size
    xk = numpy.zeros(N)
    for k in range(N):
        for n in range(N):
            xn = x[n]
            xk[k] += xn*numpy.cos(numpy.pi/N*(n+1/2.0)*k)
    return xk

FCT trial:

def my_fct(x):
    if x.size ==1:
        return x
    N = x.size
    x0 = my_fct(x[0:N:2]) # have to be set to zero?
    x1 = my_fct(x[0+1:N:2])
    k = numpy.arange(N/2)
    n = # ???
    c = numpy.cos(numpy.pi/N*(n+1/2.0)*k)
    l = x0 #???
    r = x0 #???
    return numpy.hstack([l,r])

*J. Makhoul, "A fast cosine transform in one and two dimensions," IEEE Trans. Acoust. Speech Sig. Proc. 28 (1), 27-34 (1980).


texts: Difference between diversity combining and multiplexing

texts:
How exactly are diversity combining and multiplexing different?

My current understanding is that, in certain types of diversity combining such as  maximal ratio combining, the same message is sent over different frequencies and then all the messages are collected and based on information of the SNR they are weighted and used as additional info to decode the message.

This seems to be the same concept involved in multiplexing. I am not quite understanding what is happening differently in multiplexing. Can someone please clarify?


texts: PSD using MATLAB's $\tt pwelch$ algorithm window length and measure units

texts:
When using pwelch algorithm in MATLAB for a signal with $N$ samples,

Is there a good rule of thumb for determining the length $L$ of the sections (second variable for the function)?
And assuming my input is a voltage signal , what are the measure units I get for $10\log_{10}(P_{xx})$ where $P_{xx}$ is the output signal?


texts: Extracting common signal from 4 sets of observations

texts:
I am working on a signal processing assignment where I need to find out one common time domain signal from 4 observation. The math is like this:

\begin{array}{lcl} y_1(t) & = & a_1(t)*x(t) + b_1(t) \\
                   y_2(t)& = &  a_1(t)*x(t) + b_1(t) \\
                   . & & \\
                   . & & \\
                   y_n(t) & = & a_n(t)*x(t) + b_n(t)\end{array}

where:

$n$ is up to 4 in my case, and $x(t)$ is my signal of interest which I want to extract from observed signals $y_n(t)$.

What is the general direction I should take in doing background study for this kind of application?

Thanks,
K


texts: Adding phase to a signal that has multiple frequencies

texts:
An amplifier changes the phase at different amplitudes of asignal. I am using amplifier data in a MATLAB model.

I have constructed a signal that is a sum of sinusoids of different frequencies with random phase.

When this signal passes through the virtual amplifier model, how do I adjust the phase?

Should I... (Option 1)

Decompose the signal with a fast fourier transform, which gives me
the starting phase of each frequency and its absolute amplitude.
Then reconstruct the signal by making sinusoids of each frequency in
the signal (which will have the random phase it had to start), but
now add the additional phase change caused by the amplifier as well?

Or...  (Option 2)

Is this more complicated? If I have 3 frequencies in my signal, I
imagine 3 phasors (phase-vectors) added head to tail in a chain, with
the first one attached at an origin on a complex plane. They all
spinning around their tails at their own frequency. (so the first one
in the chain spins around the complex plane origin, the second one
spins around the head of the first, and the third spins around the
head of the second).
The absolute value and amplitude of my signal is
the vector from the origin to the end point of the final phasor in
the chain. Will the phase get added to this vector? Which is now what I said in the first part, the first option is where the phase is added to each phasor and not the overall phasor.

Please can someone assist


texts:
How does arithmetic coding work with images? I understand how it works with textual messages but I don't understand how it works with images.
So with textual data, we use the probabilities of the symbols to divide the interval between 0 and 1 into subintervals and then at each round we choose one of the intervals to be the new interval.
For example, we can code the word "wiki" with fractional value 0.001011 (decimal 0.172). (https://en.wikipedia.org/wiki/Arithmetic_coding)
With images, do we partition the image into subimages? For example 10x10 blocks. Then we count the probabilities of each pixel value in that block and use that as our model. Then subdivide the interval from 0 to 1 into 100 subintervals according to the probabilities. Then we choose one of the subintervals as the new interval, depending on which symbol (pixel value) we are coding? So the pixel values are the symbols and the probabilities of each symbol is the model. Finally, one fractional number represents the whole block of pixels,  i. e. 100 pixels.
The reason why I think that we have to partition the image into blocks is that it would result in a huge model if we have to count the probabilities of every pixel value of an image where a pixel can take any value between 0 and 255. Also we should have to subdivide the interval [0, 1) into a huge amount of subintervals. And the final fractional value would require a lot of bits if it would represent an entire image.


texts: Is a Stationary VAR Process with Zero Mean Gaussian Innovations a Gaussian Stationary Process?

texts:
Consider the stationary VAR process

$${\bf X}_t = \sum_{\tau = 1}^{L} A_\tau {\bf X}_{t-\tau} +{\bf \epsilon}_t$$

If the innovations $\epsilon_t \sim MVN({\bf 0},\Sigma)$ then is ${\bf X}_t$ a Gaussian stationary process?

Is it correct that due to the invertibility of the VAR into an MA and observing that ${\bf X}_t$ is the sum of zero mean MVN random variables the above is true, or is there a flaw somewhere in this.


texts: What is the effect of the natural logarithm in the frequency domain?

texts: I have read that taking the natural logarithm of a signal $x$ in the time domain will introduce a spectral broadening and hence "up-sampling" process before the logarithm is required. I tried to test that by plotting the spectrum (for example: from $-B$ to $B$) for an arbitrary limited band signal from $-B/2$ to $B/2$ and taking the natural logarithm in the time domain but I didn't see any effect of the broadening in the frequency domain, I tried the same method to show the effect of up-sampling and down-sampling (decimation in time) and it was working.


texts: Just wondering what the opening operator is in image processing? What does it do? Just deletes bits of the image that you don't want?


texts: Signals and Systems - LTI - Transforms - Impulse Response

texts:
I have $x(t)-> LTI -> y(t)$ where $LTI=h(t),H(jw)$.

and

$H(jw)=ab/((a+jw)(b+jw))$ where a and B are real numbers.

I am wanting to find the impulse response $h(t)$ as well as the input/output differential equation to the system.

If my understanding is correct I would want to take the Fourier transform of the frequency response/input and I am not sure where to go from there.


texts:
Is it possible to flip a signal's spectrum around DC?  I have a simple spectrum that I made up (MATLAB code):

spectrum =   [-1+4i 0+3i 1+2i 2+1i 3+0i 4-1i 5-2i 6-3i 7-4i 8-5i]
timeDomain = ifft(spectrum);

I looked on this website (http://www.dsprelated.com/showarticle/51.php) and the given proof states this can be done in 3 ways:

Invert the Q channel (14)
Swap the I and Q channels (15)
Invert the I channel (16)

I tried those 3 ways on my signal:

1)  Invert the Q channel

negQtd   = real(timeDomain) - 1j * imag(timeDomain);
negQSpec = fft(negQtd)

Output:

[-1-4i 8+5i 7+4i 6+3i 5+2i 4+1i 3+0i 2-1i 1-2i 0-3i]

2)  Swap the I and Q channels

swapTD   = imag(timeDomain) + 1j * real(timeDomain);
swapSpec = fft(swapTD)

Output:

[4-1i -5+8i -4+7i -3+6i -2+5i -1+4i -0+3i 1+2i 2+1i 3+0i]

3)  Invert the I channel

negItd   = -1 * real(timeDomain) + 1j * imag(timeDomain);
negISpec = fft(negItd)

Output:

[1+4i -8-5i -7-4i -6-3i -5-2i -4-1i -3-0i -2+1i -1+2i -0+3i]

Each of these does flip the spectrum of the signal, but it also modifies the spectrum:

1) Inverting Time Domain Q channel also negates/inverts the Frequency Domain Imaginary part.

2) Swapping the I and Q channels also swaps the Frequency Domain Real and Imaginary parts.

3) Inverting the Time Domain I channel also negates/inverts the Frequency domain Real part.

Is there some other way to simply flip the spectrum around DC or should I try a two step process?


texts:
I have met this question, but cannot prove it using DTFT definition.
Given: $g$ is a discrete sequence filter and:
$$ g \in l^2(Z)$$
$$\langle g_n, g_{n-2k} \rangle = \delta_{k}$$
Prove:
$$|G(e^{j \omega})|^2 + |G(e^{j(\omega + \pi)})|^2 = 2$$

Could you guys give me some direction on this one?
Thank a lot


texts: Replicating Research: Feature Vectors of Audio Samples

texts:
I'm trying to make a few classifiers with scikitlearn. I'm using the Urban Sound database, and trying to replicated their research for a baseline. However, I don't understand how they derive their feature vector? (I've tried to contact them to no avail).

Here is the passage:

  In all experiments we extract the
  features on a per-frame basis using a window size of 23.2 ms
  and 50% frame overlap. We compute 40 Mel bands between
  0 and 22050 Hz and keep the first 25 MFCC coefficients (we
  do not apply any pre-emphasis nor liftering). The per-frame
  values for each coefficient are summarized across time using
  the following summary statistics: minimum, maximum, median,
  mean, variance, skewness, kurtosis and the mean and
  variance of the first and second derivatives, resulting in a
  feature vector of dimension 275 per slice.

So, 11 metrics * 25 MFCC coefficients == 275 features. I have several concerns:

This passage seems to use the word "coefficient" to refer to a vector of coefficients, which I thought was the cepstrum (itself being composed of coefficients which are scalar).
mean, skewness etc are taken on a vector of coefficients (the time series) and return a scalar. But the delta and delta delta return a vector
How do you get the first 25 coefficients for a frame? Compute N and throw away N - 25? How many should N be?
If you have 11 * 25 features/frame (since "The per-frame values for each coefficient are summarized across time ...") then wouldn't you end up with many many more features/slice? Depending on the value of frames/slice? But the article says "resulting in a feature vector of dimension 275 per slice."

The dimensionality is really confusing me here..


texts: Scipy resample, "fourier method" explanation

texts:
I am seeking explanation of what "Fourier method" is that is described for resampling in documentation of resample() method. I want to downsample an array. I know what decimation is and how it works, I also know what fourier transform is. I cannot however find "scientific backup" so to say to the resample method in scipy. I saw this topic:

Python's $\tt resample$ vs $\tt resample\_poly$ vs $\tt decimate$

I also searched across some books regarding digital signal processing. Am I missing something obvious? I looked in the implementation of resample and I know it performs fourier transform on signal and then takes half of samples needed from the beginning of transformed array and from the end. Then it inverses fourier transform coming back to time-domain. I cannot find scientific description of this method. In the link above, this was mentioned:

https://en.wikipedia.org/wiki/Trigonometric_interpolation#Relation_with_the_discrete_Fourier_transform

I don't understand how interpolation is connected with downsampling. Could anyone explain and/or link some resources? Scipy docs has this in method description:

Resample x to num samples using Fourier method along the given axis.

The resampled signal starts at the same value as `x` but is sampled
with a spacing of ``len(x) / num * (spacing of x)``.  Because a
Fourier method is used, the signal is assumed to be periodic.

Thanks in advance.


texts: Pitch detection of two following music notes (C0 and C0#)

texts:
Hi signal processing community,

currently I am working on a pitch detection tool which should work on audio input files (or later also instrumental or voice from microphone) to say which music note is playing at the moment.

At the moment I am getting samples in a window of 1024. Then I do FFT-Hamming on this array. Now it is easy to detect notes like C1, C3, C4, C5, since I search for the peaks in the resulting array. But I don`t know how to do it for following notes. (also for example C0, D0)

Is my window to small? Or am I doing something wrong?

I hope you can help me. Thank you.

Best wishes,

MusicMagician


texts:
I am having trouble understanding on how to read the plot plotted by a wavelet transform,

here is my simple Matlab code,

load noissin;
% c is a 48-by-1000 matrix, each row
% of which corresponds to a single scale.
c = cwt(noissin,1:48,'db4','plot');

So the brightest part means the scaling coffiecient size is bigger, but how exactly i can understand this plot what is happening there ?
Kindly help me.


texts: Designing a 2x interpolation filter for audio

texts:
I want to perform 2x interpolation on an audio signal sampled at 44.1KHz by upsampling the signal by adding a zero after each original sample and then using a lowpass filter to interpolate the results.

Assuming an analogue elliptical filter (of order 10 or lower) as the basis for the design. What design specification would constitute a high quality audio interpolator that minimises aliasing?

For instance a passband and stopband at 0.45 * Nyquist and 0.55 * Nyquist respectively (Nyquist = 22.05KHz) with a stopband attenuation of -50dB and passband ripple of -0.1dB would be common for a low cost commercial DAC (I appreciate that digital to analogue conversion is a slightly different scenario). Would there be better values for doing high quality audio interpolation that minimises aliasing and doesn't truncate too many of the high frequencies before 22.05KHz.

For instance, is it a good idea to have the stop band above 22.05KHz for interpolation or does it not matter if the lowpass rolls off a little after 22.05KHz and what is acceptable?


texts:
I have a 2D array of eeg data with shape (64,512) - 64 electrodes, 512 timepoints

I want to calculate the maximum cross correlation (irrespective of lag/time shift) between every single electrode, so I end up with a 64x64 array containing max cross correlation values between all pairs

Is there an efficient way of doing this in python/numpy/scipy without iterating through all pairs of electrodes?

I tried using scipy.signal.correlate2d but I'm not sure its doing what I think its doing as I end up with a 2D array of size 127x1023 rather than 64x64:

from scipy import signal
import numpy as np

data = np.random.randint(1,100,(64,512))

xcorr = signal.correlate2d(data,data)


texts:
Endolith's recent question on zeroing FFT bins got me thinking about a possible error in my workflow and I'd like to double check.

Consider a signal $x_i[m],\ m\in\{1,\ldots,M\}$, i.e. $M$ samples sampled at $f_s$ and the subscript denotes the $i^{th}$ such signal segment. I then filter this with a bandpass filter to between $0.1 f_s$ and $0.3f_s$ (at this stage, I was careful to not do a zero-the-bins kind of filtering) and Fourier transform it with an $N>2M$ long FFT. Let $X_i[k],\ k\in\{0,\ldots,N-1\}$ denote the Fourier coefficients and the filtered portion (including the roll-off frequencies on both ends) be the indices $0< k_l,...,k_u< N-1$.

My application now involves applying some function, $g$ to the Fourier coefficients $X_i[k_l],\ldots,X_i[k_u]$, averaging across the different segments ($i$) and inverse Fourier transforming the resulting vector. In math, I compute

$$X_{avg}[k]=\left\langle g(X_i[k])\right\rangle_i,\ k\in\{k_l,\ldots,k_u\}$$

where $\langle\cdot\rangle_i$ denotes averaging over the different segments. So far, so good.

Now, I didn't know what to do with the remaining Fourier coefficients $X_i[k'],\ k'\in\{0,\ldots,N-1\}\backslash \{k_l,\ldots,k_u\}$ before taking the IFFT. These coefficients are theoretically insignificant, since I've already filtered out content in them. So I went ahead and set $X_{avg}[k']=0$ and then computed the IFFT of $X_{avg}$. The results were along the lines of what I expected, but I didn't think of the aforementioned filtering issue, although I was aware of it (this is the same situation, with a bit of twists at places).

My question then is: Is it still a problem in this case i.e., when the bins that I "zeroed out" were technically low/insignificant? If so, how should I have handled it?


texts:
I have a set of measurement which I want to model with 2nd-order difference equations (first order eqs don't model well enough).

The equation is

$$y[n] = \alpha_1 y[n-1] + \alpha_2 y[n-2] + \beta_0 x[n] + \beta_1 x[n-1]$$

I want a generic formula for the impulse response.

I did a derivation, but being a total DSP beginner, I'm not sure whether it's correct or I'm missing some bits:

The transfer function is:

$$\begin{align}
H(z) &= \displaystyle \frac{Y(z)}{X(z)} \\
 &= \frac{\beta_0 + \beta_1 z^{-1}}{1 - \alpha_1 z^{-1} - \alpha_2 z^{-2}} \\
 &= \frac{\beta_0 z^2 + \beta_1 z}{z^2-\alpha_1 z -\alpha_2 } \\
 &= \frac{A_1 \, z}{z-p_1} + \frac{A_2 \, z}{z-p_2} \\
 &= A_1\frac{1}{1-p_1 z^{-1}} + A_2\frac{1}{1-p_2 z^{-1}} \\
\end{align}$$

where $p_{1,2}$ are the poles and $A_1$ and $A_2$ can be calculated using partial fraction expansion.

Therefore the impulse response is

$h[n] = \big(A_1 p_1^n + A_2 p_2^n \big) u[n], $

where $u[n]$ is the discrete step function.

Is this ok?


texts: What is impulse response in simple AWGN channel?

texts: Assume a sender and receiver communicate through an AWGN channel. Let $x(t)$ be a transmitted signal and $y(t)$ be a received signal and $z(t)$ be the Gaussian noise. It is known that $y(t) = kx(t-\Delta t) + z(t)$ where $k$ is the channel gain (say due to attenuation) and $\Delta t$ is the delay. I was wondering what is the channel impulse response? I assume it should be $h(t) = k\delta(t - \Delta t) + z(t)$? Is it correct?


texts: Calculate transfer function of two parallel transfer functions in a feedback loop

texts:
I have rational transfer functions:

$$H_1(z) = \frac{ b_0 + b_1z^{-1} + b_2z^{-2} }{a_0 + a_1z^{-1} + a_2z^{-2}}$$

$$H_2(z) = \frac{ q_0 + q_1z^{-1} + q_2z^{-2} }{p_0 + p_1z^{-1} + p_2z^{-2}}$$

And they are being used in the following feedback loop:

Sometimes this system blows up, and other times it is stable depending $H_1$ and $H_2$. I'm guessing that when it blows up, the poles of the combined system are outside the unit circle.

How do I calculate the transfer function of the system so I can start re-arranging it?


texts: How does one interpret an element of the "transfer matrix" used to calculate frequency domain granger causality (via VAR models)?

texts:
I am attempting to gain a better mathematical understanding for how autoregressive models can be used to infer frequency-domain granger causality. All freq. domain measures of causality that utilize autoregressive models convert the time-domain parameters to a frequency-based representation (i.e. take the Fourier transform of the original parameters), and then take the inverse of that representation to get the so-called "transfer matrix". This transfer matrix is referenced in many causality-related papers, and is the backbone of all freq. domain measures. Here is the derivation for the transfer matrix:

$a_{i,j}(k)$ - Autoregressive coefficient describing influence of node $j$ on node $i$ at lag=$k$

$p$ - Model-order (i.e. how many past time-points to use to predict the present)

$\textbf{A}(k)$ - $Q$-by-$Q$ autoregressive parameter matrix at lag=$k$. This matrix is estimated via model fitting.

$U(t)$ - Innovation noise (i.e. the difference between the model's predictions and observed data at time $t$.)

\begin{align}
   {Y(t)} = \sum_{k=1}^{p}\textbf{A}(k)Y(t-k) + U(t)
\end{align}

$\bar{\textbf{A}}(f)$ - Frequency representation of $\textbf{A}(k)$

$\bar{{a}}_{i,j}(f)$ - Frequency representation of autoregression describing influence of node $j$ on node $i$ at freqeuncy $f$

$\bar{a}_{i,j}(f) =
\begin{cases}
                                   1-\sum_{k=1}^{p} a_{i,j}(k) e^{-\textbf{j}2\pi f k} & \text{if $i=j$} \\
                                   -\sum_{k=1}^{p} a_{i,j}(k) e^{-\textbf{j}2\pi f k)} & \text{otherwise}
  \end{cases}
$

\begin{align}
    \text{where } \textbf{j}=\sqrt{-1}
\end{align}

Note that above piecewise equation stems from taking the FT of model coefs. At least as far as I understand it. I'm not actually positive as to why this equation is piecewise and not identical for all $i$/$j$ combinations. I haven't worked with FTs very much.

$\textbf{H}(f)$ - Transfer matrix

\begin{align}
    \textbf{H}(f)=\bar{\textbf{A}}^{-1}(f)
\end{align}

Now for my question--does anyone have an intuitive definition for what the transfer matrix, or a given element of the transfer matrix ($h_{i,j}(f)$), actually represents? I can easily and intuitively understand what $a_{i,j}(k)$ represents, but I've yet to fully grasp what $h_{i,j}(f)$ represents. How does one interpret such a value in layman's terms?


texts: using Short-Time Energy and zero crossing rate

texts: I am trying to identify a sound region of a word from a wav file (44100Hz). My research gave me the idea that I must use "Short-Time Energy" and "zero crossing rate". But the problem is I am not clear with the formulas to code. So if someone can guide me to a much clear Pseudo code I will greatly appreciate it. And also if someone can tell me the order of using this I will highly appreciate that too. Thanks in advance.