texts:
I am performing language classification from audio signals using mel-spectrograms as my inputs for a ResNet. It works well as long as all of my audio data from different languages is from the same dataset (therefore in the same format). When I train on language A from dataset 1, and validate on language A from dataset 2, the accuracy for that language drops significantly, and instead the network guesses that a lot of the signals from language A are a different language from dataset 2.

This leads me to believe the network is first picking up on features that determine which dataset the audio came from, and then classifying the language as a secondary feature.

I tried reformatting data from each dataset so that it would contain the same amount of information. Dataset 1 (voxforge) consisted of wavfiles and dataset 2 (mozilla common voice) consisted of mp3 data, so I converted dataset 1 to mp3 data that had the same sampling rate and bits per sample as dataset 2.

I’m thinking there must be some other encoding artifact from the datasets that is throwing my network off. Has anyone else had issues with “normalizing” data across datasets or anything about converting encodings so that the information encoded is of equivalent quality?


texts: Why does downsampling stretch a signals frequency response and upsampling shrink and create images of a signals frequency response?

texts:
I am learning some basic DSP and I have a pretty good intuition as to why sampling creates spectral images of the frequency response at intervals of the sampling frequency (convolution with pulse train).

I am reading about sample rate conversions (downsampling/decimation and upsampling/interpolation) and I can't seem to get intuition as to why downsampling/decimation stretches the frequency response by M (the downsample factor) or why upsampling/interpolation compresses it by I (the upsample factor) and creates more images of the originally sampled datas frequency response


texts: Conditions for precoding matrix to preserve complex conjugate symmetry on DFT vector

texts:
Suppose there is a DFT vector $\mathbf{X}$ with length N, which presents complex conjugate symmetry around its middle point, i.e., $X(1) = X(N-1)^*$, $X(2) = X(N - 2)^*$ and so forth.  $X(0)$ and $X(N/2)$ are the DC and Nyquist frequency respectively, therefore are real numbers. The remaining elements are complex.

Now, suppose there is a matrix $\mathbf{T}$, with size $N \times N$, which multiplies vector X.

\begin{align}
\mathbf{Y} = \mathbf{T}\mathbf{X}
\end{align}

The question is:

In what conditions, for matrix $\mathbf{T}$, the complex conjugte symmetry around the middle point of the resulting vector $\mathbf{Y}$ is preserved?

The motivation for this question is trying to come up with a precoder matrix $\mathbf{T}$ that results in a precoded (pre-equalized) symbol $\mathbf{Y}$ whose IFFT is real.

EDIT:

Thanks @MattL. and @niaren.
The difficulty about this question is to find necessary conditions. Matt's answer is indeed sufficient. It is also sufficient to make the following modifications:

The first row and the first column do not need to be zero. Instead, they could be non-zero, as long as its values present a complex conjugate symmetry around the middle point, its first value is real and its $(N/2+1)$-th value is real, just like the symbol. The same could be stated for the $(N/2+1)$-th column, the $(N/2+1)$-th row, and the main diagonal.

Secondly, the same correspondence between the matrix in the upper left corner and lower right corner could be made between the upper right corner and the lower left corner, that is, chose an $(N/2 -1)\times(N/2-1)$ matrix starting from $t_{2,N/2 + 2}$ to $t_{N/2,N}$, flip from left to right, flip upside down and take the conjugate, then put at the lower left corner. On MATLAB, that would be:

T(N/2+2:N,2:N/2) = conj(fliplr(flipud(Tisi(2:(N/2),N/2+2:N))))

This structure is similar to the structure of the DFT matrix. Would that be a necessary condition?

EDIT(2):

The following code implements such a valid operator for any real-valued $N \times N$ matrix $\mathbf{A}$:

N = 8;
A = rand(N,N); %must be real-valued
w = exp(-1j*2*pi/N); % twiddle factor
W = w.^(repmat(0:N-1,N,1).*repmat(0:N-1,N,1).'); % DFT matrix
T = W*A*W'

EDIT(3):

It is also interesting to note the $\mathbf{T}^{-1}$ presents the sufficient condition too. This comes from the fact that:

\begin{align}
\mathbf{T}^{-1} &= \mathbf{\left(W A W^{H}\right)}^{-1}\\
 &= \mathbf{\left(W^{H}\right)}^{-1} \mathbf{A}^{-1} \mathbf{W}^{-1}
\end{align}
where $\mathbf{W}$ is the DFT matrix.

Since $\mathbf{W^{H}} = N\mathbf{W}^{-1}$. This equation becomes:

\begin{align}
\mathbf{T}^{-1} &= \left(N\mathbf{W}^{-1}\right)^{-1} \mathbf{A}^{-1} \frac{1}{N}\mathbf{W^{H}}\\
&= \mathbf{W} \mathbf{A}^{-1} \mathbf{W^{H}}
\end{align}

Finally, since $\mathbf{A}^{-1}$ is real-valued, provided that $\mathbf{A}$ is full rank,$\mathbf{T}^{-1}$ is sufficient.


texts:
I have a sound file with a computed spectrogram from 0 to 8000 Hz (spanning about 5 octaves). The spectrogram has 128 logarithmically spaced frequency bins. How can I reduce the number of bins so that I keep an equal bandwidth in octaves? Can I average adjacent bins?

As an example, let's say I have 128 bandpass filters which are spaced equally along a log frequency axis, with center frequencies 180-7040 Hz spanning 5.3 octaves. How can I reduce this to 42 bins with equal bandwidth in octaves? Matlab or python examples are welcome.


texts: When is a LTI IIR $H(z)$ system minimum phase

texts:
EDIT: I failed to mention that the system's inverse also needs to be causal and stable.
I cannot wrap my mind around on how when a system and its inverse are both causal and stable and LTI IIR  it is safe to say that the system is also minimum phase.
So the causality for a system means that  $$h[n]=0, \mbox{for all } n<0,$$ but what does the stability mean when talking about a system? That there are no poles inside the unit circle? and if so how does it turn out that when a system is causal and stable it's also min phase.
Also intuition-wise when is a system inverse causal and stable?
I should clarify that I'm talking about discrete time.


texts: Design a comb notch filter when sampling rate is not an integer multiplicative of the cutoff frequency

texts:
Let's say I have a signal sampled at 976 Hz and I want to remove network interference noise, i.e. 50 Hz and all the harmonics. Is it possible theoretically to design a comb filter to do that?

I have looked at how to do this in MATLAB but the problem is that the order of the comb filter -which defines the fundamental frequency to be filtered out- must equal fs/fo, and of course this needs to be an integer.

Any help would be greatly appreciated.


texts: If I take a two dimensional image and conduct a fourier transform on it, I would get a two dimensional matrix of complex values. If I want to find the amplitude of each value, is that the same as calculating the magnitude of each component, ie Mag(re,im) = sqrt(re^2+im^2)?


texts: Recursive version of DFT as presented in Cooley-Tukey paper

texts:
The seminal paper of Cooley and Tukey  provides an iterative method for computing the DFT for a sequence of length $N$. Specifically, they mention a method which utilizes the fact that $N$ can be written as $N = r_1 r_2$. The two intermediate results during computations themselves are DFT computations, therefore, their computation in turn can be recursively estimated.

Is there a reference/method of recursive formulation for computing DFT using the $N=r_1 r_2$ factorization ?  The versions of FFT I come across use factorizations where $r_1 = \frac{N}{2}$ and $r_2=2$. I would like to know if there are recursive formulations for general factorization of $N$.


texts: Digital signal processing how audio wave and function chage with respect to each other

texts: If an audio signal is f(t)  and if i play same audio with 2× speed then what will function of 2× speed signal f(2t) or f(t/2) and why?


texts:
I want to use morphology operator for filling holes of a 3d image. The 3d image consists of 116 2-D image slices of the same size (512*512 pixels). I tried using imfill in Matlab for the 3d image but the result is not I want. One of the slices of the 3d input image(a) and the corresponding slice from the 3d output image(b) result of using imfill  is shown here . The small holes are filled and other holes are not filled.

When I tried using imfill slice by slice the result is correct. Is there any way for filling holes in 3d images? How can I do this?


texts:
I'm reading the various FFT algorithms and the input consists usually of real and imaginary parts.
The real data can be for example an audio input and the imaginary part should be the same sized array filled with zeros. But the algorithm, for example the bit reverse part works also on the imaginary part, essentially moving zeros around. What's the point in it?


texts: Filtering a digital signal online in real-time using python

texts:
I am currently trying to apply a bandpass filter to a signal in real-time. There are samples coming in with a constant sampling rate and i would like to calculate the corresponding bandpass filtered signal.

What would be the best way to do this? Do I have to filter the whole (or at least a huge bit) of the signal every time a few new samples came in or is there a way (like the sliding DFT) where it is possible to efficiently determine the new part of the filtered signal?

I would like to use a butterworth filter (for offline analysis I am currently using scipy's butter and lfilter). I know that this function can return a filter delay, but I don't know how to use it to get a constant signal.


texts:
If I have a white noise fed into a filter what would be the output of the filter - what would you expect to see?
I know that white noise has a unit power spectral density (PSD), how these thing relate to each other?


texts: Determining which Filter from a Z-Plane Plots?

texts: How do i determine which FIR filter (LP, HP, BS, BP) it is from looking at it's z-plane plot?


texts: Why is $y(n) = x(n) + x(n-1)$ a low pass filter?

texts:
I have found that this is a simple, but bad lowpass filter:

$$y(n) = x(n) + x(n-1)$$

However, I can't understand why it is a lowpass filter. What is its cutoff frequency?


texts:
I tried to find the answer by my own but unfortunately I couldn't.

Let's say I have the discret values of a signal which is 10s long.

What is the FFT which is performed on a sliding window with time?

What is the difference to the FFT, where I get the frequency spectrum of the signal?


texts: Is there two version of ulaw and alaw encoding in audio compression?

texts:
I am new to encoding in audios and i have searched for ulaw and alaw and found there is conversion from audio to this encoding CCITT alaw/ulaw and as i have known alaw/ulaw belongs to ITUT group not CCITT so Is there two standards for conversion audio to  alaw/mulaw ?

and this conversion about CITT ulaw


texts: Calculation of cosine in frequency domain instead of calculatin in time-domain followed by a FFT

texts:
I got an $N$, in my case 512, point FFT of a real-valued signal. Based on some calculation in my application I determine the parameters $k \in [1, N-1]$, the number of oscillations per period, $\phi \in [0, 2\pi[$, phase. I use these parameters and the function
$\cos\left(2\pi\cdot \frac{k}{N}\cdot t + \phi\right)$
to describe a signal in time-domain. Instead of calculating all the points of the signal and then doing an FFT I would like to directly calculate the result in frequency domain.

I calculated the FFT coefficients for the function as following:

$$c_n = \frac{N}{2}\left(\mathrm{e}^{i\phi} \cdot \mathrm{sinc}\left(n-k\right)+\mathrm{e}^{-i\phi} \cdot \mathrm{sinc}\left(n+k\right)\right), \quad\text{ with }\mathrm{sinc}(x) = \frac{\sin(\pi x)}{\pi x}$$

Note: $N$ is in here because the output of the FFT algorithm I use is not scaled and scaling is done in IFFT:

I verified my coefficients using Mathematica with the FourierCoefficient function.

I calculated a 512 elements long vector of complex doubles in Matlab and set my first vector to zero as there is no (dc) offset.

Is this valid or do I have to calculate bin 0 too if my $k$ is not a whole number?
Can I use $c_0$ for it?

The next 255 values I filled $c_n$ with $n$ from -1 to -255. The next value I filled with zero as I was unsure which coefficient should go there. And then the next 255 values I filled with $c_n$ with $n$ from 255 to 1.

To verify the correctness of my generated signal I plotted the real value of the IFFT of my vector. The output was as expected as long as $\phi$ was 0 and $k$ was a whole number.

Plot (blue is what was expected and red the result from IFFT) with $\phi=0$ and $k = 8.3$:

Plot with $\phi=0.3$ and $k = 8$:

Plot with $\phi=0.3$ and $k = 8.3$:

For reference my matlab code is:

k = 8.3; %number of oscillations per period
phi = 0.3; %phase in radians

t = linspace(0,511,512);
n = linspace(-1,-255,255);
fft_coeff0 = 256*(exp(i*phi)*sinc(-k)+exp(-i*phi)*sinc(k));
fft_coeffs(1:255) = 256*(exp(i*phi)*sinc(n-k)+exp(-i*phi)*sinc(n+k));

reconst_fft = [fft_coeff0 fft_coeffs 0 conj(fft_coeffs(end:-1:1))];

y = cos(k/512*2*pi*t+phi);
plot(t, ifft(reconst_fft), 'r', t, y, 'b')

What could cause the difference between my expected output and the IFFT?
How can I fix it?

EDIT: Changed code to only calculate one side and use complex conjugating for the other side and added $c_0$ coefficient to vector.

Plot with $\phi=0.0$ and $k = 8.5$:

Adding $c_0$ fixed the wrong amplitude.


texts: How to successfully resolve multiple pulsation frequencies in the FFT?

texts:
I am dealing with signals that in both extreme cases can have:
a) Non-overlapping monochromatic pulsation-like events at different points within a time series.
b) Overlapping pulsations at multiple frequencies for the entirety of the signal
Code to create these dummy signals is as follows:
import numpy as np
from scipy import signal

def test_pulse(start,end,periods, noise=0, npts=3600, dt=1.0, phase = [0],\
               amp=[1],window='hann'):
    #Generate waves at indices start and end, at frequencies (periods)

    t = np.arange(npts, dtype=float) * dt

    x = np.zeros(npts)

    for p,a,ph in zip(periods,amp,phase):

        wave_t = np.arange(end-start)

        w=getattr(signal.windows,window)(end-start)

        x[start:end] += a* np.cos(2 * np.pi * wave_t / p + ph*np.ones(end-start)) * w
        x += noise * np.random.randn(npts)

    return t, x

In an idealized overlapping case where frequencies of interest are in the frequency resolution of my signal, I can clearly see peaks in the correct places. However, for the non-overlapping case there is a lot more spectral leakage which I anticipate, but the peaks are now not lining up:

For my application getting the correct peaks is important, so what techniques can we use to correctly identify non-overlapping monochromatic frequencies within a signal using the FFT?
Code to produce the plot above is as follows:
fig, ax = plt.subplots(1,2,figsize=(10,4))

freqs =np.fft.rfftfreq(3600,1)
freqs = ulf[(ulf>1e-3) & (ulf<=10e-3)]

F = freqs[10:30:6]

#Overlapping for entirety of signal
t, x = test_pulse(0,3600,[1/f for f in F], noise=0, npts=3600, dt=1.0, phase = np.zeros(F.size),amp=np.ones(F.size),window='hann')

sFT = np.fft.fftshift(np.fft.fft(signal.hilbert(x),n=3600))
all_freqs = np.fft.fftshift(np.fft.fftfreq(x.size))
y = abs(sFT)/x.size

ax[1].plot(all_freqs,y,label='Overlap')
ax[0].plot(t,x)

#Non-overlapping pulses within signal
t, x = test_pulse(0,900,[1/f for f in F[:1]], noise=0, npts=3600, dt=1.0, phase = np.zeros(1),\
               amp=[1],window='hann')

for s,e,f in zip([900,1800,2700],[1800,2700,3600],F[1:]):
    x+=test_pulse(s,e,[1/f], noise=0, npts=3600, dt=1.0, phase = np.zeros(1),\
               amp=[1],window='hann')[1]
ax[0].plot(t,x)
sFT = np.fft.fftshift(np.fft.fft(signal.hilbert(x),n=3600))
all_freqs = np.fft.fftshift(np.fft.fftfreq(x.size))
y = abs(sFT)/x.size

ax[1].plot(all_freqs,y,label='Non-overlap')

[ax[1].axvline(ff,ls='--',color='black') for ff in F]
ax[1].set_xlabel('f (Hz)')
ax[1].set_ylabel('Amplitude')
ax[1].set_xlim(0,12e-3)
ax[1].legend()

ax[0].set_xlabel('t')


texts: it it possible that absorption appears in the power spectrum of a non man-made system?

texts:
I mean some kind of system may dislike some special frequencies and there may be absorption lines.
Can somebody give some example?
You can lots of emission lines below. But is it possible the PSD is just a continuum with several absorption lines?


texts: Generate the Matrix Form of 2D Convolution Kernel

texts:
We know that a convolution can be replaced by a multiplication with a Toeplitz / Circulant Matrix. Meaning, assume I have convolution kernel $ h $ and matrix $ I $ (Of size $ m \times m $ for example), then there is a matrix $ H $ of size $ m^2 \times m^2 $ such that $ h \ast I $ is the same as $ H I^{cs} $ Where cs for column stacked image resized to $m \times m$ (reshape(H*I(:), [m, m])).

My question is - how to construct $H$? I know that every row of $H$ is responsible for single entry of the resulting multiplication (H(1,:)*I(:) gives the (1,1) entry of the convolution result), so I can try to work very hard to calculate each entry of $H$ (e.g. if the kernel $h$ is of size $3 \times 3$, than the convolution result in entry (i,j) is:

$$ h_{11}\cdot I(i-1,j-1) + h_{12}\cdot I(i-1,j) + h_{13}\cdot I(i-1,j+1) + h_{21}\cdot I(i,j-1) + h_{22}\cdot I(i,j) + h_{23}\cdot I(i,j+1) + h_{31}\cdot I(i+1,j-1) + h_{32}\cdot I(i+1,j) + h_{33}\cdot I(i+1,j+1) $$

except for near the edges of $I$. so it's somewhat possible with a lot of hard work to construct $H$ such that when multiplying by $I^{cs}$ I will get that result). But is there a 'generic' way for this construction? Or perhaps a made MATLAB function?

I am aware of the convmtx2() function in MATLAB, but the resulting matrix is not in the proper dimensions (not even square).


texts: Are there any good "conceptual distances" for comparing two images?

texts:
I want to define some distances to use over an image, which I create.

I think I need to define two different "distances".

The first distance should be the most robustness preserving in compare to the original image.
The second one should would be the most transparency preserving in compare to the
original image.

For example:

Let $I_1, I_2$ and $I_3$ be images, $I_1$ is the original and $I_2, I_3$ are some similar images:

I would like to define a metric or some distance so a and b will holds:

a. $|I1 -I2| > |I_1 -I_3| <=> I_2 $ is more robustness preserving then $I_3$ in compare to
the origin $I_1$.

b. $|I_1 -I_2| > |I_1 -I_3| <=> I_2$ is more transparency preserving then $I_3$               in compare to the origin $I_1$.

as I said the distance in a. and b. don't have to be the same at all.

I saw this post but it didn't help me alot, it may help you to find a good answer:

What distance metric can I use for comparing images?


texts: Computing overall bitrate of a transmitter with a two chunks package

texts:
I'm programming a digital communication system in MATLAB and I have a two chunk package, let's say a header and a body, and I'm using a different channel code for each chunk, i. e. BHC1 and BCH2. But because I'm using the same modulation for both chunks,

Rs = n_symbols / (n_symbols * n_symbol_samples / Fs) = Fs / n_symbol_samples

is the same. Computing Rc, I obtain

Rc = Rs * log2(M)

Hence,

R1 = Rc * BCH1_rate
R2 = Rc * BCH2_rate.

How can I compute an overall bitrate R for my system if I'm a sending this package composed of two chunks with differents channel codes?


texts: ROC of the function in the problem 9.14 of Oppenheim's Signals and Systems textbook

texts:
I have solved the problem 9.14 in Oppenheim's Signals and Systems textbook, but my solution and the one in Slader is different. Problem is given above. And Slader solution is here.

I have also attached my solution below. Laplace transforms are the same but ROC in the Slader solution and mine is different. My question is how can this Laplace transform have an ROC as Re{s}>0. This should be wrong since this region contains the two poles of the Laplace transform which should not be the case for a rational Laplace transform.

Thanks in advance.


texts: How to pad a array representing music to pad the stft of this array?

texts:
I have an array named samples of size (2, 1321967) representing an audio file. When I pass it to scipy stft with

f, t, Zxx = scipy.signal.stft(samples, sample_rate, nperseg=254)

My array t is of size (10411). I would like to pad t and Zxx 127 points to the right and to the left. To get my padding, I would like to pad samples and then pass it to stft.

How many points do I need to pad to samples in order to get the right size for t?


texts: Kalman Filtering with measurement latency

texts:
The timing involved in this problem is a little hard to explain, so I'll start with my specifics:
I'm developing a program that visualizes output (a bounding box) from a computer vision model on top of a live camera feed. I want to animate the display at 60 FPS, but the model only provides output at 5-6 FPS. In other words, there are 10-12 frames of animation between every model output.
I'd like to use a Kalman Filter, both to smooth the model output, and to predict the future position of the bounding box. By predicting the position, I can keep the display current and animate on every frame without waiting for the computer vision model to "catch up."
What I'm struggling with is the latency of the computer vision model, and how to update a Kalman filter when there's latency in the measurement.
Here's a timeline, where each Tn is animation frame n at 60FPS:
T0: capture camera frame, submit to model for processing
T1: use KF to predict position at T1, display
T2: use KF to predict position at T2, display
...
T10: model measurement finally comes back. Update KF.
So, the measurement arrives 10 frames after the corresponding prediction. All the KF examples I've seen assume that the prediction and the update are at the same time, rather than offset by latency. To reiterate, I'd be doing the update at T10, but the measurement in question is from the past! At T0.
I'm planning to keep a buffer of past KF states, and do the update at T10 using the past KF state from T0. But is this a bad idea, will I run into weird inconsistencies by going back in time? Is there a better, established approach for this?
My apologies if this has been unclear. The concise version is: how do I update a Kalman Filter, with measurements taken in the past? Thanks so much!


texts: Trying to decompose a signal into sine waves whose wavelengths aren't restricted to 1/N times sample range?

texts:
I am trying to essentially do a Fourier transform - I want to fit some data with sine/cosine functions. At first I was trying to do this using FFT, but my problem is that the FFT algorithm doesn't seem to provide accurate information about the actual frequencies/wavelengths that are making up the data, i.e., all the wavelengths reported by the FFT are 1/N of the sample window (where N is an integer.)

But, say that the actual wavelength present is some non-integer quotient such as 1/3.5 times the sample window, etc.? Is there a better algorithm than FFT to fit a function with any-wavelength sine waves, instead of only restricting to specific wavelengths?

(I understand that to get a better fit, it probably won't be a fast algorithm like FFT - that is fine if it is a slow method, as long as it can accurately fit to find any arbitrary present frequencies.)

This is my first time posting on this board - let me know if you need any more information about my question. Bonus points if anyone can suggest a way to do this in Python!


texts: Simplest way to implement FIR filter in C/C++

texts:
What's the simplest way to implement a FIR filter in C/C++ ?

(I don't want to have to use a third-party software like Matlab or Octave in order to compute the coefficiens because I have to use different filters on thousand of files, with different frequencies for each file.)

Thus, is there a ready-to-use C/C++ DSP library with functions like file.FIR_NotchFilter(frequency,Qfactor) ? or something similar ?
(commercial or opensource)

Thanks a lot in advance.

PS1 : I see that there is http://aquila-dsp.org, but there are no binary releases yet, and for older version, it seems difficult to use it

PS2 : A really ready-to-use solution exists for IIR filters : https://github.com/vinniefalco/DSPFilters

// Create a Chebyshev type I Band Stop filter of order 3
Dsp::SimpleFilter <Dsp::ChebyshevI::BandStop <3>, 2> f;
f.setup (3,    // order
     44100,// sample rate
     4000, // center frequency
     880,  // band width
     1);   // ripple dB
f.process (numSamples, arrayOfChannels);


texts:
I am using a 5th order lowpass Butterworth filter with a varying cutoff frequency, $f_c$, to smoothen some data coming from a spectrometer. An example of a spectrum, plotted with the filtered data, looks like this:

The spectrum thus consists of intensity values over a range of energies.

To apply the filter, I have used the SciPy signal butterworth filter, applied like this:

b, a = signal.butter(5, fc, 'low')
self.spec = signal.filtfilt(b, a, self.lowpassdata)

where fc is the cutoff frequency, and self.lowpassdata is an array with the data plotted in orange above. self.spec is the resulting filtered dataset.

I have been doing this quite blindly (at least it works) but I would like to know what actually happens, i.e. if the filter follows a specific mathematical function that takes the order, the cutoff frequency, and the spectral data as input.

Thank you!


texts: Histogram Intersection with two different bin sizes?

texts:
I have two images: A and B. Image A is a screenshot of image B, the original image. While there is noise in image A, the original features are still distinguishable.

Histogram intersection tells us that:

$$K(a,b) = \sum_{i=1}^{n}\min(a_i,b_i)$$

where if $K$ is large, $a$ and $b$ are similar.

If we process image A to create a histogram with an optimal amount of ($n \pm x$) bins, how do we apply histogram intersection in this case where image A and B don't have the same amount of histogram bins?


texts:
While processing digital images in the Fourier domain, mostly we exploit the amplitude and not the phase. This could be because the amplitude is much more structured and the amplitude spectrum reveals a lot about the spatial domain as illustrated in HIPR and other answers.
I am really curious to know what does the phase encapsulates, what can we infer from it, what kinds of operations can we perform on the phase of FFT of an image to achieve some objectives?
My specific interest lies in fusing two images in the frequency domain, but any PDF or well-documented links on understanding the phase of FFT(image) will help.
------ Edit (following images as suggested by TimWescott in comments)


texts: Wireless networks operate on a high frequency, say some several gigahertz. Are the signals really sampled at that high frequencies? If I got it correctly there's some modulating/demodulating in signal transmit, does that effect the situation somehow?


texts: Inpainting: which algorithm should I choose?

texts:
I have a 3D data set sampled on a regular grid shown in the Figure below. This data can be interpreted as an image where the point altitude is equivalent to the pixel intensity value.

In the middle of my 3D data, I have a peak, that becomes a bright spot when the data is interpreted as an image.
My goal is to remove this hot spot from my data.

I was told to try some image inpainting techniques to remove it without introducing too many artifacts. After searching available implementations, I've found two algorithms already implemented in the opencv library:

one is the Navier-Stokes Inpainting by Bertalmio et al.;
the other one is a fast marching based approach by Telea;

but I don't know which one to use.

Is any of these methods suitable for my task? Which of these methods (if any) should I use?

Thank you.


texts: Clarification concerning power spectral density

texts:
Many books in signal processing,  e.g. Papoulis [1], define power spectral density (PSD) as:

$$S(\omega)=\sum_{k=-\infty}^{\infty}R_{xx}(k)e^{-j\omega k}$$

Which is the fourier transform of the correlation function:
$$R_{xx}(\tau)=E[x(t)x(t-\tau)]$$

However, some authors in the context of time series analysis, for example Jenkins [2] define it as:

$$\Gamma_{xx}(\omega)=\sum_{k=-\infty}^{\infty}\gamma_{xx}(k)e^{-j\omega k}$$

Which is the fourier transform of the covariance function:

$$\gamma_{xx}(\tau)=\hbox{Cov}[x(t)x(t-\tau)]=E[x(t)x(t-\tau)]-E[x(t)]E[x(t-\tau)]$$

As I understand, the Wiener-Khinchin theorem considers $R_{xx}(\tau)$

Can someone clarify why $\Gamma_{xx}(\omega)$ is a valid definition of PSD.

[1] Papoulis, A. (1965). Probability, random variables, and stochastic processes.

[2]  Jenkins,G. Watts,D. (1968), Spectral Analysis and Its Applications


texts: Why there is no $dxdy$ and $\Delta k_x \Delta k_y$ in MATLAB's $\tt fft2()$ & $\tt ifft2()$ functions?

texts:
In analytical 2D Fourier Transform, integrand is multiplied by $dxdy$. In algorithm of MATLAB function fft2(), this is not done.

In discrete case, $\Delta x = Lx/Nx$ and $\Delta y = Ly/Ny$ where $Lx,Ly$ are lengths in metres and $Nx,Ny$ are number of samples in $x,y$ directions.

Is it not correct to multiply by $\Delta x \Delta y$ after using fft2() for user function i.e. matrix ?

Similarly for ifft2() function in MATLAB, there is no $\Delta k_x \Delta k_y$ where $\Delta k_x = 1/Lx$ and $\Delta k_y = 1/Ly$

Any help will be appreciated.


texts: Where does $\frac{N}{2}$ came from in approximating an N-point DFT?

texts:
I've came across the author saying that

  ... for a real cosine input having k cycles in the N-point input time sequence, the amplitude response of an N-point DFT bin in terms of the bin index m is approximated by the sinc function $$X(m)=\frac{A_{0}\color{red}{N}}{\color{red}{2}}\cdot\frac{\sin[\pi(k-m)]}{\pi(k-m)}$$ where $A_{0}$ is the peak value of the DFT’s input sinusiod.

I have no idea where $\frac{N}{2}$ came from. I'm wondering if you can give me some hints.


texts: Rollercoaster: determining subject position from inertial data?

texts:
I have inertial data (accelerometer, gyroscope, magnetometer) from phones of human subjects riding a single rollercoaster repeatedly.

The ride has temporal variance (ex. sometimes getting from A to B takes 300ms longer)
Phones may have different initial orientations
Phones stay in the subjects' pockets, but jostle a bit

Using this data, I want to

Learn the "mean" rollercoaster ride

as a time series
as a sequence of significant rollercoaster events

On a new ride, in real-time, robustly determine where the subject is along the path so we can align music to their experience \m/
Bonus: 3D model the rollercoaster path

How do I do this?

  My guess:

  Low-pass-filter data to remove jostle/noise
  Something to normalize the different initial orientations in subjects' pockets
  Mark significant rollercoaster events by peaks in some kind of flux
  Some kind of Dynamic-Time-Warping?

  Some kind of Expectation Maximization?
  Test accuracy by splitting rides into training/test sets

  ?


texts:
I'll be recording a new dataset using a couple of sensors: kinect, stereovision cameras.. for a project for people detection using only depth information.

But I don't know yet how can I annotate the dataset, like in this dataset where they provide the boundary box.
I have only the sensors (no markers..) and I'll be recording a hundred of images..

Do you have any ideas how can I do that?


texts: Is there a closed form expression for noise other than white noise?

texts: For white noise, where the PSD is constant, we can model that as a simple Gaussian. Is there any way to model the probability density function of other types of noise (pink noise, red noise, blue noise, etc.), and if so, is there any way to derive such a thing?


texts:
Suppose that I am receiving RF signals contaminated with noise through antenna.
This signal is digitally sampled.
How can I understand the type of noise(Gaussian,Uniform etc).
Any algorithm is there to test the type of noise.


texts:
I'm using MATLAB and I'm trying to find the index of the first signal drop as shown in the figure bellow :

I tried the function findchangepts but it didn't give me the exact index, any solutions ?


texts: why the ultasound image is noisy by speckle noise?

texts:
My first question :

I want to know why an image is noisy ?.
why the ultrasound, SAR and Laser... images are noisy by a multiplicative noise not an additive noise?

Another question :

So the dominant noise in ultrasound image is  the Speckle noise, but the confusion in my mind is :

The speckle noise is of multiplicative nature, the mathematical writing is
$$f(x,y)=u(x,u)\eta(x,y)\tag{1}$$
where $f$ is the observed image, $\eta$ the noise and $u$ the dispeckle (recovered) image.

But in some paper (as this) the perturbed images with the speckle noise can write as :
$$f(x,y)=u(x,y)+\sqrt{u(x,y)}\eta(x,y)\tag{2}$$
and $\eta$ is with zero-mean Gaussian variable, the first constraint it must $u>0$ and then the model (2) is characteris of the Gaussian distribution, So this is the case of additive noise


texts: Power Spectrum Estimation of three sinusoids in white noise

texts:
Let's assume we have a random process consisting of three sinusoids in white noise:
$$x[n] = 3 \cdot \sin(ω_1 \cdot n + ϕ_1) + 5 \cdot \cos(ω_2 \cdot n + ϕ_2) + 2 \cdot \sin(ω_3 \cdot n + ϕ_3) + v[n]$$
where $ϕ_1$, $ϕ_2$, $ϕ_3$ are uncorrelated uniformly distributed random variables in $[0,2\pi]$

I want to estimate the power spectral density of $x[n]$. For that purpose I apply two different methods:

Periodiagram of $x[n]$
Welch method (Averaged Modified Periodogram) using Hamming window

I generated the following code and ran in Matlab:

N = 1024;
w1 = 0.3 * pi;
w2 = 0.6 * pi;
w3 = 0.7 * pi;
phi1 = unifrnd(0, 2*pi);
phi2 = unifrnd(0, 2*pi);
phi3 = unifrnd(0, 2*pi);
u = randn(1, N);
n = 0:N-1;
x = 3 * sin(w1*n + phi1) + 5*cos(w2*n + phi2) + 2*sin(w3*n + phi3) + u;

fig = figure;
plot(n,x);
title('signal x[n]');
xlabel('samples');
ylabel ('Magnitude');

fig=figure;
[p,f]=periodogram(x);
plot(f,p);

fig=figure
[pw,f]= pwelch(x, N/8, N/16);
plot(f,pw);

Which is the difference in these two methods about the resolution and the variance of the power spectrum ?


texts:
I have an image :

img = imread('pic.jpg');

Now, How can I get spectrum of that image?


texts: Calculating Affine Transformation matrix from 4 corner points

texts:
I'm trying to develop a sudoku solver, using image processing, ocr with neural networks and such. I've got the bare solver working, I can successfully interpret numbers and letters from a picture. All of this is done in GNU Octave. Now I am trying to make it more robust, and I've found this question on stack overflow which greatly helped with most of the image processing. But now I am left with the last part - transforming the single "squares" so that they are uniform and (mostly) square.
What I would like to have: A method that from one set of $(X,Y)$ corner coordinates, e.g.:$(73,86), (117,88), (70,127), (115,128)$ would transform the image with interpolation to the set of coordinates, e.g.: $(0,0), (50,0), (0,50), (50,50)$.

I have looked at the functions supplied with octave and there are these possibilities:

imperspectivewarp
imremap

but both of them require, for me to know the affine matrix.

Is there a thing I've overlapped with these functions, or could someone here point me in a direction to develop such a function?


texts: Difference between Fourier Transform and DFT? - Example

texts:
I have read many excellent answers to similar questions, but never one this specific.  Here is another way to ask it.

Why is the modulation transfer function (MTF) of $\textrm{rect}(x/5) = \textrm{sinc}(5x)$ not equal to the DFT of a vector of zeros with 5 ones in the center?

Relative MATLAB picture and code:

x = -512:511; x = x / 1024;
sq = zeros(1,1024); sq(511:515) = 1;
sqMTF = abs(sinc(x*5));               %'Modeled'
sqDFT = 1/5* abs(fftshift(fft(sq)));  %'Measured'

I can make the two curves overlay each other by multiplying the DFT result by $\textrm{sinc}(x)$, which I intuit should be related to windowing of the original signal and related spectral leakage.

But shouldn't this be a convolution in the frequency domain, as opposed to a multiplication?

Jack.


texts: Efficient real-time pitch detection algorithm

texts:
What is the most efficient pitch detection algorithms in terms of computation? I need something to implement on a DSP.
The typical signal in my situation would be a mixture of low-level wide-band noise plus a series of strong harmonics below 1000 Hz (think of the noise produced by industrial machinery or by car engines). The system needs to sample ("know") the current fundamental frequency of the signal every second or so.


texts:
My input numbers are close to 10, here is a sample of some:

9.259992,9.253408,9.322236,9.375503,9.406026,9.507771,9.509567,9.403034,9.397048,9.36054,9.265977,9.262985,9.216302,9.228272,9.338395,9.430565

I am using this PHP library
thinkingmik/FastFourierTransformation

My peak numbers in response are about 500. A control which was done using another tool is 1-1.5

FFT is well over my head, so I am trying to read this library to get a bit of an idea, but can't figure this out. The interesting thing is the client says the chart seems to be correct, just numerical values are wrong.


texts: If a signal's amplitude has a uniform PDF, which is better in the sense of producing a smaller quantization error: optimal scalar quantization or quantization with compressor (non-uniform quantization)?


texts: Digital beamforming and phase shift stage insertion

texts:
I have read some literatures about the different topologies of beamforming and it came to my mind a question : where is applied the phase shift for each channel depending on the type of topology/technology used?

For analog beamforming, it is obvious as there is only one signal, the modulated carrier signal which is splitted to the different channels and phase shifting occurs afterward. The phase shifting stage comprises a gain/attenuation stage and a phase shifter stage. If the modulated signal is built by a digital stage, there is one DAC used for all channels prior to mixing and phase shifting.

In digital beamforming, the topology is a bit different: one DAC is used for each channel. This enables more possibilities, among them the possibility to phase shift digitally each channel when defining the modulation. However two types of digital beamforming exist:

one with LO mixing if the DAC is not fast enough to produce a RF signal,
another using RF-DAC where no LO mixer is required.

As in the first situation LO signal is generally the same for all channels, no phase shift is applied on LO-IF signal. Is the phase shift on IF modulation signal is enough or is it needed to phase shift the signal after mixing (to obtain an equivalent behavior as in analog beamforming?).

Best regards


texts: Phase correlation vs. normalized cross-correlation

texts:
I asked this over at Mathematics Stack Exchange, but since this sort of lies on the border of the questions normally asked over there and the questions you see over here I'll ask it here as well. (As of now, there's been no activity on my question over there.)

In 2-dimensional discrete signal analysis (specifically image processing), a definition I found for the normalized cross-correlation between two images, both of size $M\times N$ $g_1(x, y)$ and $g_2(x, y)$ is:

$$r_1 = (g_1 \star g_2)(x, y)_{\rm Normalized} = \frac{\sum\limits_{m=0}^{M-1} \sum\limits_{n=0}^{N-1}\left[g_1(m, n) - \overline{g_1}\right]\left[g_2(x + m, y + n) - \overline{g_2}\right]}{\sqrt{\sum\limits_{m=0}^{M-1} \sum\limits_{n=0}^{N-1} \left[g_1(m, n) - \overline{g_1}\right]^2 \left[g_2(x + m, y + n) - \overline{g_2}\right]^2}}$$

This is supposedly performed by the function normxcorr2 in the Signal Processing Toolbox in MATLAB, although using the Fast Normalized Cross-correlation algorithm by J. P. Lewis. Compared to the Phase Correlation method (with normalized cross-power spectrum) suggested by Kuglin and Hines:

\begin{align}
G_1(u, v) &= \mathcal{F}\left\{g_1(x, y)\right\}\\
G_2(u, v) &= \mathcal{F}\left\{g_2(x, y)\right\}\\
r_2 &= \mathcal{F}^{-1}\left\{\frac{G_1^\ast (u, v) G_2(u, v)}{\lvert G_1^\ast (u, v) G_2(u, v) \rvert}\right\}
\end{align}

Without the element-wise normalization before the inverse Fourier transform, $r_2$ is the same as non-normalized cross-correlation, with the exception that the Fourier transform assumes that the signal repeats in the spatial domain. It is clear that $r_1 \neq r_2$ by looking at the resulting correlation "images" in MATLAB, which I expected, but $r_2$ almost seems discontinuous from the images I am testing the method on, while $r_1$ always turns out much smoother (the resulting $r_2$ images are always "spotty", $r_1$ are not). Why is this? I assume it has something to do with the element-wise normalization in the Fourier domain, which I suppose is basically like cropping the signal in a way, but I don't know how to conclude this from any known properties of the (inverse) Fourier transform, if this is even a correct assumption.

Here are examples of the differences ($r_2$ has been amplified to clearer show the difference in characteristics of the images). They are performed on the same 2 images.

$r_1$: Normalized cross-correlation

$r_2$: Phase correlation

Summarizing my question: Why is $r_2$ so "spotty", while $r_1$ is not?


texts: Obtaining an expression for the transfer function when using FFT

texts:
Say I have two signals, a(t) and b(t) where the former is the input and the latter in the output. These signals are both recorded by sampling at every 0.01s. The Fast Fourier Transform was applied to both of these providing me with two large arrays of complex numbers. The FFT of b was divided by the FFT of a to provide me with a new array of complex numbers. This was plotted as can be seen below:

Where x axis is real any y axis is imaginary.

How would one go about producing a closed form type polynomial for the transfer function of such a system?

Edit: Inverse FFT of the above. Complex components were of the order e^-14 and thus rounded to 0.


texts: MR Segmentation to draw marker over the MR Dicom Images

texts: I am doing R&D over the MR Segmentation to draw marker over the Heart MR Dicom Images. My Question is that how I can draw a such marker over the dicom image that show in attach/link image. that Region of Interesr ROI read from the tag or its part of Pixel Processing.


texts:
Signal

x(t) = | cos(2πft)|, f != 0

is the input of an ideal band-pass filter  with bandwidth B = 3f/2.
How can i Find the Output of the y(t) of the signal.


texts: How to convert single output of microphone into multiple values for using fft?

texts:
i am trying to make a real time audio spectrum display.
My problem is microphone gives an single analog output, but to apply fft we need atleast 8 inputs to fft. how can i convert a single input from microphone to  atleast 8 values for using fft??????


texts: How many samples per cycle(time period) is actually enough to reproduce the sine wave sound properly?

texts:
I have been working on Active Noise Cancellation in real time for Air vent in kitchen.
Initially for the demonstration purpose, I am using sinusoidal sound ( 40k Hz Fs,1000 samples, 2 kHz frequency, 1 Amplitude). I am using simple LMS Algorithm initially to test this, I could produce the anti noise with the same frequency and amplitude but because it is a real time application, I could be able to produce the sine wave with 30-31 samples per each cycle of sine wave.

The problem is the sound coming through the noise cancelling speakers is not good compared to the source noise, there is some buzz noise coming in addition (kind of background noise). This could mainly be because of distortions in speaker, I don't have any idea how to control this !!
But I am thinking this may be could be because of very less number of samples that I am using for Cancelling speaker.May be the reproduction of the noise is not so good because of less number of samples.

So my question is how many samples per cycle are ideally required for good reproduction of sine wave sound??


texts: Finding the fundamental period by using four elementary operations (+,-,x,/)

texts:
The idea is to find the fundamental period of any periodic and bounded signal. This is all that we know about the signal. Nothing else. Only allowed operations are: $+,-,\times , \div$. We can also access any value of the signal that we desire.

How can a method be developed which finds or estimates the fundamental period of the given signal?

Thank you in advance.


texts: Autocorrelation Lag In Seconds Explanation?

texts:
I am using a MatLab audio feature extraction toolbox (MIRToolbox), and I am in the process of cross correlating an onset curve (envelope).  I am aware of what the lag means when using Matlab's xcorr function since you normally pass in indices, but I am struggling to work out what the lag means when referred to in seconds on the x-axis.

According to the user manual, it has a minimum time of 0.2(s) and a maximum of 2(s) with onset envelopes.  Does this mean it only cross correlates for 2 seconds?  Its just that I have experimented with a 10(s), 30(s), and 3+(mins) edit of an audio file, and the plot is always showing 3 peaks, and looks more or less the same.


texts:
I am trying to simulate a simple stochastic process defined by the equation:
\begin{equation}
\frac{1}{v}\frac{db}{dt} +\Gamma_0 b= \sqrt{\sigma}R(t),
\end{equation}
where $R(t)$ is a zero-mean white noise (delta-correlated in time), and $v$, $\Gamma_0$ and $\sigma$ are all real positive parameters. I am simulating this using an Euler-mayurama scheme, namely
\begin{equation}
b(t+\Delta t) = b(t) -v \Gamma_0 b(t) \Delta t + v\sqrt{\sigma} \sqrt{\Delta t} N(0,1),
\end{equation}
with $N(0,1)$ being a standard normal random number, for a finite interval $t\in [0,T]$. I am trying to compute the power spectral density using the Wiener-Khintchine theorem
\begin{equation}
S[f] = \int_{-\infty}^{\infty} e^{-2\pi f\tau} \left\langle b(t)b^*(t+\tau)\right\rangle d\tau,
\end{equation}
from the autocorrelation function $\left\langle b(t)b^*(t+\tau)\right\rangle$. Analytically I can compute this and it gives me
\begin{equation}
S[f] = \frac{v\sigma}{2\Gamma_0}\frac{2v\Gamma_0}{(v\Gamma_0)^2 + (2\pi f)^2},
\end{equation}
But when I try to compute the same numerically, my function looks completely different. Am I implementing this correctly? (see Matlab code below)

%% Autocorrelation test
close all; clear all; clc;

% Inputs
dt = 1e-3;
T = 2;
tv = 0:dt:T;
Lt = length(tv);

v = 3.5;
Gamma0 = 20.3;
sigma = 0.75;
a = v*Gamma0;

% Frequency spectrum properties
Fs = 1/dt; % (Hz) sampling frequency, based on Ben's paper

sims = 1; % number of simulations
U_Walks = zeros(Lt,sims);
for nn = 1:sims
    b = zeros(Lt,1);
    for ii = 1:Lt-1
        b(ii+1) = b(ii) - v*Gamma0*b(ii)*dt + ...
            v*sqrt(sigma)*sqrt(dt).*normrnd(0,1);
    end
    Rxx(:,nn) = xcorr(b);
    U_Walks(:,nn) = b;
    disp(nn);
end

%% Stats
LR = length(Rxx);
N = 2^nextpow2(LR);
Y = fft(Rxx,N); % Taking only one side of the y-axis symmetric FFT
Y = Y(1:N/2+1);
mY = (Y).^2/N;
F = Fs*(0:(N/2))/N; % calculating the frequency range for the x-axis

S_f = 10*log10(mY);

S_f_analytic = 10*log10((v*sigma/2/Gamma0.*(2*a./(a^2 + (2*pi*F).^2))));

%% PLOTS
close all;

figure('units','normalized','outerposition',[0 0 1 1])
set(gcf,'Color','w');
plot(F,S_f,'r',F,S_f_analytic,'b','LineWidth',3);
legend('Numeric','Analytic');
title(['PSD']);
xlabel('f (Hz)'); ylabel('S[f] (dB)');
set(gca,'FontSize',20);


texts: About speech preprocessing in mobile phones

texts: I understand that cell phones transmit speech signals in digital form through 2G/3G or other standards. But I could not find anything about the signal processing method lying in between the analog signals captured by the microphone and the final digital signal (which I think is not the complete speech signal but a reduced form) that is modulated over the respective modulation scheme. Is there any compression algorithm or some enhancement algorithm before the modulation stage?


texts: On the time-frequency relationships of median filters

texts:
I'm applying Matlab's median filter to a data sequence and I'm trying to figure out what filter co-efficients of a linear filter this corresponds to.

Would the normal time-frequency relationship that exists for linear filters maintain itself for the median filter?


texts: What are the most common algorithms for adaptive thresholding?

texts:
Adaptive thresholding has been discussed in a few questions earlier:

Adaptive Thresholding for liver segmentation using Matlab

What are the best algorithms for document image thresholding in this example?

Of course, there are many algorithms for Adaptive thresholding. I want to know which ones you have found most effective and useful.

Which Adaptive algorithms you have used the most and for which application; how do you come to choose this algorithm?


texts:
I'm trying to plot the phase of this signal $s(f)=A^2T^2sinc^2(Tf)e^{-(j\pi Tf)}$
How can I plot manually this signal?I have to follow some particular rules?I have problems with the delay.

Edit

After calculation I found that the phase for this signal is: $\phi(s(f))=-\pi Tf$

it should be this the plot. Right or not?

I plot it for $T =3$


texts: High audio frequencies in television broadcast

texts:
I would like to know if in television broadcast high end audio frequencies are transmitted e.g. frequencies higher than 14 kHz. What is the cut off audio frequency of transmission in television broadcast?

I am preparing a report (for research) characterizing audio frequency response of various devices e.g. iPhones, Samsung Galaxies, various televisions. While doing this, I got curious about the spectrum output of television. Given a piece of Audio for broadcast transmission, how it's spectrum get altered? At what frequency there is cutoff and specially can the cutoff be below ~20K, the human audible range?

Broadly my interest is in knowing what happens to an audio given to a broadcasting channel and by the time it arrives as an input to a television.

Thanks.


texts: Time-spread multiple echoing of audio signals

texts:
I have been reading papers related to adding echos into digital audio signals recently. I guess I understood the logic behind, yet I guess I am still having lack of DSP knowledge to figure out everything.

In order to add a single echo delay $\Delta$ into audio signal $S$ using convolution operator, echo kernel $k(n)$ is defined as:

$$ k(n)= \delta [n] + \alpha \cdot \delta [n-\Delta]$$

where $\delta [n]$ is Kronecker Delta Function, and $ 0 < \alpha \ll 1.$

Echoed sound signal $S'$ calculated using convolution operator "$*$" as:

$$S'=S \ * k(n)$$

I have no problems until this part. My question is based on this publication, [Ko, Nishimura, Suzuki - 2005]. It is based on echo data hiding for audio watermarking (steganography), but a very good source to understand sound echos. Authors say that multiple echos provide better quality for HAS than single echos (see Fig. 1.)

A pseudorandom sequence is generated to spread multiple echos in time. I generate it in MATLAB with the following code:

rand('seed', key);         % set seed of random sequence
a = rand(length, 1);
prseq = (a > 0.5)*2-1;     % convert into -1 and +1

In next step, time-spread echo kernel is defined using PN Sequence as: (see Fig. 2.)

$$ k(n)= \delta [n] + \alpha \cdot P[n-\Delta],  0 < \alpha \ll 1 $$

Schemetic explanation is made in Fig. 3. below:

I tried this tecnique in MATLAB and I actually have two questions:

Audio signal is being corrupted when the number of echos increases no matter how small $\alpha$ value is chosen. In the same article length of PN Sequence is chosen as $1023$, and delay = 1 ms which is about 44 samples in 44.1 kHz audio signal. So how is it possible to provide "a real room" echos as it is said in the article? Do I miss anything?

I am adding my summarized MATLAB codes:

delta = 44;
alpha = 0.02;

% Single echo kernel
for n=1:delta+1
    k_single(n) = kdelta(n-1) + alpha*kdelta(n-delta-1);
end

% Time-spread echo kernel without using kronecker delta:
kernel = [1 zeros(1,delta-1) alpha*prseq'];

echoed = conv(audio_data, kernel);

function [ out ] = kdelta( x )
    out = double((x==0));
end

Alternatively:

single_echo = signal + alpha*[zeros(1,delta) signal(1:length(signal)-delta)];

I was adding echos in an audio signal by shifting and adding as I mentioned above "alternatively". I figured out that it would take so much time to use it for multiple echos, so I thought I had to use convolution. But conv(x,y) function in matlab changing data size up to length(x)+length(y)-1 according to definition of convolution. Is it a good idea to just to crop it like echoed(1:length(audio_data)) to keep the length fixed? What is best option to accomplish multiple echoing as fast as possible and using less memory?

Excuse me for such a long question. I wanted to explain my problem in details, so it made my question longer.

Thanks in advance.


texts: How to determine the power of a finite signal?

texts:
I am trying to write mathematically how to calculate the power of a finite signal. I know the general formula $P_{\mathrm{x}}=\lim_{T\to\infty} \frac{1}{T} \int_{t=0}^{T} x^{2}(t) \mathrm{d} t$ used to calculate the power of a signal which has infinite Energy and finite power. But how do you express it when the does not go to infinity, is not period and does not have infinite energy?

I know its a basic but i have searched all over and have not been able to find a proper answer.

Thanks in advance.


texts: Morlet wavelet: DFT vs Fourier Transform

texts:
I find what seem to be contradictions between the two. "Morlet" defined here, and its Fourier Transform (FT) below it.

DFT's imaginary component zeroes with large N, but real part still doesn't turn into a bell
$\mathcal{F}(\text{Morlet})$ seems to be the magnitude of the FT, but off in amplitude.

Code: Python -- MATLAB/Octave


texts:
I'm looking at last year's exams, and I found an exercise I can't solve:
(Roughly translated)

Consider $x(t)=\sum\limits_{k=1}^{+\infty}\left(\frac{1}{2}\right)^k \cos(k2\pi t)$ the input to a LTI system, with the transfer function shown in the picture below

a) Determine (and sketch) the Fourier transform of x(t) and y(t).

b) Determine the Fourier coefficients of y(t). Justify.

Edit:

The only thing that comes to mind is using the Linearity of the Fourier Transform and calculate the Transform of $\left(\frac{1}{2}\right)^k \cos(k2\pi t)$, k dependant, and $X(jw)=\sum\limits_{k=1}^{+\infty}X_k(jw)$, so it would be something like
$$
X(jw)=\sum\limits_{k=1}^{+\infty}\left[2^{-k}\pi\left[\delta(\omega-2k\pi) + \delta(\omega+2k\pi)\right]\right]
$$

However, I have never seen a Fourier Transform that looked like this, so I'm not quite sure that's correct, or, if it is, if it can be used (efficiently) for calculations, in this form.

After I get $X(jw)$, I can get $Y(jw)=X(jw)H(jw)$, so right now I'm pretty much just stuck in calculating $X(jw)$. Any help is much appreciated, and feel free to ask for clarification, if something I wrote is not clear enough.


texts:
I'm looking for a suitable measure in order to quantify the asymmetry of a signal. I've read this: Detect signals degree of imbalance and this: How to measure the agreement between to curves? but I can't see how they apply to my case.

So this is the part of the signal that I am interested in:

The red line shows the original signal and the black line shows the right part of the signal mirrored about the time=0 axis. What I need to do is find a way to quantify the asymmetry of the red line, i.e. a measure of its difference from the black line.

What I have tried doing is taking the square root of the sum of the squares (SRSS) of the differences of each point. That is:

$$
SRSS = \sqrt{\sum\limits_i (y_{black,i} - y_{red,i})^2}
$$

Unfortunately, this measure is affected by the number of points that I take for each curve. So for example if the resolution is half, SRSS will decrease even if I'm comparing the same lines.

Is there any other measures of asymmetry that you can suggest? Ideally, they should be a single number and not be affected greatly by the resolution of the lines.


texts: What happens when the poles of this z-transform function are outside the ROC for a signal?

texts:
I am given a z-transform function for a signal $h[n]$. It's $H(z)=\frac{2z^2-0.75z}{(z-0.25)(z-0.5)}$. I am supposed to find $h[n]$ and check the stability of the system for these cases:
a)ROC: $|z|>0.5$
a)ROC: $|z|<0.25$
a)ROC: $0.25<|z|<0.5$

I found $h[n]$ for the general case to be:
$H(z)=0.5z^{-1}\frac{z}{z-0.5}+0.25z^{-1}\frac{z}{z-0.25}$
$h[n]=(0.5)^nu[n-1] + 0.25^nu[n-1]$
The poles of a function are $0.5$ and $0.25$
The first case is when ROC: $|z|>0.5$. That would mean that i have a circle with radius $0.5$ on the graph on which the causal signals are the ones outside the circle because those values of $z$ make the signal (or a function) converge and anti-causal ones inside the circle. Yet the answer in the book is:
a)$h[n]=(0.5)^nu[n] + 0.25^nu[n]$ and the system is stable. Shouldn't it diverge for the $0.25$ part?
Also when b) ROC: $|z|<0.25$ the answer in the book is:
b) $h[n]=-(0.5)^nu[-n-1] + -0.25^nu[-n-1]$ and the system is unstable.
I could understand this as now the inside of a $0.25$ radius circle is causal and since pole 0.25 is on the circle and 0.5 is outside the circle the $u[n-1]$ is transformed to $u[-n-1]$ to make it causal, but why does the factor $0.25$ and $0.5$ change signes? I will also write down the solution for the c) part:
c) $h[n]=-(0.5)^nu[-n-1] + 0.25^nu[n]$
Can anyone explain these solutions as i'm confused about the whole ROC involvement in these solutions particular.


texts:
can someone explain what a difference is between phase and frequency shift/offset in estimation algorithm?
Honestly I dont understand this difference. If i estimate , i will do it for phase estimation.
EDIT 1 What is a difference in an implementation of FLL and PLL?


texts: Under what conditions is the convolution of an input signal with the system's impulse response periodic?

texts:
I'm currently solving the following convolution problem from Oppenheimer's book:

In the solution, it was stated that "$x(t)$ periodic implies $y(t)$ is periodic"
So I wondered if it's always the case that if $x(t)$ is periodic then so is the output from the convolution, I tried doing research about this in hope of finding any supporting evidence to this but I couldn't, and "circular convolution" is all around the place.


texts: Baseband Signals have zero imaginary component

texts:
I was revising a few basics on communication systems and I stumbled upon this line that I thought was incorrectly articulated.
I thought that baseband signals were complex and passband signals were real.
If $x_z (t)$ is the baseband signal with in-phase component $x_I (t)$ and quadrature component $x_Q (t)$ such that $$x_z (t) = x_I (t) + j x_Q(t)$$ then passband signal is $$x_c (t) =\sqrt{2} Re(x_z (t)e^{2\pi f_c t})$$ which would imply that baseband signals may have non zero imaginary component and passband signals cannot have non-zero imaginary component.
But still the following statement from the book(Fundamentals of Communication System by Michael P.Fitz Chapter:Digital Communication Basics) seems to say it the other way around:

The only caveat that needs to be stated is that baseband data
communication will always have a zero imaginary component, while for
bandpass communication the imaginary component of the complex envelope
might be nonzero.

Is this statement incorrect or am I misconstruing it somehow?


texts: High pass filter not attenuating signal at start of input

texts:
I have implemented digital high pass filter with below specs:
Sampling frequency = 5333 Hz
Cutoff frequency = 10 Hz
Order = 3

We are facing problem like below:
As per result shown above signal gets attenuation after $1000$ data points. How can solve this kind of issue?
Any help/ suggestion would be great and appreciable! Thanks in advance.


texts: If two signals (not vectors)  are orthogonal, prove they are independent.


texts: describing a block diagram // How do I describe multiplying a signal through multiple branches formally?

texts:
Let's say I made this block diagram and I want to explain it:

FYI: $x$ is a signal and each $y$ box is a matrix

I want to say that:

The signal $x$ is multiplied by each matrix $y$ in the different branches independently to produce
$f_0=xy_0$

$f_1=xy_1$

...

$f_m=xy_m$

I want to ask the experts in the signal processing world if this is formal enough? or am I sounding weird?

Edit 1:

What if I said:

The signal $x$ is multiplied by a set of matrices $y_k$ where $k = 0,1,..., m$

does it sound better? or would it imply that $x$ is multiplied like: $x*y_0*y_1*...*y_k$

which is NOT what I intend to say


texts: Plotting frequency spectrum for a signal with 20MHz bandwidth and sampling frequency of 12.5GHz

texts:
I am new to Matlab and I am trying to plot the frequency spectrum of an OFDM signal with bandwidth of $20 \text{ MHz}$ and DAC sampling rate of $12.5 \text{ GHz}$. The number of samples is $400,000$. Plotting the signal I am only able to see the Nyquist bandwidth but not the $20 \text{ MHz}$.

I would appreciate any help. Link to the data file.

Here is the frequency spectrum plotted via Matlab :

Below are my line of codes:

 BW = 20MHz;
 f_DAC = 12.5GHz;
 Nfft = 32;
 Sig_fft = abs(fftshift(fft(Data_signal)/length(Data_signal))).^2;
 Freq = ((0: length(Sig_fft)-1)-length(Sig_fft)/2)*(f_DAC/length(Sig_fft));
 figure();
 plot(Freq, 10*log10(Sig_fft/1e-4));
 title('Signal Spectrum');


texts: What will be the code for this following signal in MATLAB?

texts:
I was trying to generate a signal like this:

I have done this so far like this:

clc;
clear all;
close all;
t = 0:.1:10;
f=.5;
y=.2*sin(2*pi*f*t);
plot(t,abs(y));
axis([0 10 -2 2]);
grid on;

What can I do to get desired output?


texts: Sampling frequency and oversampling factor

texts:
A quite naïve question. I need some clarification regarding choosing the sampling frequency and oversampling factor. The scenario is as follows:

I have an OQPSK modulated sequence with symbol rate 2 M Symbols/sec. In order to transmit this through an AWGN channel, I am trying to half sine pulse shape this modulated sequence. I have read from a couple of online resources that before pulse shaping the sequence should be oversampled. I am currently confused by the factor that I need to oversample the sequence.

Regarding the sampling frequency, at Baseband I am confused as to what I should take as the sampling frequency. I assume that at passband of 2.4 GHz, I am considering the sampling frequency of 6 GHz but I am not sure if this is right and how should I decide on the sampling frequency if I do not consider the passband and just the baseband frequency.


texts: Is there any Spread Spectrum system that uses Rake with cyclic Prefix?

texts:
My question is that could the use of cyclic prefix can enhance the performance of Rake receiver ?

I find this proposal here CP for DSSS Rake Receiver that seems correct.

Without CP, ISI emerges and stays as interference in Rake finger.

With CP, no ISI.

The cost could be an overhead of transmission. But if I take a typical value of delay spread 5µs (ETU channel model) with UMTS SF = 256, the symbol duration is roughly SF/3.84Mcps = 256 / 3.84e6 = 66,66 µs. The cost 5/66.66 = 7.5% is acceptable ?

If the reason is not the overhead cost, is there any reason ? Or Rake receiver performance is not impacted by adding CP thanks to its pilots ?


texts: Converting a pitch bend (MIDI) value to a "normal" pitch value

texts:
I am trying an offline LPC analysis and synthesis using the rt_lpc (real-time LPC) implementation as given here. There are some functions within the program that can be used for an offline LPC analysis and synthesis program. The rt_lpc code is mostly meant for composers etc., which means that it uses a MIDI or glottal pulse input. There is some code in the program that converts a pitch value (obtained from auto-correlation) to the bend value. The relation is given as follows:

    pitch = (int)( Stk::sampleRate() / midi2pitch[ananya.data[1]] ) /
                            pow( 1.0653f, bend/64.0f*11.0f );
                    power *= ananya.data[2] / 64.0f;
bend = ge.data[1] / 128.0f + ge.data[2] - 64;

Some points:
a. ananya is an object of type MidiMsg that seems to be populated on the fly.
b. ge is also an object of type MidiMsg that also seems to be populated on the fly.
c. These two objects are created when the program is run in real-time (mine is an offline version that runs selective parts of it in a main.cpp of my own.

My question(s):
1. What is pitch bend?
2. How do I convert a pitch value into a bend value? What are the mapping relations?

I have googled for solutions but found no clear answer.


texts: Is it possible that the value of a continuous mother wavelet at origin is zero, i.e. $\psi(t=0)=0$?

texts:
According to Fourier transform, a continuous wavelet could be written as
$$
\psi(t)=\frac{1}{2\pi}\int\hat\psi(k)\text{e}^{-ikt}\text{d}k
$$
From the equation above, we know that $\psi(t=0)$ is
$$
\psi(0)=\frac{1}{2\pi}\int\hat\psi(k)\text{d}k
$$
Is it possible that  $\psi(0)=0$?


texts: Frequency analysis : relation between FFT size and sampling

texts:
I am currently trying to perform an experiment given an audio signal. I am therefore sampling the audio frequency range (0 to 22kHz) with a 48k sampling rate.

When performing a FFT on my signal, I had the following question :

Is it equivalent to have a very small FFT size (for example 256), producing a 172 Hz resolution on my signal, in comparison with having a large FFT size (in a way more bars..) and performing a mean on my resulting frequencies in order to bring the number of bars down?


texts: Determine the Z-Transform for the following sequence: $ |n|(\frac{1}{2})^{|n|} $

texts:
Determine the Z-Transform for the following sequence:

$$ |n|(\frac{1}{2})^{|n|} $$

I have tried to solve the above problem. However, the answer that I got is the negative of what is given in the solution manual. What I may have done wrong?

SOLUTION FROM SOLUTION MANUAL:


texts: Notation of an LTI system consisting of LTI filters

texts:
I would like to find a reference for two notations of an LTI system consisting of LTI filters. In z-domain, the LTI system is given by

$$
 \mathbf{y}(z) = \mathbf{C}(z) \mathbf{s}(z) + \mathbf{D}(z) \mathbf{x}(z) \\
 \mathbf{s}(z) = \mathbf{A}(z) \mathbf{s}(z) + \mathbf{B}(z) \mathbf{x}(z) ,
$$
where $\mathbf{x}$ and $\mathbf{y}$ are the input and output of the system, respectively and $\mathbf{s}$ is the system state. The matrices $\mathbf{A}$, $\mathbf{B}$, $\mathbf{C}$ and $\mathbf{D}$ constist of LTI filters, e.g.,
$$
A_{ij}(z) = \frac{b_0 + b_1 z^{-1} + \dots + b_k z^{-k}}{a_0 + a_1 z^{-1} + \dots + a_k z^{-k}}.
$$
Now, each LTI filter can be represented by its impulse response in time domain. Let the matrices $\mathbf{A'}(n)$, $\mathbf{B'}(n)$, $\mathbf{C'}(n)$ and $\mathbf{D'}(n)$ with $n$ indicating time such that e.g.
$$
A'_{ij} = [a'_0, a'_1, a'_2, \dots ]
$$
is the impulse response of the LTI filter $A_{ij}(z)$.

Is it then possible to rewrite the whole LTI system in time-domain as
$$
 \mathbf{y}(n) = (\mathbf{C} \ast \mathbf{s})(n) + (\mathbf{D} \ast \mathbf{x})(n) \\
 \mathbf{s}(n) = (\mathbf{A} \ast \mathbf{s})(n) + (\mathbf{B} \ast \mathbf{x})(n) ,
$$
where $\ast$ denotes the convolution operation. I would especially appreciate any reference to literature / text books where this representation is discussed.

An one-dimensional example:
The state-transition matrix may be a (time-invariant) one-pole filter, e.g., $\mathbf{A}(z) = \frac{b_0}{1 - a_1 z^{-1}}$. The corresponding time-domain $\mathbf{A}'(n)$ is the impulse response of this one-pole filter.


texts: How does viola jones algorithm cope up with a test image size which is very different to training image sizes?

texts:
To my understanding Viola jones algorithm is a combination of weak classifiers built on training imageset. Lets say we have training images of 24x24 and algorithm selected 100 haar features and built a classifier. Assume there is a test image which is of size 512x512 and there two persons(just faces) in the image one person(100x100 size in 512x512) closer to the camera and the other(10x10 size in 512x512) at a distance.

How does viola jones detect faces detect both persons having learnt
features      features for faces that fit in 24x24?
Is the algorithm implemented in libraries in such a way that haar
features vary depending on the size of the image


texts: Matlab : Help in getting the correct constellation diagram for QAM modulation

texts: I would like to see the constellation diagram after equalization as shown in the website Correct constellation for QAM. But I am getting a different plot. Can somebody please tell me where I am going wrong?


texts: Timing error detector used for symbol timing synchronization

texts:
The Gardner timing error detector is independent of carrier phase and frequency error, and is also quite immune to self noise (to my understanding, I may wrong about that). Can one assume that it is a recommended  timing error detector for these reasons?
Please if the answer is going to be "it depends on your system" with no further brief input/explanation , then abstain please.


texts:
Given that 30GHz to 300GHz is considered mm wave spectrum which can be used for high-speed wireless communication such as 5G.
My question is how to calculate the wavelength if we know the frequency? I suppose we have to know the wavespeed as $ \lambda = v / f $
But do you know where to get wavespeed reference in telecommunications?


texts: State Estimation by steady state Kalman Filter

texts:
I am working with a discret Kalman filter on a System

$x_{k+1}=A_k x_k+B_k u_k+\omega_k$

$y_k=C_k x_k+\upsilon_k$

$E[\omega_k\omega_k^T]=Q$

$E[\upsilon_k \upsilon_k^T]=R$

I have estimated the State from the available noisy $y(k)$, which is generated from the same system state equations with Reference Trajectory of the state. Then I have tested it with a wrong initial state $x_0$ and a big initial covariance (simulation 1). I have noticed that the KF works very well, after a few steps the gain $K$ quickly converges to a very small value near zero. I think it is maybe caused by the Process noise $Q$. I have set it small because the $Q$ stands for the accuracy of the model.

Now I want to modify it to a Steady State Kalman filter. I used the steady gain from simulation 1 as constant instead of the calculation in every iteration. Then the five equations can be simplified to one equation:

$\hat{x}(k+1)=(I-KC)A \hat{x}(k)+(I-KC)B u(k)+K y(k+1)$

I want to test it with same initial state and covariance matrix as the one in simulation 1.
But the result is very different from reference trajectory, and even the result of simulation 1.
I have tested it with the covariance matrix $p_\infty$, which is solved from the discret Riccati equation. And the use the equation:

$k_\infty=\dfrac{p_\infty C'}{C p_\infty C'+R}$

This neither works. I am wondering:

How should I apply Steady State Kalman Filter and how should I set the initial state for it?
Is Steady State KF only used for scalar system?
Should I use it with LQ-controller or some others?

Eddit

I want to compare the performence between standard Kalman filter and steady state Kalman filter like this:
firstly, I set a wrong Initial State: $X_0=[5, -6, 0]^T$ but in fact it should be $X_0=[0, 0, 0]^T$. And I set the $P_0$ like a diagonal Matrix, on the main Diagonal are $25, 36, 0$. I get the steady gain $k_\infty$ and  $p_\infty$ from solving the discret Riccati equation

$P_\infty=AP_\infty A^T-(AP_\infty C^T)(CP_\infty C^T+R)^{-1}(CP_\infty A^T)+Q$

This can be solved by using Matlab Toolbox. I adjust the Koefficient $Q$ ($R$ is constant and available) until the "real" Kalman gain same as $k_\infty$ and at the same time standard Kalman filter works well. Then I think $Q$ in this time the best one. The result is good

And now I don't know, how to set the parameter in steady state Kalman filter.
I set  $X_0=[5, -6, 0]^T$ and $R$ same as ones in the standard kalman filter and use $k_\infty$ as constant Kalman gain. But it works with same parametmer not well.

I like to know, what's wrong with my design.
The plot is below:


texts: 4th order butterworth filter using frequency response formula

texts:
I know this may be a kind of basic question, but I have my head wrapped over it for some time and hadn't found a solution.
I want to generate the frequency response of a 4th order butterworth filter programatically for a given sampling rate and cutoff frequency. I've used the matlab filter response and my filter code response to compare. In my code i've used:

$$
H(j\omega )=\frac{1}{(1-3.4142136\hspace{1.2mm}\omega^{2}+\omega^{4})+j2.613126(\omega - \omega^{3})}
$$

And got a close comparison between the two. What am I missing to make my code response like the matlab one? adjust the even function symmetry on the magnitude and odd function symmetry on angle at nyquist frequency and rolloff of both using the H(jw) programatically.

Here is my matlab code and results

clear all;
clc;
n = 4;
fs = 100;
t = 1:1:100;
lo = 35;
in = ones(1,length(t));
in = ifft(in);
[b,a] = butter(n,lo/(fs/2),'low');
outA = filter(b,a,in);
outB = ones(1,length(t));
for x = 1:length(t)
    wl = x/lo;
    outB(x) = (1/((1-3.4142136*(wl^2)+(wl^4))+(2.613126*(wl - wl^3))*1i));
end
fourierabsA = abs(fft(outA));
fourierabsB = abs(outB);
fourierangA = angle(fft(outA));
fourierangB = angle(outB);
subplot(2,2,1);
stem(t,fourierabsA);
title('Matlab Filter Magnitude')
subplot(2,2,2);
stem(t,fourierabsB);
title('My Filter Magnitude')
subplot(2,2,3);
stem(t,fourierangA);
title('Matlab Filter Angle')
subplot(2,2,4);
stem(t,fourierangB);
title('My Filter Angle')


texts: Impulse response from difference equation without partial fractions

texts:
I have a system with input $x[n]$ and output $y[n]$, described by the difference equation

$$y[n] - 0.3y[n-1] + 0.1 y[n-2] = 3x[n] - x[n -1]$$

and I am trying to find the frequency and impulse responses. The frequency response I found was

$$H(e^{jw}) = \frac{3-e^{-jw}}{1 - 0.3e^{-jw} + 0.1e^{-j2w}}$$

but I am having trouble  converting this to $h[n]$ because the denominator can't be factored using partial fractions.

Also, I tried using the recursion method to find $h[n]$ but I am unsure whether the system is causal or not, so I don't know where to start for the recursion. Could anyone give me some tips on what to do next?


texts: Algorithm for implementing an IIR digital filter, Chebyshev type I low pass

texts:
I am trying to implement a Chebyshev type I low-pass IIR digital filter in C. I have got the SOS Matrix and scale values from Matlab.

What is the direct equation or algorithm to implement such a filter?


texts: What is the difference of windowing functions for FIR filtering?

texts:
What is the difference of window types such as Hann, Rectangular, Hamming in the application. Is there such a thing that the one is better than the other?

There will be an oral exam for DSP course so I want to understand this concept. I know that they have different windowing functions and also different time&frequency domain responses. Moreover, their parameters (such as main lobe width, side lobe width) are different. But I can't say which one is better for which application or I can't compare them intuitively.


texts: I would like to ask, cuz I don't know much from that, how we can find the BER at a GSM network (uplink & downlink separately of course), while we are using FSK modulation? I mean the equations precisely, cuz I searched the Internet and there's nothing clear. Most cases where about MFSK, QFSK etc., but not specific for FSK.


texts: Reducing standing waves with phase randomization

texts:
Will constantly randomizing the phase of an audio signal, say a speaker in the corner of a square room, reduce standing waves (i.e. room modes) in the room?

For example if you wanted to create a diffuse field (i.e. no standing wave interference patterns) in a small room at low frequencies.


texts: For a discrete LTI system, does "bounded memory" imply "rational transfer function?"

texts:
Every LTI system with a $\mathcal Z$-domain transfer function that is a rational function - aka a quotient of two polynomials in $z$ - can be implemented using a bounded amount of memory.

Is the converse true? That is, are there any LTI systems that can be implemented using finite memory that do not have a transfer function that is a rational function?

Proving rational transfer function $\rightarrow$ finite memory is easy - any such system can be rewritten in the time domain as a linear constant-coefficient difference (LCCD) equation, so you end up needing only a finite number of delay lines to provide an implementation of the system.

Proving finite memory $\rightarrow$ rational transfer function seems less easy.

One way to look at it is, does finite memory $\rightarrow$ LCCD equation? That is, are there any finite memory LTI systems that cannot be expressed as an LCCD equation?


texts:
I'm going through this article https://www.elttam.com.au/blog/intro-sdr-and-rf-analysis/ and I find it hard to understand the following part:

  However, in our case we might want to transmit this signal later and need to represent each symbol with 1’s and 0’s, for instance the short pulse symbol may be represented by 0001. For this, we will measure the shortest pulse or gap that appears. Using the shortest pulse, we get a baud of 2960.

How did he calculate this 2960 rate? And why 0 should be represented as 0001 and 1 as 0111 - why 4 bits?

Thanks for your help


texts: Difference between Digital signal and Discrete signal

texts:
I have just started studying Digital Signal Processing. Can someone explain what is the difference between a Discrete Signal and a Digital Signal in simple words?

Thanks in advance !


texts: How to take the linear convolution of these two signals?

texts:
How do I perform the linear convolution of the following two signals?  I am having trouble relating $x[n]$ to a series of points, like was given by $h[n]$ below.

$$x[n] = e^{j\pi n}\left\{{u[n]}-u[n-8]\right\}\quad\text{and}\quad h[n] = (-1)^{n}\left\{{u[n]}-u[n-4]\right\}$$

$x[n]$ is a finite-length sinewave of length $L=8$, and $h[n]$ is a causal filter of length $M=4$, expressed as $h[n]=\{1,-1,1,-1\}$.

The solution is:
$y[n]=\{1,-2,3,-4,4,-4,4,-4,3,-2,1\}$


texts: How did we end up with these state variables $Z_1(n+1)$ and $Z_2(n+1)$ from the filter diagram ?


texts: Understanding liftering as the final step in MFCCs features extraction

texts:
In the book here, they apply liftering, as a final step of MFCCs features extraction,  to isolate the system component by multiplying the whole cepstrum by a rectangular window centred on lower quefrencies, or by de-emphasizing the higher cepstral coefficients.

However, in other references (see the discussion here) they use sinusoidal liftering, defined as:

$$w_i=1+\frac{D}{2}\sin\Big(\frac{\pi i}{D}\Big)$$

Hence, I want to understand the following points:

Which liftering step should I do in speech recognition, and what is the difference between these two ways above?
What is the parameter $D$ in the formula above, and should I choose its value equal to 12 or 22 if I'm retaining the coefficients 2-to-13 (inclusive) in MFCCs?

Update1:
According to this blog:

  One may apply sinusoidal liftering to the MFCCs to de-emphasize higher MFCCs which has been claimed to improve speech recognition in noisy signals.

How does applying this lifter de-emphasize higher MFCCs, while the plot of the variable lift (in the blog) looks like this:

Update2:

It seems to me that sinusoidal liftering is used when we are dealing with MFCCs (the DCT of the logarithmic filter-bank energies), and the low-time liftering is used when we are dealing with the IDFT of the log magnitude spectrum to isolate the vocal tract components.

Since DCT, in this case, equivalents to IDFT, it seems to me when we keep the 2-13 (inclusive) cepstral coefficients and discard the rest, it's equivalent to the low-time liftering to isolate the vocal tract components and drop the source components (which have e.g. the F0 spike). Then, the sinusoidal lifter is used to emphasize the middle cepstral coefficients (according to the comments below).

Also, according to the reference here (page 4), the variable D in the formula above is equal to the number of cepstral coefficients (i.e. 12 in my case). In this case, the plot of this lifter looks like this:

And it seems more logical to de-emphasize higher MFCCs which has been claimed to improve speech recognition in noisy signals, but why should we de-emphasize lower MFCCs too?

UPD. @jojek's comment: It's not about de-emphasizing as much as emphasizing the middle.

So, why do we emphasize the middle? And should I choose $D = 12$ to emphasize the middle?


texts: Is a negative Es/No for an SCPC RF signal possible, and what would such a value signify?

texts:
I apologize if this isn't the correct Stack on which to ask this question, but it seemed like the best fit.  I've tried to Google an answer, but I haven't been able to find anything that applies directly to Es/No, or which is written in a way I can understand (ie, the mathematical formulas on Wikipedia are beyond me at the moment).

I have worked with legacy satellite communications equipment for years, and I am typically used to seeing receive signal performance measured as a positive Eb/No or Es/No; any carrier visible on a spectrum analyzer would have--in my experience--a positive Es/No value.

However, I was recently shown an SCPC system where the carrier's Es/No was reported as a negative value, but I can't get an explanation as to why.  Is a negative Es/No value even possible?  Specifically, is such a value possible for a carrier which appears to be above the noise floor (as seen on a spectrum analyzer)?

If it's possible, then what would such negative values signify?

I appreciate any insight anyone can offer, even if it's just to point me to another Stack.


texts:
I was wondering about the implementation of the  Median Filter in opencv because I am suffering form its slowness. So, I intend to implement another one on my own but first I want to make sure about the used algorithm in opencv.
Many thanks


texts: Fourier transform in Matlab and hermitian symmetry

texts:
According to the conjugate symmetry property of Fourier transform, shouldn't the following command not return 1 (=true):

x=imread('cameraman.tif');
ishermitian(fft2(x))

However it does not (returns 0).

Is it due to some rounding error? Something else? Otherwise, how would you check that it is (avoiding to write a painful code with for loops etc)?


texts: Filters - Hilbert Transform and Absolute Value of Magnitude Response

texts:
Following relationship between magnitude response and phase response for minimum phase:

I have implemented in C++ code using the Hilbert Transform C code from file found online ht.c. However, I am not getting the phase response as expected. My magnitude response follows raised cosine formula:

Essentially I provide $|H(j\omega)| = \text{Gain}(f)$ to be all real values as per this cosine formula. The phase response is not as expected. Also, how am I suppose to handle $\log(|H(i\omega)|)$ when $|H(i\omega)| = 0$? Am I missing any steps to obtain phase response in this process?

Here is how phase and magnitude response should look like:


texts: I have 600000 time domain Data. I want to calculate the psd using that data. But I want to use hamming window to my data set and overlapping them to get a smooth psd vs. frequency graph. I need a matlab code to conduct this.


texts: Shift a signal by a given number of samples

texts:
Is shifting a signal by a given number of samples, say $n$ samples, the same as the following in matlab: signal(n:end) instead of signal(1:end).

That is, if the size of $signal$ is 200x1, does it make sense to remove the first $n$ rows and consider the size of $signal$ at (200-n)x1 for the shifted signal?


texts: How should I pre-process a real valued signal in order to use Kay's estimator?

texts:
I have 100,000 samples of a signal $x[n]$ that was sampled at 20kHz. The data is vibration data  from a rotating machine, and contains a significant spectral component related to the speed of the machine's rotation.

Because the speed of the machine varies over the duration of the sample, using the peak of the FFT does not yield the result I am looking for.

So I want to use estimators such as Kay's estimator that allow short-term estimates, but assume a signal model of:

$x[n] = A \exp(j \omega n + \theta) + z[n]$

where  $n$ = 0... 99,999, $A$ is the amplitude, $\omega$ is the frequency to be estimated, $\theta$ is the initial offset, and $z[n]$ is the complex noise.

However, my signal is real-valued and looks more like:

$x[n] = A \cos(\omega n + \theta) + z_r[n]$

where $z_r$ and $A$ are now real-valued.

How do I transform my real-valued signal into a complex-valued signal, so that I can use Kay's estimator?


texts: Shall a $1^{\rm st}$ order IIR filter include $x[n-1]$ term?

texts:
I have seen a $1^{\rm st}$ order IIR filter in the following form:

$$y[n] = \alpha x[n] + (1 - \alpha) y[n - 1]$$

Such as: another post in this forum

However, the filters generated by Matlab, such as [b,a] = ellip(1,1,10,0.1); usually have following format:

$$y[n] = b_1 x[n] + b_2 x[n-1]-a_2 y[n - 1]$$

There is a $x[n-1]$ case in the second format.

May I know why there is such a difference?
Is it possible to deduce one format from the other?


texts: Independence of Functions of random Variable

texts: Consider I am given two functions of one random variable each for example x=cos(at),y=rect(bt) where a  and b are random variables.And I am given Probability density function for a and b then if I am asked if the two functions are independent or  not so, I want to confirm that before proceeding I will have to convert the pdf of a and b to pdf of x and y or can I directly proceed with pdf of a and b by proceeding I mean checking if joint probability density is equal to product of marginal probability density.


texts: Separate Complicated Signal into Exponential Components

texts:
This morning, I asked a similar question about separating simple signals - with constant frequency - into exponential components. User @AndreasH suggested that a hilbert transform can do this as follows:

$$\cos(\omega_1 t) + j ~\textrm{Hilbert}[\cos(\omega_1 t)]  = e^{j\omega_1 t}$$

This works great when $\omega_1$ is a real constant, and when time is linear. Is there a way to do it for a more complicated signal? For example,

$$x(t)=\cos(\omega_o t^2 ) $$

When I perform a hilbert transform on this one, I get something with a lot of error functions.

How can I get $y(t)=e^{j\omega_o t^2}$ from $x(t)$?


texts: How to sharpen hair strands in an image?

texts:
I have an image like this:

I am trying to build a semantic segmentation and matting model which currently gives an output like this:

One can see that some regions between the hair strands are fuzzy. This is because the value of the alpha channel in between those regions are non-zero.  Is it possible to somehow adjust the alpha values in just those regions as a post-processing step, in order to make the hair strands sharper?

My expected output would be something like this. Notice how the hair strands are sharper and the regions between the strands are completely transparent (alpha value 0):


texts: Measuring frequency response with white noise signal

texts:
I need to measure a frequency response of an eleсtric circuit (simple like an RC-filter). I suppose that I can generate an input signal that has spectrum like white noise (for example, m-sequence signal or sine sweep), measure an output signal of a circuit and do calculations. And I can get a spectrum if I divide an output signal spectrum by an input signal spectrum.
Am I right? Or am I describing a wrong method?


texts: How to properly express periodogram over analog frequency?

texts:
Assume a signal $x[n]$ with $N$ samples and its $N$-point FFT $X[k]$. Assume also the simplest power spectral density estimator:
$$ S_x[k] = \frac{\left| X[k] \right|^2}{N} $$

With this estimator, the average total power can be evaluated as:

\begin{align}
P_x = \sum \limits_{k=0}^{N-1} S_x[k] \Delta F
\end{align}
where $\Delta F$ is the distance between digital frequency points represented by the FFT and is equal to $\frac{1}{N}$.

At this point, a first question arises, what is the unit of $S_x[k]$? Is it $\frac{V^2}{\text{subcarrier}}$?

In the case of an analog frequency horizontal axis, the total power would be evaluated as:
\begin{align}
P_x = \sum \limits_{k=0}^{N-1} S_x[k] \Delta f
\end{align}
where $\Delta f$ is the distance between analog frequency points represented by the FFT and is equal to $\frac{f_s}{N}$ (FFT frequency spacing).

Sequentially, in order to represent the power spectral density over an analog frequency, the PSD estimator has to be modified to:
\begin{align}
S_x[k]' = \frac{S_x[k]}{f_s}
\end{align}
where $f_s$ is the sampling frency.

Is this analysis correct?

Here is a MATLAB snippet to verify this:

clear all
clc

N = 4096;   % FFT size
fs = 200e6; % Sampling frequency in Hz

Px = 4;     % Target total power

x = sqrt(Px)*randn(N,1);    % Gaussian noise with power Px

% Verify signal variance
fprintf('Signal total power: %d\n', var(x))

X = fft(x,N);

Sx = (abs(X).^2)/N;  % Simplest PSD estimator

deltaF = 1/N;        % Digital frequency spacing

figure
plot((0:N-1)*deltaF, 10*log10(Sx))
xlabel('Digital Frequency')
grid on

% Verify total power
Px = sum(Sx*deltaF)

Sx_analog = Sx/fs;

deltaf = fs/N;        % Analog frequency spacing

figure
plot((0:N-1)*deltaf, 10*log10(Sx_analog))
xlabel('Analog Frequency (Hz)')
grid on

% Verify total power
Px_2 = sum(Sx_analog*deltaf)


texts:
I always studied the DFT starting from his formula, but for some reasons I need to do comparison between the FT and the DFT. I found the pdf in this link very useful http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf because it explains how the DFT can be obtained starting from the FT.
After the first formula it says " We could regard each sample f[k] as an impulse having area f[k]". What I don't understand is how it possible that the sample, being an impulse, has an area f[k]. Shouldn't t have an area f[k] multiplied by a very low number? This passage for me is crucial because I cannot understand why, passing from the FT to the DFT, the time increment disappears.


texts: Why images need to be padded before filtering in frequency domain

texts: In image processing books , we are told that Images need to be padded while doing filtering in the frequency domain. Why we need that zero padding ?


texts: How can l extract characters withe same bounding box size?

texts:
l have a set of images which represent a sequence of characters. l'm wonderning whether OpenCV can segments and crop each character from the image with same bounding box size.

My numbers are not always neatly separated, the distance varies and it's small between characters most of time. So l'm looking for a technique to find a good bounding boxes for each character. Such that, all the bounding boxes for all characters have the same size.

Mainly l get bounding boxes small for a given character which divide it into two character. It divides 8 vertically into two part. Then l get two characters rather than the character 8.


texts: Automatically identifying speech disfluencies from audio recordings

texts:
I want to automatically identify speech disfluencies (e.g. um(s) and uh(s) ) from my speech recordings. I am a bit surprised I couldn't find any disfluency detection models using speech only. I know some commercial cloud speech2text services label disfluencies automatically, but I cannot afford to use it. Does anyone know any speech-only disfluency detection I could use, or if any offline speech2text models output speech disfluencies too?
The alternative is to obtain the text transcripts then apply a forced alignment model which some output speech disfluencies.
Thanks! Any suggestions would be welcomed!


texts: Can a 1-dimensional signal be in a domain other than the time or frequency domain?

texts:
In signal processing I have only heard of signals being in the "Time" domain or in the "Frequency" domain, but are there situations where a signal is not in either of these?

If so, what are these other domains called? How could you translate a time or frequency domain signal into one of these other domains? Are there any practical use cases for doing so?

This question is referring specifically to 1-dimensional signals (for example a signal read from an audio file, or a simple sine wave).


texts: Machine Vision Techniques for Sign Language Recognition and Interpretation(using Matlab)

texts:
I'm currently working on applying Machine Vision methods to sign language interpretation and I'm really overwhelmed with the body of knowledge out there. I've been reading up on object recognition from various resources (Peter Corke's Robotics, Vision and Control, Richard Szeliski's Computer Vision, Algorithms and Application), but finding it hard to decide on what methods to go with, hence my question:
For simplicity's sake, let's assume I just want to process an image of a hand holding up 1 finger, get my program to process the image and out "one". Do same for 2...up till five. (I know this is really simple, but will give me the direction I need before going on to more complex things).
(1)What method do I need to store the original image of the hand holding up 1 finger to put in my database, which other images will be compared to?
(2)What method do I to compare an inptu to what's stored in my database (Please, give me the most simple methods you know of).

Thanks in advance.


texts: Design discrete controller for zero steady state error

texts:
I have the following system

where $$G(s)=\frac{0.5}{s+1}+\frac{5}{s+10}$$

How can I design the C(z) controller so that the steady state error for a step input r(t)=1(t) is zero?

I know that this has to do with the system type and in this case we have to deal with a type 0 system which for a step input will give a finite steady state error. Adding an integrator we make the type 1 getting the desired result. Now how would we deal with this in a discrete system? Do I get my constant time controller and convert it to a discrete controller?


texts: How do I understand Fourier descriptors more visually and intuitively?

texts: I read the book Image Processing, Vision and Machine Vision and find the concept Fourier descriptors hard to understand, although literally its derivation is somewhat reasonable. Can anyone give me a detailed picture about what's really going on about it? Thx.


texts: pi/4 QPSK modulation/demodulation in GNU Radio

texts: Is there any quick mechanism to create pi/4 QPSK or pi/2 BPSK modulation scheme in GNU Radio using Constellation Modulator object or Constellation Object? Or I need to write it by myself? Thanks in advance


texts: Image processing: Image recognition and classification on fish

texts:
I need to identify the type of fish caught from fish images. How can I locate anchor points/landmark points to extract features from the image?

Namely, I  want to locate eye position, dorsal and pelvic fin. Need to get Fish mouth length, Dorsal and Caudal fin length.

Right now I am trying with SIFT method to get key points.

Can someone suggest me how can I get the specific key points?

Example images can be found in Fish Recognition Based on Robust Features Extraction from Size and Shape Measurements Using Neural Network, 2010, Journal of Computer Science (online version).


texts: Basic Understanding of Convolution Operation

texts:
I would really appreciate any help in understanding this.

If $$y[n] = x[n]*r[n]\tag{1}$$ then what is $y[n-n_0]$ for any system?

Is it $$y[n-n_0] = x[n-n_0]*r[n-n_0]\tag{2}$$
or    $$y[n-n_0] = x[n-n_0]*r[n]\tag{3}$$
or    $$y[n-n_0] = x[n]*r[n-n_0]\tag{4}$$

Will that result (answer to the above) change when we now have an LTI system with $h[n]=r[n]$ being its impulse response?

Thank you very much


texts: I am trying to train a VAE+GAN model to generate sounds produced by honeybees. I build my model by slightly modifying this tutorial, which aims to generate new MNIST images. Since my data are 1D signals, I apply STFT to the input to generate image-like features whose height is time and width is frequency. However, the total loss quickly goes to inf or nan just after a few steps(~10). Any idea why? What is the legit way of using VAE+GAN model to generate audio data?


texts: Signal processing techniques for an accelerometer signal?

texts:
I am running some tests where I am recording accelerometer measurements.  I am looking to use elements of signal processing on this signal, but I am unsure about where to begin, or what my approach should be.

My ultimate goal is to be able to monitor the acceleration readings in real-time, and then display a notification when the event occurs.  As you can see around the 150,000 sample time, an event occurs.

If I am monitoring this data in real time, what sort of signal processing techniques could be implemented to react to this event?
Would a Short-Time Fourier Transform (STFT) be an option?

I am monitoring my data in Python, and they have a decent STFT function.

The arguments of this function are as follows:

scipy.signal.stft(x, fs=1.0, window='hann', nperseg=256, noverlap=None, nfft=None,
detrend=False, return_onesided=True, boundary='zeros', padded=True, axis=-1)

How do I determine optimal parameters to use to process this signal?
Are there any other methods that you folks think may help me in identifying when the event occurs in real-time (as opposed to just using the magnitude of the acceleration)?

EDIT 1:

My STFT has been added above.