texts: Does chirp have constant magnitude frequency response?

texts:
Pg. 223 claims so, yet my results via DFT differ:

Is the textbook wrong?

My attempted explanations: (code)

DFT vs DTFT: "frequency response" is computed via latter. Still, DFT should resemble a sampled DTFT.

DFT time-domain periodicity, whereas DTFT assumes aperiodic, or "repeats at infinity" with infinite zero-padding.

To address each, I try greater N, and zero-padding - below. Zero-padding appears to correct phase (quadratic if unrolled), and more samples tend to flatten the magnitude for an ever-growing portion of frequencies to the right.
I figure, in the limit N -> inf, the amplitude spike has zero width (like in Gibbs) - but this appears contradicted in the "large N long padding" case, where a nontrivial portion of the amplitude decays with oscillations. Further, the left peak appears to scale with N, behaving more like an impulse in the limit, which won't yield zero energy as in Gibbs phenomenon.

Update: turns out magnitude doesn't spike, but rather decays exponentially, which is far from the expected horizontal line - and, the phase is linear:

Note: see comments below accepted answer for further info.


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

texts:
I have multiple signals each measured with a sampling rate 300Hz. They are mostly periodic, although there are some parts of some of the signals, that seem to be random and do not follow the rest of the pattern(could be noise). I want to downsample this signal and I have found these three functions: decimate, resample_poly, and resample.

I do not know much about signal processing, so I was wondering whether someone could explain in simple terms what is the difference between the three functions and if possible suggest which would be the most appropriate to use for my case.

Note that I would like to apply machine learning methods to classify new signals to 2 categories. I need to downsample to decrease the time it takes to classify signals.


texts: Question about a demonstration of the autocorrelation theorem

texts:
I’m stuck on this demonstration.
It says:

If $x'$ is held constant, $dx=dy$

How can $x’$ be constant? Shouldn't $x’$ be a variable?


texts:
I would like to try optimize a bit more the biquad filters indended for RIAA/non-RIAA equalization at low samplerates (44.1/48kHz).

Are there any open source optimization libraries (C, C++ or C#) out there I could examine or even use?

Juha

EDIT: continues in thread How to improve filter quality at low fs


texts: What is meant by *sampling* in terms of the *sampling theorem*?

texts:
Let $y:\left(-\frac T2,\frac T2\right)\to\mathbb{C}$ be a square integrable function. The Fourier coefficients of $y$ are $$\underline{Y}(k):=\frac 1T\int_{-T/2}^{T/2}y(t)e^{-i\omega_kt}\;dt\;\;\;\text{with }\omega_k:=k\frac{2\pi}T$$
for $k\in\mathbb{Z}$. The Fourier polynom of degree $n\in\mathbb{N}$ of $y$ is $$\mathcal{F}^{-1}_n[y](t):=\sum_{k=-n}^n\underline{Y}(k)e^{i\omega_kt}$$ and $$\mathcal{F}^{-1}[y]:=\lim_{n\to\infty}\mathcal{F}_n^{-1}[x]$$ is called inverse Fourier transformation of $y$. Now, I've got two questions:

What is meant by sampling (in terms of the sampling theorem)? From my understanding, if we know the period $T$ all we need to "store" are the values $\underline{Y}(k)$. We cannot store all values, so we need to choose a "huge enough" $n$ and store only the values $\underline{Y}(-n),\cdots,\underline{Y}(n)$. So, where does "sampling" come into play? The only thing I could imagine is numerical integration: We consider an equidistant grid $$x_j=\left(\frac jN-1\right)\frac T2\;\;\;\text{for }j=0,\ldots,2N$$ and apprximate $\underline{Y}(k)$ using the composite trapezoidal rule, i.e. $$\underline{Y}(k)\approx\frac{1}{2N}\sum_{j=0}^{2N-1}y\left(x_j\right)e^{-i\omega_kx_j}$$ By doing so, we didn't take the whole "signal" $y$, but only the "sample points"$\left(x_j,y\left(x_j\right)\right)$ into account. Is this meant by "sampling"?
Does the sampling theorem make a statement about $n$ or $N$ or something else?


texts: Designing high-pass filters using impulse invariance

texts: One of the main disadvantages of realizing digital filters using impulse invariance is aliasing. According to the Nyquist sampling criterion, in order for the frequency response of the digital filter to match that of the corresponding analog filter with impulse response $h(t)$, $h(t)$ has to be band-limited. That is, the analog filter has to be low-pass. Does this mean we cannot map high-pass analog filters to high-pass digital filters using impulse invariance? Or is it just a matter of mapping a low-pass analog filter to a low-pass digital filter with frequency response $H(e^{j\Omega})$, and then finding the frequency response of the corresponding high-pass filter simply by substracting it from 1?


texts: What is the Fourier Transform of a constant signal?

texts: I am trying to figure out what the fourier transform of a constant signal is and for some reason i am coming to the conclusion that the answer is 1. Or better yet a step function.


texts: Absolute value based AM envelope detection viewed in the frequency domain

texts:
In my understanding when a passband AM signal is demodulated with an envelope detector taking the absolute value restores the original baseband version of the signal and the low-pass filter removes all the (passband) high frequency content.

It is intuitively obvious when represented graphically that after we rectify the signal we get the envelope in the upper part of the graph.

But mathematically in the frequency domain it is not so obvious how taking the absolute value of an AM passband signal would recreate the baseband signal.

How does one derive mathematically that taking the absolute value of an AM pass-band signal would recreate the modulating signal at baseband?


texts:
A point cloud is generated using uniform random function for (x,y,z). As shown on the following figure, a flat intersecting plane (profile) is being investigated that matches as the best (even if not the exact one) a target profile i.e., given at the left-bottom corner. So the question is:

  1- How to find such a match of given target 2D point map through point cloud considering the following notes/conditions?
  2- What are then the coordinates/orientations/degree of similarity etc?

Note 1: The profile of interest could be anywhere with any rotation along axes and also could be in different shape e.g., a triangle, rectangle, quadrangle etc depending on its location and orientation. At the following demonstration only a simple rectangle one is shown.

Note 2: A tolerance value could be considered as the distance of the points from the profile. To demonstrate this for the following figure suppose a tolerance of 0.01 times the smallest dimension (~1) so tol=0.01. So if we remove the rest and project all remaining points on the plane of the profile being investigated then we will be able to check its similarity with the target profile.

Note 3: A related topic could be found at Point Pattern Recognition.


texts: FIR Filters: determining optimal number of taps and phase slope

texts: As a design input for an low-pass FIR filter I have 6dB@1.6kHz, 24 dB/oct, sample frequency 48kHz. I need to specify phase response, and for that I need a phase slope. I have found, from Julius O. Smith web page, that the phase slope = (N-1)/2 where N is number of taps. What is the way to determine the optimal number of taps? I am aware of Kaiser formula, but I don't have ripple, passband and stopband frequencies that figure in the formula. I need the number of taps to calculate phase slope. Is there any other way to calculate, specify phase from my input requirements?


texts: Denoising a signal using eigendecomposition

texts:
I have a complex observable series $Y(t)$ which is the result of summing two complex r.v $X(t)$ (unobservable) and a $\epsilon(t)$ (unobservable).

$$Y(t)=X(t)+\epsilon(t)$$

Assume that $X$ and $\epsilon$ are independent, and that $\epsilon$ is serially uncorrelated and has constant mean and variance.

I construct a Hankel Matrix of the observed series and then I create a sort of variance-covariance matrix by multiplying the later by its conjugate transpose.

$$ R_Y=\mathcal{Y}\cdot \mathcal{Y^*}=\mathcal{X}\cdot \mathcal{X^*}+\mathcal{E}\cdot \mathcal{E^*}$$ (The last equality holds because of the independence of $X$ and $\epsilon$.)

After that, I make the eigendecompositon of that matrix and I obtain:

$$U\cdot (\Lambda_X +\sigma^2\cdot I)\cdot U^T$$  Where $U$ is the orthogonal matrix of eigenvectors, $\Lambda_X$ is a diagonal matrix containing the eigenvalues (in decreasing order) of $\mathcal{X}\cdot \mathcal{X^*}$ and $\sigma^2$ represents the "variance" of $\epsilon$ (under my assumptions $\mathcal{E}\cdot \mathcal{E^*}$ is a diagonal matrix with $\sigma^2$ in its diagonal.

Assume that the matrix $\mathcal{X}\cdot \mathcal{X^*}$ has not full rank, and because of that it has some null eigenvalues.

By the eigendecomposition of $R_Y$ we could select which eigenvalues correspond to the $\mathcal{X}\cdot \mathcal{X^*}$ matrix, (by considering the first $d$ eigenvalues, where $d$ represents the rank of the matrix $\chi \chi ^*$) and then we can estimate $\sigma^2$.

Knowing $\sigma^2$ we could estimate $R_X=\mathcal{X}\cdot \mathcal{X^*}$.

  Is there any way to factorize $R_X$ in order to obtain $\mathcal{X}$ and
  then by the  one-to-one relation between Hankel matrices and Series,
  obtain $X(t)$? if this is possible, under which additional conditions?


texts: Property for time invariance of system in terms of its impulse response

texts:
From the textbook Signals and Systems by Oppenheimer ...

If we define $h_k[n]$ to be the impulse response to $\delta[n-k]$, then for the system to be time-invariant, we must have
$$h_k[n] = h_0[n-k]$$

I don't understand how the last equation follows. By definition of time-invariance, if the input is shifted by $k$ units, the output is shifted by $k$ units. From the given definition of $h_k[n]$, $h_0[n]$ is the impulse response to $\delta[n]$. Shouldn't the time-invariance property read
$$h_k[n] = h_0[n]$$
EDIT:
The text goes on to add:

Since $\delta[n-k]$ is the time-shifted version of $\delta[n]$, $h_k[n]$ is the time-shifted version of $h_0[n]$

But saying it is the time-shifted version does not mean equivalance. What gives?


texts: Finding System transfer function, $H(z)$ or, equivalently, its impulse response, $h[n]$

texts:
I just started on DSP and I have a question that I would like to ask.

I have a zero-mean uncorrelated wide sense stationary discrete-time random process {$x[n]$, $n$ is a set of integers}. $x[n]$ is input to a causal linear time-invariant system below, denoted by its transfer function $H(z)$.

$$x[n]{\longrightarrow}\boxed{H(z)}{\longrightarrow }y[n]$$

Since the output is a random process, suppose that its autocorrelation function, $R_y[k]$, is measured without approximation error.

From the information given, is there a method to identify the system transfer function, $H(z)$ or, equivalently, its impulse response, $h[n]$?


texts:
SNR is defined as:

$$SNR=10 \log_{10}\left(\frac{\sigma_s^2}{\sigma_n^2}\right)$$

For instance, when we say the SNR of 10 dB is 10 times higher than that of 20 dB, it is higher in what unit? Amplitude, power or what?

Also, could you relate as to why it's 10 times higher for the above example.


texts: How is voice sound on TV or phone distorted through a face mask?

texts:
After a year of listening to people talk through face masks, it appeared to me that the sound is not merely muffled, but it has a very specific and recognizable tinge and texture to it.
It reminds me less of sound through a muffling pillow, and more of old speech recordings from the 1950s.
This is apparent whether you listen, today, to recorded speech on TV or radio or through the phone. Sometimes you hear it in person too.
I suspect that the sound is not just muffled or low-pass filtered, but that there is more happening. Perhaps it's a band-pass? A notch? Are there non-linear or time-variant effects from turbulence due to the interaction between plosives and the fabric?
Has anyone looked into this?


texts: I've seen in practice taking an FFT of a signal, then transforming it by the 2nd, 4th, etc. power (depending on signal type) to determine the baud rate. I'm trying to implement this in my code, but am lost as to what a transform of the 2nd power is. It appears to be some sort of non linear transform and not simply squaring of the FFT values.


texts: Efficient way to calculate eigen-values of a 2x2 matrix

texts: I'm working on an algorithm that works based on finding the eigen-values of a 2x2 complex covariance matrix. However, from a fixed-point implementation point of view, finding eigen-value of a matrix is computationally extensive. What is the best way to implement such computation in a more efficient manner?


texts: Why FFT of a filtered step increases the lower values of the transform with respect to the unfiltered signal?

texts:
I'm a bit new into DSP and when performing the FFT of a step filtered with a Notch filter I realized the frequency components arround the design filter frequency were attenuated (as expected), BUT the minimum frecuency increases arround tha design filter frequency. ¿WHY does this happen?
 These points are marked with an arrow and I believe it's just a matter of not fully understanding FFT. I would very much appreciate if someone could give me a hand with this.

I also include the time domain response of the filter (blue is the input, and red the output), and for more details about the filter it is defined as:

$$
N(z) = \frac{z^2 - 1.939 z + 0.9469}{z^2 - 1.868 z + 0.8764}
$$

(with a lot more decimals for better accuracy).

With a sampling period of 200 microseconds


texts:
Could the experts point me towards the best motion de blur algorithm? My images are blurred where I know the motion information with good precision(direction and angle)

There are so many deconvolution algorithms however I was not able to figure out which one would be best.


texts:
I'm new in DSP. I want to design single pass band FIR filter using LS method. I have this information :

one pass band $[-0.1\pi , 0.3\pi]$
two stop bands $[-\pi , -0.18\pi]$, $[0.38\pi, \pi]$
weighting constant in :

pass band : $a = 1$ and stop band $b_1=b_2=2$.

In this case, can I use Matlab's firls function? Because we have negative frequency and f is a vector of pairs of frequency points, specified in the range between $0$ and $1$.


texts: How to relocate face points in opencv / face distortion?

texts:
I have to simulate facial expressions on a face image ( say open mouth ). For this I first extracted the facial feature points and found the corners of the lips. Now I need to deform the image by moving the points down.

In the above image I need to move the points ( 2 ) and ( 3 ) to some distance left and right respectively. And point ( 18 ) and ( 19 ) littele bit down. So that I will get an expression like opened mouth.

My Questions:

1) Is this the above way right to proceed to simulate facial expression?

2) If it is right how to move the points and create a new image in opencv?


texts: Oversampling while maintaining noise PSD

texts:
I'm designing a digital PID for control and stabilization of laser amplitude. The noise PSD of the laser intensity is around -140dB/Hz, and I want to servo that between DC and 100kHz. I think I've found a solution on the input side, but would like to make sure my understanding of noise spectral density vs SNR is correct.

I'm thinking about using an ADC at 5MSPS with a SNR of 100dB. My understanding is that this means that the power spectral density for a full-scale signal will have a noise floor of -163 dBFS/Hz, calculated form the SNR and the bandwidth. Since I only want to servo to 100kHz, I can use a digital FIR filter to maintain that noise floor so that I have a healthy amount of SNR between the noise that I want to servo and the intrinsic noise of the ADC.

What I'm a bit confused about is what the FIR filter does to the noise spectrum. I'm pretty sure that the filter will simply attenuate everything past the passband, and maintain the 167 dBFS/Hz - the SNR increases, but the effective bandwidth decreases. Is this actually correct?


texts:
I'm very new to signal processing, and have been struggling this far. I've a rather messy signal measuring respiration using some chest bands and would like to focus solely on the inspiratory half of the data - ie. set the beginning of each inspiration to zero while maintaining the inspiratory amplitude of each breath.

I've attached an example (upslope is inspiration, downslope is expiraion), and have tried various ways of detecting the change in slope indicating the beginning and end of inspiration but keep getting tripped up by small deviations/noise in the signal. Any help would be appreciated.

Edit: https://docs.google.com/open?id=0B84oZTKp4RZ3LS1mdTBCLTJRdEU

Edit: pictures, hopefully better description:

When everything's going smoothly the it should be recording roughly 10-20breaths per minute.

But when the patient coughs/moves it looks something like:

Since I'm mostly interested in the magnitude of each breath, my thinking is that resetting each the start of each breath to zero is an easy (so to speak) way to rid of that upward drift after a cough.

In the worst cases I lose the respiratory signal all together. This I'd like to discard and pick up any redeemable signal as soon as possible.

Please let me know if there's anything else I can provide for an answer!

Thanks muchly.


texts:
I am getting error while implementing a simple idea for noise detection in an image. Let  I  denote  noisy  image  and  for  each  pixel of  I  is represented by I(x,y). A Sliding window of size 3X3 centered at I(x, y) is defined. At first we estimate that the center pixel of window is noise or not. To differ the noise and signal, we calculate the mean (m) and standard deviation (s) of the window. If the pixel is between m-s and m+s then it is a signal otherwise noise and we will apply median Filter.

Algorithm:

1.  Read an Image I.
2.  Take a Sliding Window or Mask of size 3X3.
3.  Calculate the Mean (m) and Standard deviation (s) from the Mask.
4.  Calculate the threshold as follows
         t1 = m-s and t2 = m+s

5.  IF     t1 <= I(x,y) and  I(x,y)  <= t2 THEN

           Result(x,y) = I(x,y)
    ELSE
        Result(x, y) = medfilt2(I(x,y)

6.  Repeat the step 3 , 4 and 5 on Entire Image.
7.  Display the Resultant Image.

I tried to implement this algorithm as follows

clc;
close all;
clear all;

I=imread('lena.jpg');
I=rgb2gray(I);
J=imresize(I, [128 128]);
L = imnoise(J,'speckle',0.01);

[m,n]=size(L);
% RETAINING THE CORNER PIXELS/ we can do zero padding also, suggest me which one is good

for i= 1:m+4
    for j = 1:n+4
        L(:,1:2)=J(:,1:2);         % retain the first two columns
        L(:,(m-1):m)=J(:,(m-1):m); % retain the last two columns
        L(1:2,:)=J(1:2,:);         % retain the first two rows
        L((n-1):n,:)=J((n-1):n,:); % retain the last two rows
    end
end

for i=1:m-2
    for j=1:n-2

      P=L(i:(i+2),j:(j+2));
      s=std2(P(:)); % Calculating Standard deviation
      m=mean2(P(:)); % Calulating Mean
      t1=m-s; % Threshold 1
      t2=m+s; % Threshold 2

      if (P(2,2)<=t1 && P(2,2)>=t2)
       iout(i,j)=medfilt2(P(:))
      else
       iout(i,j)=P(2,2)
      end

      end
end
L
iout
imshow(iout, []);
imshowpair(L,iout,'montage');

It runs but there is no change between input and output images.. Image is not filtered.
Please help me.


texts: Are resolution increase and noise reduction from oversampling mutually exclusive?

texts:
Oversampling a signal means sampling it with a significantly higher sampling frequency than the Nyquist rate. As far as I know, there are three advantages:

Easier design of anti alias filter
Increase in resolution in the presence of a white noise signal (I was told to assume the quantization error can under the right conditions be taken as this noise). While the uncorrelated noise adds up destructively (amplitude raises by $\sqrt N$), the signals amplitude increases by a factor of $N$. This means the SNR increases by $\sqrt N$, acting as an increase in resolution.
Decrease in noise. The quantization noise power is independent of the sample rate and only depends on the amount of bits. So the same noise power is distributed over a larger frequency band, resulting in less noise power per frequency. The a low pass filter can be used to remove the high frequency part of the signal.

If I average over multiple values I am back to the lower sample rate I started with, so I don't think the noise would decrease as described in 3. This leads me to think 2. and 3. are exclusive.
My question is, are 2. and 3. exclusive or can you benefit from both when oversampling?


texts: I want to calculate Fourier transform of the sampled signal in two ways. Let $$s(t) = \sum_{k = -\infty}^{\infty}\delta(t - kT)$$And $z(t) = x(t)s(t)$. So we have $$z(t) = \sum_{k = -\infty}^{\infty}x(kT)\delta(t - kT)$$Directly computing Fourier transform leads to $$\mathcal{F}(z(t)) = \sum_{k = -\infty}^{\infty}x(kT)e^{-j\omega kT} $$ On the other hand, if we use $\mathcal{F}(x(t)s(t)) = \frac{1}{2\pi}X(j\omega)\star S(j\omega)$ we have $$\mathcal{F}(z(t)) = \frac{1}{T}\sum_{k = -\infty}^{\infty}X(j(\omega - k\frac{2\pi}{T}))$$ How these are equivalent to each other mathematically? I mean how we can prove $$\frac{1}{T}\sum_{k = -\infty}^{\infty}X(j(\omega - k\frac{2\pi}{T})) = \sum_{k = -\infty}^{\infty}x(kT)e^{-j\omega kT}$$ And is there any intuition for this connection in terms of other subjects like sampling theorem or DTFT?


texts: Relationship between sampling frequency and number of coefficients

texts:
I have been designing a bandpass filter with a passband between $95\textrm{ kHz}$ and $105\textrm{ kHz}$ (using MATLAB's fdatool and scipy.signal.remez in Python) and have noticed that as I increase the sampling frequency the number of coefficients needed to implement my filter increase. I was wondering why this is?

I presume it is either because the ratio between the band-pass size and the full frequency range (0 $\rightarrow$ Nyquist) gets lower and this causes it to be more difficult to achieve?
Or because the filter has to filter out a larger range of frequencies (e.g. for a $400\textrm{ kHz}$ clock it has to have coefficients that cause attenuation from $0\rightarrow 95\textrm{ kHz}$ and $105\textrm{ kHz}\rightarrow 200\textrm{ kHz}$ but for a $1\textrm{ MHz}$ clock it has to have coefficients that cause attenuation from $0\rightarrow 95\textrm{kHz}$ and $105\textrm{ kHz} \rightarrow 500\textrm{ kHz}$) and thus requires a larger number of coefficients to achieve?


texts: Fourier Transform of an Exponential Sine Sweep

texts:
The Exponential Sine Sweep (ESS), according to Farina [1], can be described by the following formula:
$$x(t)=\sin\left(\frac{2\pi f_1 T}{R}\left(e^{\frac{t R}{T}} -1\right) \right)$$
where,

$t$ - time variable (seconds)
$T$ - the duration of the sine sweep. This can be viewed as the time it takes for the ESS to sweep from frequency $f_1$ to frequency $f_2$. (seconds)
$f_1$, $f_2$ - the start and final frequency, respectively (Hz)
$R = ln(\frac{f_2}{f_1})$ - exponential sweep rate

Now my question: what is the mathematical expression for the Continuous Fourier Transform of the ESS, i.e. what is:
$$X(j\omega) = \int_{-\infty}^{\infty}{x(t) e^{-j\omega t}} dt$$
I think it is possible to express the Continuous Fourier transformation as a LaPlace transformation by first assuming causality and absolutely integrability of the ESS. The LaPlace variable $s$ can then be replaced by $j\omega$ to obtain the Continuous Fourier Transform.
The LaPlace transformation can be expressed as:
$$X(s) = \int_{0}^{\infty}{x(t) e^{-st}} dt$$
However, this is as far as I'm able to solve the expression. I can't seem to figure out how to solve this integral further. Help is appreciated.
Thanks in advance!


texts: Learning roadmap for the audio signal processing beginner

texts:
I would like to start learning audio signal processing. There are numerous books online and academic papers all of which seem to skip the fundamentals of the topic.

I would like to know a rough roadmap, so to speak, to follow in order to successfully learn audio signal processing.

I have read that calculus is the first step before starting with signal analysis.

It feels to me like audio signal analysis is only one part of the overall knowledge needed. Where other topics are music theory, audio engineering and programming.

If I may ask people with knowledge on this area to suggest possible steps towards understanding how to analyse and manipulate/create audio signals.


texts: Trying to apply Parks-McClellan optimal FIR filter design

texts:
My goal is to apply the Remez exchange algorithm in R to design an FIR band pass filter for a specific frequency window. The question is not supposed to be referring to R of course but about how to choose the parameters correctly and why the result looks like as it does.

The toy signal is an additive combinations of four sine waves each adding a single frequency component to the final signal. The frequencies are 1/20, 1/300, 1/5000 and 1/7000. Its FFT plot is shown in figure (s).

Now what I apparently didn't get yet is how I would have to choose the parameters for the filter design - being the pass band and the stop band cutoff points.

The 1st filter uses the cutoff points:

0
1/10 - 2/1000
1/10 - 1/1000
1/10 + 1/1000
1/10 + 2/1000
1

With 1 being the Nyquist-frequency and the valid cutoff point interval being (0,1).

As you can see in figure (r1) this results in an attenuation of all frequency components except for 1/5000. (I would assume that also the frequency component 1/5000 is actually attenuated but relatively less then the other components)

So my first set of questions would be - why is that so? How could I calculate f.x. the frequency located in the center of the pass band? What is the quantitative relation between cutoff points on an interval (0,1) and the pass band?

The 2nd filter uses the cutoff points:

0
1/10 - 2/500
1/10 - 1/500
1/10 + 1/500
1/10 + 2/500
1

And the result is an (relative) attenuation of all components except for 1/300. What I am wondering about in this case is why the pass band is apparently completely different from the above filter even though I just made the filter's pass band wider. I would assume at least that 1/5000 is still located within the pass band and not attenuated. A possible explanation might be that 1/300 is now included within the pass band and relative to 1/5000 less attenuated making 1/5000 look just smaller.

I would like to add that I am - as you can see - quite new to this subject and actually from a different area and trying my best to understand what's going on.

The canonical question would be: How do I have to choose the cutoff points in case of a possible interval (0,1=Nyquist-Freq) to attenuate all frequency components except for 1/N and its close neighbourhood?

library(signal)
par(mfrow=c(5,1))

# the toy signal
ch <- sin(2*pi*1:100000/floor(100000/20)) +
  sin(2*pi*1:100000/floor(100000/300)) +
  sin(2*pi*1:100000/floor(100000/5000)) +
  sin(2*pi*1:100000/floor(100000/7000))

# (s)
barplot(abs(fft(ch))[1:10000])

filter <- function(c0,d1,d2) {

  # the filter design with cutoffs specified
  fir <- remez(n=1000,
    f=c(0,c0-d2,c0-d1,c0+d1,c0+d2,1),
    a=c(0,0,1,1,0,0))

  # (fN)
  plot(freq$f,abs(freq$h),type="l")
  freq <- freqz(fir,n=100000)
  y <- signal::filter(as.vector(fir), 1, x=ch)

  # (sN)
  barplot(abs(fft(y))[1:10000])
}

filter(1/10,1/1000,2/1000)
filter(1/10,1/500,2/500)


texts: What's the best method to extract vocals from music?

texts:
I want to achieve something like this https://soundcloud.com/user7421656/sonicworx-isolate-preview .

I've researched it and a few papers mention the use of "descriptors" on the audio and use thresholds on the descriptors to determine singing sources. But before I dive in and go hard out on how these people achieved it, I wanted to make sure it's the best way to achieve an effect similar to the above link.

What's an effective method to achieving singing source separation?


texts: Why does fft require a power of 2 sample numbers?

texts:
I'm a beginner in signal processing, I do not know if I'm right but what I understand so far is
if I have a signal of 44100 samples I have 22050 frequencies

so if I choose 512 samples for the fft the 43588 samples will not be analyzed
I can only edit the spectrum from 44100/512 = 86.1hz to 22050hz
if I want to edit the frequency 1hz I'll have to give 441000 samples to the fft but I can only give it or 65536 samples to analyze all the 22050 frequencies
then with 65536 given to the fft I can edit up to the frequency 32768hz


texts: What are the tradeoffs for more coefficients for fractional delay filter?

texts: Is there a rule of thumb for how many coefficients to choose for a fractional delay filter?  I figure there might be a trade off based on the signal frequency as well as my sample rate (this is running on an FPGA), but I can't seem to find a good rule of thumb.


texts:
I am not sure if this is the right stackexchange community for this question, but here goes.

I am generating a Gaussian Random Field (GRF) of a pre-defined power spectrum. In the image below, the input power spectrum is shown (in each panel) as the solid, smooth red line.

As a sanity check, I get the power spectrum of the resulting realised GRF. In the image below, I show this power spectrum for the original, high resolution random field realization in the upper right panel in blue. As we can see, it follows the input spectrum closely, as required.

Now, for an application I want to downsample the original image (by a factor of 2; that is, every 2x2 block of pixels becomes one pixel in the new image). If I then take the power spectrum of this downsampled (and thus lower-resolution) image, it does not follow the input power spectrum anymore; this is shown in the lower-left panel.

My first instinct was that this might be a resolution effect. Therefore, I generated another realization of the GRF, but this time at a lower resolution (indeed the same resolution as the downsampled image). If it was a resolution effect, this power spectrum should display the same discrepancy. It does not, however: in the lower right panel you can see that this lower resoltuion spectrum also follows the input spectrum closely.

Which leads me to believe that the discrepancy is caused solely by the downsampling. This is puzzling to me however, since downsampling seems so straightforward (perhaps deceptively so).
Below, I also give the (python) code used to downsample the image.

So, rephrasing my question for clarity: Why is the power spectrum of the downsampled image not in qualitative agreement with the original power spectrum?

def downsample(self,im, fact=4):
    """
    Downsample an image. Default with 2x2 blocks, but this can be adjusted if desired
    Needed because first we generate at high res, then apply lensing,
    then downsample to Planck resolution
    """
    assert isinstance(fact, int), type(fact)
    sx, sy = im.shape
    X, Y = np.ogrid[0:sx, 0:sy]
    regions = sy/fact * (X/fact) + Y/fact
    res = ndimage.sum(im, labels=regions, index=np.arange(regions.max()+1))
    res.shape = (sx/fact, sy/fact)
    self.downsampled = res


texts: MATLAB: Generating a random bit stream in a frequency Band for PSK Modulation

texts:
I want to generate a pseudo-random bit stream in MATLAB in a given frequency band for PSK Modulation. I am using the idinput function to generate the bit stream:

u = idinput(2^17,'prbs',[0.8 1],[0 1]);
figure(1);
[psd2,w] = pwelch(u,blackmanharris(2^17/8),[],[],1e9,'onesided');
semilogx(w,10*log10(psd2/2));grid on;

I want to use minimum a bit rate of 0.8GHz and want the bit steam in the frequency band from 0.8GHz to 1GHz. But when I check the Power Spectral Density, I see that it is flat for the whole band until 1GHz (with a DC component coming).

What is wrong with this code? How can I make the bit stream restrict to a given frequency band?
I want to have this frequency band to be within a modulation bandwidth for the PSK transmitter.


texts: Removing DC offset and ensuring zero-sum for 2D filter

texts:
I'm working on project where I'm using Independent Components Analysis (ICA) on NxN patches from images to separate components in an image signal. Each column of the resulting MxN^2 unmixing matrix is reshaped back to an NxN filter containing the independent components. For my project, this filter is then convolved with new images for feature extraction purposes.

My question is, how do I remove the DC offset of these NxN filters that result from ICA? In order words how can I ensure that (in MATLAB parlance) sum(sum(filter)) == 0 returns 1? Is it fair to just subtract the filter's sum from each component, or will that affect the filter's response?

If the filter sums to some non-zero value X, is it appropriate to just subtract X/number_of_coefficients from each filter coefficient?


texts: Issues in generating AR model with a constraint

texts:
I am new to the topic of system identification and looking for a large Autoregressive (AR) model. Can anybody point out a large stable AR model which has more than 2 coefficients AND there should be a large number of zero coefficients?

This link presents an example of how to have nonzero coefficients in lag 1,4 for order, $p=4$ AR(4) model. But, the values are NaN !! So, how do I apply this technique so as to generate a large AR model with more number of zero coefficients and lesser number of non-zero coefficients ?

EDIT:

Looking for any stable AR($p$) model (preferably popular cited ones, if available) of higher order $p \ge 20$ where the number of non-zero coefficients are few (constraint) . If I generate a noisy sinusoidal wave given below, then

%Generate sine wave = A*sin(2*pi*f*t + phi)
t = linspace(0,1,1000);
A = 5;
f = 2;
phi = pi/8;
sinewave = A*sin(2*pi*f*t + phi);
noisy_sine=sinewave+0.5*randn(size(t));
subplot(1,2,1);
plot(t, sinewave)
hold on;
subplot(1,2,2);
plot(t,noisy_sine);

%Generate AR model
order =20;
ARCoeff = aryule(noisy_sine,order);

It returns AR model of 20 lags. But, all the coefficients are non-zero. How do I generate AR model of any order higher than 2 where the number of non-zero coefficients are lesser than the number of zero coefficients ?


texts:
Suppose my goal is to solve for $x$ in $Ax = b$ using CG method and $A$ is Toeplitz. The problem is that $b$ is extremely large in size and I can't just read in the whole vector $b$ and then solve for $x$.

I know that if $A$ is comes from a convolution process, method such as OLS or OLA can work on big dataset by doing it piecewise.

However if $A$ isn't from a convolution process but is Toeplitz, is there a general approach to this kind of problem? Some way to break $b$ up and solve for individual pieces and put it back together in a meaningful way ?


texts: Inverse DTFT of $H_1(\Omega)=\begin{cases} 10,& \frac{\pi}{3} \leq |\Omega| < \pi\\ 0,& 0 \leq |\Omega| < \frac{\pi}{3}\\ \end{cases}$

texts:
What is the inverse DTFT of the $2\pi$-periodic extension of following function:

  $$H_1(\Omega)=\begin{cases}
10,& \text{for } \frac{\pi}{3} \leq |\Omega| < \pi\\
0,& \text{for } 0 \leq |\Omega| < \frac{\pi}{3}\\
\end{cases}$$

I have found out using the definition that it is: $$h[n]=-\frac{10\sin(\frac{\pi}{3}n)}{\pi n}$$

But the problem is that this has a DTFT of

$$H_2(\Omega)=\begin{cases}
-10,& \text{for } 0 \leq |\Omega| \leq \frac{\pi}{3}\\
0,& \text{for } \frac{\pi}{3} < |\Omega| < \pi\\
\end{cases}$$

Now, $H_1(\Omega)$ and $H_2(\Omega)$ seem quite different to me. Am I missing something? Have I done something wrong in my calculations?


texts:
Consider I have two transmitters $tx_1$ and $tx_2$ at say a distance of $d_1=5\text{ m}$ and $d_2 = 15\text{ m}$ respectively from a receiver. Now, if I consider the effect of path loss in such a system and plot the power spectral density for both the transmitters, the PSD of $tx_1$ should be higher than the PSD of $tx_2$. In my simulation, I notice that the PSD of $tx_1$ has its peak at $130\text{ dB}_m$ whereas PSD of $tx_2$ has its peak at $160\text{ dB}_m$.

I am not sure if I am missing something or I have understood this wrong. I think the peak should be vice versa, i.e., $130\text{ dB}_m$ for $tx_2$ and $160\text{ dB}_m$ for $tx_1$. I have used a reference distance $d_0=1\text{ m}$, pathloss exponent $n=3$ and $\lambda=3e8/2.4e9$.

This is the formula I have been using for calculating the pathloss:
$PL(dB)= -20\log_{10}(\lambda/(4\pi d_0))+10 n \log_{10}(d/d0)$

$PL(linear) = 10^{PL(dB))/10}$

Once , I have the PL, I am multiplying this PL with the signal to be transmitted. Could someone advise where I might be going wrong.


texts: I am reading the etext on Digital Image Processing by Gonzalez and under the section on Histogram Equalization, an equation which is apparently basic is shown. I have no clue what the equation means and where it is from. I hope someone can point me to it in wiki or something. I have been googling for awhile but I have yet to get any meaningful results.


texts: How can I calculate the cyclic (periodic) convolution?

texts:
I'd like to understand how to calculate the cyclic convolution as well as understand what that means exactly. How should I go about finding the output for various periods for a system?

I have an example:

$$
x(n) =
\begin{cases}
n & \textrm{for} \quad 1 \leq n \leq 3\\ 0 &\textrm{otherwise}\end{cases}
$$

$$
h(n) =
\begin{cases}
n & \textrm{for} \quad 1 \leq n \leq 2\\ 0 & \textrm{otherwise}
\end{cases}
$$

If I perform the convolution, then I get the following values for $y(n)$:

$$y(2) = 1;\quad y(3) = 4;\quad y(4) = 7;\quad y(5) = 6$$

Now, if I want a period = 3, then:

$$x(n) = x(n+3k) \quad\textrm{and}\quad h(n) = h(n+3k)$$

At this point, I'm unsure of what to do to get values that correspond to a period.


texts: Please help me understand this paper about Discrete Wavelet Transform!

texts:
I am trying to understand this paper says.

I have found this paragraph to be vague:

  (a) Preprocessing Stage. The first step in this stage was to apply the
  Discrete Wavelet Transform (DWT). This tool is based on the
  decomposition of a signal in subbands by means of the use of a pair of
  digital filters (low pass and high pass filters). The outputs of the
  low pass filter are named approximation coefficients (), while the
  outputs of the high pass filter are named detail coefficients (),
  where  represents the level of the subband. This process of
  decomposition through filtering is repeated  times. In each iteration
  the signal is subsampled by a factor of 2. In practice, the DWT is
  implemented with the Mallat pyramid algorithm [28]. Some studies have
  shown that the use of a four order Daubechies wavelet is one of the
  most effective when processing ECG signals [29]. Afterwards, the
  energy percentage of each level was calculated (see (1)-(3) and Figure
  3), then the four ones with more energy were selected to reconstruct
  the signal (Figure 4). In this way it was assured that the levels with
  more information of the ECG signal were selected because noise or some
  interferences such as those of the electrical network or the artifacts
  are usually found at low energy levels (high frequencies, generally
  between  and ) (see Figure 3). Therefore, using energy levels to
  discriminate the noise of QRS complex was a good option. Finally we
  proceeded to remove the offset of the signal by leaving out the
  approximation coefficients (). In the present study a db4 mother
  wavelet with 7 levels of decomposition was selected. The number of
  levels was selected because the data were processed in buffers of 1024
  and thus the number of iterations allowed was 7.

Specially this part:

  Afterwards, the energy percentage of each level was calculated (see
  (1)-(3) and Figure 3), then the four ones with more energy were
  selected to reconstruct the signal (Figure 4).

the energy percentage of each level was calculated - the energy of what, of the low frequency coefficients or the high frequency coefficients or both? I guess the high coefficients, or detail, right?

then the four ones with more energy were selected to reconstruct the signal

how?

On the text the researcher says the signal was decomposed in seven levels, so, he have obtained seven low frequency coefficients and seven high frequency coefficients.

He says he have used detail level 4, 5, 6, and 7 but he mentions these numbers in the following order: 5, 4, 6, and 7. Why?

What is he talking about? Reconstructing the signal just using 4 levels of IDWT? If he does that the reconstructed signal will have 3 levels missing, or in other words, it will be 1/8 of the original frequency. I the signal is being sampled at 30 Hz, the final reconstruction will have 3.75Hz.

Is this what the paper is saying? and why have the researcher mention the levels out of order?


texts: Is SSIM a measure of mutual information?

texts:
As i have seen contradictory information online: is the quality measure SSIM between two images (one base-line, one distorted) directly correlated to the mutual information between the two. One one hand, MSSIM can be partially interpreted as normalized mean square errors between the two on the other hand there are papers online that explicitely extend MSSIM by a mutual information term, suggesting they are not the same. I know this is not very in-depth, but for now i'm look for a simple yes/no -answer so I can decide in which direction to extend my further research.
Thanks!


texts: Saddle points, Nodes and Edges definitions

texts:
I am working on some algorithm implementation, however being new to image processing, I have some questions about some of the definitions used.
UPDATE: for those asking for more information, this is the RELEVANT information stated in the paper.

"Step 4: Centerline Computation
Our implementation of the centerline extraction is based on the Distance Transform with thinning as post-processing step as proposed by niblack. The result is a binary mask image g with a centerline thickness of 1, which corresponds to the undirected edge image graph." Then :

They(in the paper) keep on mentioning a node without prior definition, this means a truepoint with 2 other trueneighbors(out of 8). Am I right ? (this is the general definition of a node pixel)
They define an Edge being the distance between two adjacent nodes where the distance between them is $\leq \sqrt2 $. What do they mean by that exactly ?
Last they define saddle points being node pixels with the connected edge length has to be $\geq 3$. I don't know what they mean by that

Update:
Paper: ROCHADE: Robust Checkerboard Advanced Detection for Camera Calibration

I would like someone having more experience than I do to guide me through these definitions. I can not post the algorithm paper online due to copyright.


texts: Are there any filters that look (vaguely) like this?

texts:
I'm trying to determine the effect of a particular non-linear process on my data.  From simulations, I can measure the power spectra of "ideal" and "processed" images and take their ratio, which (I think) should correspond to some sort of filter or filtering process.

So, are there any filters, or filtering processes, that look (vaguely) like the attached plots?  The two plots are the same data in linear-linear (left) and log-log (right) space.

More detail: I have a pipeline that takes timestream data where each point on the timestream is associated with a point in an image.  Some "cleaning" (PCA subtraction) is performed on the timestreams before creating the images.  My goal is to determine the effect the timestream processing has on the resulting image, with the end goal being to replicate the effect on images for which no comparable timestream data is available.  The data is coming from bolometer arrays and these are images of the sky at millimeter wavelengths.

Here are the simulated images.  Left is before, right is after processing.  The spiky points around the edges are where there is no timestream data.

See also this ipython notebook http://nbviewer.ipython.org/4393835/ for a little analysis.

Since it is entirely possible that the timestream filtering process cannot be represented by any filter in image space, an answer addressing "how do I approximate these filter functions"  is appropriate.


texts: Random multipath power and delay generation

texts:
I'm trying to simulate an indoor environment that exhibits multipath propagation.

However, I don't know how to generate random multipath variables like path power and path delay (power-delay profile). I found a paper in here and I think this was the one I am looking for but I have a hard time understanding it.

For example: which distribution should be used for randoming other paths' power and delay values? Is it viable for indoors or is there a better approach for indoors?

Edit:

Example in code:

rayChan = comm.RayleighChannel('SampleRate',100000,'MaximumDopplerShift',130,...
'PathDelays',[0 a b],'AveragePathGains',[0, t1, t2],...
'Visualization','Impulse response');

In the code I want to randomize a,b,t1 and t2 values. In the article I provided above has expected value of some number of paths and they think it is realistic but I couldn't find which distribution they used to determine each path delays and avarage path gains.


texts: Using Fast Convolution to apply HRIR to soundwave

texts:
I have a dozen source sound waves; each is about one second duration. I want to put each one through a digital filter (I'm truncating it to 128 taps).

Currently I'm doing this with a bog standard convolution. It is chewing up a lot of CPU.

I would like to switch to fast convolution.

Could someone outline the steps?

I'm aware that the basic technique is iFFT ( FFT(src) * FFT(filter) ), but the source and the filter are different lengths.

So what I'm imagining doing is this:

For each (source, filter) pair:

Truncate each filter at 512 taps  and  FFT it to give 256 frequency bins.
Now step through the source at 128-sample increments using a window size of 512.

For each step,
    * multiply by a (Hanning?) window,
    * FFT
    * multiply FFT with FFT of filter (complex multiplication on each bin)
    * add to destination buffer
Divide amplitude of destination buffer by 4, as we did 4 x overlap

Questions I have at this point are:
1. Is the basic method right?
2. Do I need to zero-pad my filter?
3. Is 4x overlap appropriate / optimal?
4. is that windowing correct?  Is there any way to optimise out the windowing step?
5. how good will this output be compared with standard convolution?

π

EDIT: I've just noticed that dividing by 4 at the end is probably wrong, shouldn't it be using the area under the windowing function A_w?  So  multiplying everything by A_w / 4.  Would that be correct?


texts:
I have an assignment where I'm given the DFT of a sequence $x[n]$ as $X[k]=\{4,3,2,1,0,1,2,3\}$ and also
$$y[n] = \left\{ \begin{array}[cc]
xx[n/2] & \text{if n is even} \\
0 & \text{otherwise}
\end{array} \right. $$

and I'm supposed to find and sketch the DFT of $y[n]$.

So $y[n] = \{x[0], 0, x[1], 0 ... x[7], 0\}$ and it's not complicated to find $Y[k]$ if we know $x[n]$

I know how to use the definition of the DFT and IDFT to calculate $x[n]$ but it's a tedious task to do by hand, especially when the sequence is longer than a few items. Is there a quicker way to calculate the DFT and IDFT by hand without using a program like Matlab?


texts: Auto correlation properties of window functions in pulse compression application

texts:
It is known that different window functions perform differently and users pick a window function (in amplitude modulation) based on their application or requirement.

I am trying to pick a window that has a good auto correlation response to be used in pulse compression (matched filtering) of ultrasonic transmit/receive waveforms. I am looking for a fair compromise between mainlobe width and mainlobe to side lobe dB fall. This can help identifying/detecting signals buried in coherent noise.

What is the best way to perform this analysis?

I have two approaches in mind,

Auto correlation of windowed linear chirps and calculating mainlobe width and mainlobe to side lobe dB fall
Calculating mainlobe width and mainlobe to side lobe dB fall of the frequency spectrum of autocorrelation of the window functions themselves.

Please let me know if any other analysis could be done to quantify this compromise and finding the best window function for my application.


texts: ICA - Exercise Problem from book - Matlab Code

texts:
Im trying to do a problem of ICA from a Image Processing book, but when I finish I got the Matrix C different from the one in the exercise.
This is the Exercise:

This is my Matlab Code:

t=1:1000;
f=sin(t*pi/19);
g=sin(pi*t/5)+sin(pi*t/31);
h=mod(.3*t,1.5);
m1=.3*f+.4*g+.3*h;
m2=.5*f+.2*g+.3*h;
m3=.1*f+.1*g+.8*h;
mn=[m1;m2;m3];
m1p=m1-mean2(mn);
m2p=m2-mean2(mn);
m3p=m3-mean2(mn);
mnp=[m1p;m2p;m3p;];
C=(mnp*mnp')/3;
[V,D]=eig(C);
eigenvalues=diag(D);
eigenvector=V;

My result in the Matrix C is:

C =

   77.2656   60.7483   26.2664
   60.7483   64.0480   23.0485
   26.2664   23.0485   56.4664

This are the steps of the algorithm:

Then there is some info about applying to Signal Processing:

My problem is I don't get the same Matrix C from the exercise.


texts:
I have a signal in MATLAB on which I'd like to perform an FFT. My signal is stored in s, and I use the code below (inspired by the MATLAB help):

L = length(s);
nfft = 2^nextpow2(L);
S = fft(s,nfft)/L;
fftf = 1/Ts/2*linspace(0,1,nfft/2+1);
ffts = (2*abs(S(1:nfft/2+1)));

s is a GMSK-modulated bit sequence, that is, it varies between $f_c-2400$ Hz and $f_c+2400$ Hz in my case when transmitting 0 or 1, respectively. $f_c$ is set to 100kHz. For a long input, say, 250 bits worth of 1's and 250 bits worth of 0's, I get what I expect, see the first image below.

If I instead choose a low number of bits, say 10 1 bits followed by 10 0 bits, I get as expected, but it is shifted down to ~90kHz instead of centered at 100kHz. This is something I can't quite understand - it seems changing the sample rate and length of the FFT changes absolutely nothing.

Can anyone explain to me why? Thanks in advance!

Long data:

Short data:

The code used to generate the signal and FFT:

%% Configuration
clear; clf;

DataRate = 9600;          % 9600 kbps for AIS
N = 100;                  % Samples per bit
Tb = 1/DataRate;          % Bit period
Ts = Tb/N;                % Sampling period
BT = 0.5;                 % AIS spec, time-bandwidth product
Ftrans = 100e3;           % Frequency of "transmitted" signal

num = 200;
Bits = zeros(1,num)+1;
Bits = [Bits zeros(1,num)-1];
clear num;

%% Modulation

% Prep a time axis from -2Tb to 2Tb
t_g = -2*Tb:Ts:2*Tb;

% Gaussian response to rectangular pulse [Haykin4th, p. 397]
x = pi*sqrt(2/log(2))*BT;
gr = 1/2*(erfc(x*(t_g/Tb-1/2))-erfc(x*(t_g/Tb+1/2)));

% Truncate to 3Tb, pulse centered at 1.5Tb
gr = gr(0.5*N+2:3.5*N+1);

% Normalize
% when integrating, we want to end at 0.5 (phase changes by 0.5pi)
% so, we want sum(y)=0.5 -> normalize by sum(y) and divide by two.
gr = (gr)./(2*sum(gr));

% Generate the Gaussian filtered pulse train by centering a "Gaussian
% rectangle" on each bit, and adding inter-symbol interference
f = zeros(1,(length(Bits)+2)*N);
for n = 1:length(Bits)
    f((n-1)*N+1:(n+2)*N) = f((n-1)*N+1:(n+2)*N) + Bits(n).*gr;
end

% Since gr corresponds to changing the phase 0.5, multiplying by pi and
% integrating gives the resulting phase.
theta = pi*cumsum(f);

% Prep I,Q
I = cos(theta);
Q = sin(theta);

% Transmitted signal, shifted to ftrans
t = linspace(0,length(Bits)*N,length(I))*Ts;
s = -sin(2*pi*Ftrans.*t).*Q+cos(2*pi*Ftrans.*t).*I;

%% FFT

L = length(s);
% faster w/ a pow2 length, signal padded with zeros
nfft = 2^nextpow2(L);
% do the nfft-point fft and normalize
S = fft(s,nfft)/L;
% x-axis from 0 to fs/2, nfft/2+1 points
fftf = 1/Ts/2*linspace(0,1,nfft/2+1);
% only plotting the first half since its mirrored, thus 1:nfft/2+1
% why multiplied with 2?
ffts = (2*abs(S(1:nfft/2+1)));

%% Plotting

% FFT PLOT
plot(fftf/1e3,ffts);
title('FFT of transmitted signal S(f)');
set(gca,'xlim',[Ftrans/1e3-20 Ftrans/1e3+20]);
ylabel('|S(f)|');
xlabel('Frequency [kHz]');
grid;

Adjusting the sample frequency by changing N seems to have no effect - but changing num from e.g. 10 to 100 (changing the number of bits) clearly shifts the plotted spectrum closer to 100kHz.


texts: What are the limitations of using Magnetic induction rather than acoustic communication in underwater communication

texts:
In underwater environment, Why acoustic underwater communications are still famous more than magnetic induction communication however in magnetic induction underwater communication, higher data rate is offered, shorter propagation delay and highly environment-independent channel behavior?
In other words, what are they disadvantages of using magnetic induction communications in underwater environment?


texts:
How does changing the window period (i.e the number of points overlap between two frames) affect the FFT results ?

Suppose that a time series signal was converted to frequency domain by FFT with window size =2048 and window overlap=1024 and the output was plotted as a spectrum. Now will the appearance of the spectrogram change if the window overlap is reduced to 512 ?


texts: How to improve the reliability of KF estimation?

texts:
Sorry for boring you my dear friends.

Rcently I'm taking advatage of the state estimates X, outcoming from a Kalman Filter, with the their statistical information, i.e. Matrix of covariance P, to implement other studies.

Theories and practical studies have shown that the quality of KF state estimates is severely depending on the 'correctness' of system modeling, while unfortunately the true situation is unknown. Generally, the KF is either too optimistic or too pessimistic about the state accuracy, i.e. the state covariance matrix P.

The question is therefore, is there any method to reflect the variation of state estimates or the reality on the state covariance matrx P?

Thank you in advance for taking a look!


texts: Frequency translation of an ideal low pass filter

texts:
I am trying to create a discrete-time filter with a Fourier transform as follows.

$X(\omega) =
\begin{cases}
1, & T - W \leq \omega \leq T + W\\
0, & \text{all other values of } \omega
\end{cases}, $

Looking at the provided solution, I have understood that the idea is to create a low-pass filter and then translate it in the frequency domain by $T$.

For the low-pass filter I've got the following time-domain function.

$x(n) = \frac{1}{\pi}\frac{\sin(Wn)}{n}$

To translate a function in frequency, it can be multiplied in the time domain by $e^{jTn}$. In the solution, they have first stated that this is correct, but in the final answer they have instead multiplied it by $2\cos(Tn)$. They also wrote that $2\cos(Tn) = e^{jTn}+e^{-jTn}$, which I have no problem with, but I don't understand why they went for this instead of $e^{jTn}$.

So to be clear, my question is:  why did they multiply the low-pass filter by $2\cos(Tn)$ instead of $e^{jTn}$ to translate it in the frequency domain?


texts: Effect of changing sample rate, window duration and zero padding on DTFT and DFT

texts:
Let $T$ be the window duration, $N$ be the DFT size, $F_s$ be the sample rate, and $F_{max}$ be the frequency of the highest bin. In the context of image below:

halving the $F_s$ (keeping $T$ constant and N constant halving N) would remove the right half of the bins (halving the maximum frequency)
halving $T$ would change the shape of the DTFT, halving the number of lobes. Without zero padding this would halve $N$, but $F_{max}$ would remain constant and so every second bin would be removed.
doubling $N$ by zero padding the DFT would keep the DTFT and $F_{max}$ constant but would double the number of bins (i.e. interpolation of the DTFT).

Is my understanding sound?

Edit: No. I had overlooked aliasing when halving $F_s$


texts: How to get to shoulders localization on image photo?

texts:
I have a project on my university. I have to localize from video where are shoulders of person in movie.

Do have any advise how to get to this?

I thought about corner detection or some kind of shape detection. But I'm still not sure what next. We can treat video like image sequence (I wrote this, but I think is obvious)


texts: Frequency detection in audio and what parameter or set of parameters help/limit frequency detection

texts:
I'm trying to learn audio and voice/speech processing techniques out of interest. I intend to learn, experiment with algorithms and design, implementation of such systems, frameworks using programming languages like C/C++, Python, Matlab. Right now, to begin with, I'm only interested in audio or speech detection and not in speech recognition. I did some basic reading and research into this. Would like to understand a few basic concepts:

How to detect the presence of human speech (voice frequency of male being between 85 Hz to 180 Hz, and that of female voice frequency between 165 Hz to 255 Hz but maximum range being 20 Hz to 20 kHz), differentiate them from other frequencies, identify noise etc?
Being aware of the sampling theorem and the limitations of using lower sampling rates, how to know if any error was introduced during digital transmission or during reconstruction of the signal in analog domain from the digital domain (i.e., error detection) ?
How to detect tones (produced digitally or externally recorded analog tones) and music notes? Do they follow similar techniques as speech? If no, how are they different?

I seek guidance, if not direct answers, on how to proceed with the learning the concepts and reading material. Any help in this regard will be grateful.


texts: How to derive low pass filter $\frac{N}{N+S}$

texts:
I watched the video for PID control system where it mentioned the Laplace domain function and low pass filter to be $\frac{N}{N+S}$.
I used asymptotic analysis to see that it made sense. However, I'm interested in how it was originally derived. How did Laplace domain function lead to the low pass filter?


texts: Hidden Markov Models - Distinct Observation Symbols

texts:
I really, really hope someone can help me with regards to this question.

I'm trying to implement a Hidden Markov Model (based off this paper: Here

I understand the processes, but, I do not understand what M would represent in the data I am trying to train the HMM with.

I am given this example:

"N = the number of hidden states
 M = the number of distinct observation symbols
 T = the number of observations

 So, for the English text example, if you let N = 2, M = 27 (26 letters
 plus word-space), and T = 50,000 (number of input letters to use), you
 should see that the 2 hidden states correspond to consonants and
 vowels."

This example works for the English Dictionary, I understand that. BUT I am attempting to train the HMM with MFCC Coefficients of a file (stop.mfc) which contains 4k+ values. Now my interpretation would be that: T = 4000; (The size of the 'Observable' sequence) and N = 2; ("Stop" and "Go") so therefore what would M represent in the example I am giving? Which is: Differentiating between someone saying "Stop" or "Go" Would M infer the number of training samples I have?

I really hope someone can help me with this.


texts: Good book or reference to learn Kalman Filter

texts:
I am totally new to the Kalman filter. I've had some basic courses on conditional probability and linear algebra. Can someone suggest a good book or any resource on the web which can help me can understand Kalman Filter operation?

Most websites start directly with the formula and what they mean, but I am more interested in its derivation, or if not detail derivation then at least the physical significance of each operation and parameter.


texts: 4th order high-pass filter on a DSP: standard or biquads?

texts:
I have two C implementations of 4th order high-pass filter (fs = 16 kHz, cut-off=100 Hz, designed using Matlab butter() function):

1st. Done as standard difference equation implementation.
2nd. Done as product of two Biquad sections.

The final implementation will be a fixed-point DSP code.

Why is biquad implementation recommended?


texts: Kalman filter - understanding the noise covariance matrix

texts:
What is the significance of the noise covariance matrices in the Kalman Filter framework?

I am referring to:

process noise covariance matrix Q, and
measurement noise covariance matrix R

at any time step t.

How do I interpret these matrices? What do they represent? Do they talk about how one observation's noise varies with respect to another observation's noise in the state vector?


texts:
I would like to measure the time delay between two signals. By applying the cross correlation I get the time delay or number of samples by the location of the cross correlation peak, however I am interested to know what peak value itself identifies ?
I get a large value for the cross correlation peak.

Thank you!


texts:
I'm trying to filter this $g(x,y)$ WGN added
image
My Wiener filter is:
$$H(u,v) = \frac{P_{f}}{P_{f}+P_{n}}$$
Where the image power spectral density $P_{x}$ is estimated as $\frac{|X(u,v|^{2}}{N^{2}}$, $X$ being the FFT and $N^{2}$ its size.
Since image and noise are uncorrelated $P_{g} = P_{f}+P_{n}$, thus
$H(u,v) = \frac{P_{g} - P_{n}}{P_{g}}$
The noise variance is known, and the noisy image PSD is estimated as shown above. The application of the filter though yields disappointing results:

Any ideas on what I may be doing wrong?


texts: Applying Lowpass (LPF) and Highpass (HPF) Filters to an Image in Frequency Domain in MATLAB

texts: What I want is simply to apply low pass and highpass filters to an image in the frequency domain. Does MATLAB image processing toolbox have any commands for this?


texts: Bandwidth enhanced sinusoidal model with oscillators banks

texts:
i am currently implementing the bandwidth enhanced sinusoidal model for an additive synthesizer, this model allow to accurately produce noisy sounds by adding a noise component to each sinusoids.

But i have some troubles understanding the technical side of that model, to me, it seem that a small amount of filtered white noise is added to each partials so that each bands are widened.

So, in my implementation, white noise samples ([-1, 1] random values, gaussian distribution) is taken from a white noise wavetable, a low-pass filter (Chebychev order 3, cutoff 500, ripple -1., i also tried a simple moving average filter) is then applied on the resulting noise samples, the filtered noise value is then used as a phase step multiplier for the sine oscillators, this actually spread the frequency of the oscillator around as pictured below.

However, the audio result is a kind of background noise and does not enhance the noise part of the sound at all, even with an envelope applied to the noise multiplier.

What is wrong/different with this implementation compared to the model in the article linked above ?


texts: What image processing operation should I use to remove fuzzy black area

texts:
I'm performing some rudimentary OCR on some images that I have. The image below is from a VIN tag in a car. The image was originally color with a lot of glare that made some of the characters illegible. I performed the following operations.

Color Invert (tag was black and text was white, I wanted the reverse)
Color Threshold to get rid of the worst of the glare.
Make image black+white only
Erode/Dilate in order to tinker with the text to make it easier for Tesseract OCR to read.
Run Tesseract OCR to extract the characters

The issue that I'm having now is that the black "fuzz" that surrounds the sticker is slowing down Tesseract. What I would like is the name of some operation or a series of steps that I can regularly use in a case like this to get rid of these distortions. I could manually write something to look at squares of the image and if there's way more dark then light, replace with white. There has to be some formal image processing technique to handle this case that I just don't know of.

If I manually remove the black in the margins, my accuracy goes up substantially in Tesseract.


texts: How do I measure the amount of noise in a picture? (signal to noise ratio)

texts: Hi ive got a uni assessment which requires me to find the Peak signal to noise range of my photos, I was wondering if there was an app or a simple way of measuring the noise of a singular picture, any help or input would be greatly appreciated as I am genuinely stumped.


texts: what is the FFT logic in calculating far field defraction matlab implemetation

texts:
there is an expression shown bellow that we need to plot in 2D grid plot as shown bellow.
X and Y are 2D matrices going from -0.5 to 0.5
the Code uses an FFT function FFT takes as input the func_in struct variable which has two subvariables:\ 1.the matrices which is the formula output data 2.scale variable and some n variable.
Then FFT function does some FFT2 which is described as
Y = fft2(X) returns the two-dimensional Fourier transform of a matrix using a fast Fourier transform algorithm
then they do
Y = fftshift(X) rearranges a Fourier transform X by shifting the zero-frequency component to the center of the array.
Then they use the sc with linspace of interval long vector.
What is the logic in the FFT matlab code?
Thanks.

FFT function:
function [ func_out ] = FFT( func_in,n )
func_out.mat=fftshift(fft2(func_in.mat));
interval=(func_in.sc(2)-func_in.sc(1))^-1;
func_out.sc=linspace(-interval/2,interval/2,n);% FFT creates a new scale for the output. the scale is the ratio of one over the interval of the formaer scale.
end

Main function:
L=1;
n=1024;
scale = linspace(-L/2,L/2,n);
[X , Y]= meshgrid(scale, scale);
rect=400*((sinc(10*X)).^2).*((sinc(Y)).^2).*cos(pi*3*Y./2);
func_in.mat=rect;
func_in.sc=scale;
func_out=FFT(func_in,n);
figure (1)
colormap gray

image(scale, scale, rect, 'CDataMapping','scaled');


texts: Difference between 'conventional' and 'adaptive' beamformers?

texts:
This might be a terminology question but I am not sure.

Basically, what is the difference between conventional beamformers, and adaptive beamformers? I thought that all beamformers were inherently adaptive to some criteria, like minimization of distortion or variance, or some other spatial filtering criteria etc. So what is the difference between them?


texts: How to model a generic low frequency signal?

texts:
I'm trying to apply Fourier analysis to a specific problem I have.
I have essentially an integral like the following

$$
\int_{\Omega} f(t) g(t) dt
$$

And I'm trying to assume that $g$ is a narrow band signal (namely the Fourier transform is defined on a compact set). I want to prove that if $g$ is really narrow band then

$$
\int_{\Omega} f(t) g(t) dt \approx \left( \int_{\Omega} f(t) dt \right) \left( \int_{\Omega} g(t) dt \right)
$$

To prove this, I made this assumption

$$
g(t) = g_a(t) = \frac{1}{a} \int_{-\infty}^{+\infty} \hat{g}(\omega)rect \left( \frac{\omega}{a} \right) e^{-j2\pi \omega t} d \omega
$$

Where $a$ is a positive real parameter. When $a \to 0$ this integral turn out to be

$$
\frac{1}{a} \int_{-\infty}^{+\infty} \hat{g}(\omega)rect \left( \frac{\omega}{a} \right) e^{-j2\pi \omega t} d \omega \to \hat{g}(0)
$$

which means

$$
g(t) = g_a(t) \to \hat{g}(0) = \int_{-\infty}^{+\infty} g(t) dt
$$

and therefore

$$
\int_{\Omega} f(t) g(t) dt \approx \int_{\Omega} f(t) \hat{g}(0) dt = \hat{g}(0) \int_{\Omega} f(t) dt = \int_{-\infty}^{+\infty} g(t) dt \int_{\Omega} f(t) dt
$$

which is not exactly what I want , but it's close enough. The final question is:

is the model

$$
g_a(t) = \frac{1}{a} \int_{-\infty}^{+\infty} \hat{g}(\omega)rect \left( \frac{\omega}{a} \right) e^{-j2\pi \omega t} d \omega
$$

the correct model for a narrow band signal? I'm not entirely sure because of the factor $1/a$ I've introduced. But the idea why it makes sense is the following.

If the signal has narrow band, that means the variation in time is really slow, that means the narrower is the band the more the signal tend to be constant, and in theory if it would be constant then I'd be able to factorize the function $g(t)$ from the integral.

Clarification : probably in this discussion is more correct to say "low frequency".


texts:
I have a strong primary signal with frequency range between 100–200 kHz. This signal has very low frequency and lower SNR secondary signal phase modulated to it.
The modulated signal is around 10-30 Hz.

The fundamental signal frequency changes over time, fast enough that I cannot take enough samples to observe the secondary frequency. For example signal goes from 200 to 170 kHz in short enough time that if I take a simple FFT, the peak will be spread from 200 to 170 kHz and secondary signal will be buried inside.

The good news is that the second signal frequency doesn't change with fundamental frequency change.

I like to detect this secondary, modulated lower SNR signal with 1 Hz accuracy.

What should be my sampling frequency for a given maximum 200 kHz primary signal?
What should be the DSP approach I should take to determine the exact frequency of the modulated signal?


texts: How to perform this spectral decomposition in MATLAB?

texts:
Given a filter $X(z)$ I want to find $G(z)$ such that it is stable, causal and minimum-phase, and it accomplishes that $$X(z)=K_0G(z)G^*(1/z^*)$$

where $K_0\in\mathbb{R}$. Of course, $G^*(1/z^*)$ would then be anticausal and maximum-phase. The filter $x[n]$ has complex coefficients.

I'm trying to achieve this in MATLAB but I'm finding it more difficult than I thought.

% This is my filter x[n]. You can try with any coefficients, it doesn't matter
x = dfilt.dffir(q_k + 1/(10^(SNR_MFB/10)));
% Here I find its zeros
zeros_x = zpk(x);
% And now I identify those who are inside and outside the unit circle
zeros_min = zeros_x(abs(zeros_x) < 1);
zeros_max = zeros_x(abs(zeros_x) > 1);
% Now I wanted to build the filter g[n] using this information but don't know how

I tried using spectralfact() but it doesn't support inputs with complex coefficients.

Does anyone have any idea on how to get the coefficients of $g[n]$?


texts: Measuring amplitude of a spectral component

texts:
I'm trying to measure the amplitude of a spectral component in a signal. The component's frequency is always known beforehand.

I take a given number of samples, apply the flattop window to reduce scalloping loss, then use FFT and look at the bin of interest.

The earlier method used adaptable sampling frequency ($f_s$ was an integer multiple of the signal frequency) -> no windowing was needed.

Compared to the earlier method, measurements with the new method have a lot more variance. I suspect that it is the window that picks up the noise (convolution over the whole spectrum, where there are other strong components).

The $f_s$ is either 312 KS/s or 625 KS/s, the signal frequency is 2-15 KHz.

How could I improve my measurement?

Is there an other method which exploits the fact that the frequency of the signal is always exactly known?


texts: Should we use a digital low pass or high pass filter to remove sensor bias?

texts:
Consider a continuous signal oversampled at, say $2 \;kHz$, and then system digital low pass filtered to a $100\;Hz$ frequency which is the control loop frequency. It is known that there is some bias in the signal since it is an accelerometer output.

If we use a discrete derivative with a discrete integral in series, will this remove (atleast some of) the DC bias in the signal?
Correspondingly it seems a better idea to use a high pass filter rather than a low pass filter although this will invite noise. Is a notch filter how people deal with accelerometer signals and should one go with a high pass approach in case of the unavailability of a notch filter (since the signal necessarily contains bias)?
Does the same logic hold if one designs the filter in the continuous domain?


texts:
I have just learned about this method, so I am not very familiar with it. As far as I know, Principal Component Anlysis (aka PCA) is used to transform a vector $x$ that belongs to a space of $d$ dimensions to a vector $y$ that belongs to a space of $p$ diamensions, where $p\ll d$ . The new vector $y$ consists of p uncorrelated components. I also know that these $p$ components hold the maximum possible energy of the initial vector $x$ . Last but not least, since PCA is an orthogonal transformation, it should minimize the error norm (the difference between the initial vector and its projection). Correct me if I am wrong.

So let's say we have a random vector $x$ that belong to space $\mathbb{R}^{d}$ and we use PCA to project it to a new space of $p$ dimensions where $p\ll d$. I have come up with three statements. However, I can't find out which one is the correct one:

PCA projects vector $x$ to a space of $p$ dimensions where the projection has minimum energy
PCA projects vector $x$ to a space of $p$ dimensions where the difference between the initial vector and the projection has maximum energy.
PCA projects vector $x$ to a space which is  homeomorphic with $\mathbb{R}^{p}$

So which is the correct statement?


texts:
Is there a way to generate a waveform from data (any kind of data: integer, hexadecimal, string, char, binary), in a common audio player, without converting the data to an audio format?

I'm looking for a way to "code" an arbitrary file in to audio (obtain an audio-descriptor of the data).


texts: CIC compensation filter and total response

texts:
UPDATE: New plot with properly scaled CIC comp response.

I'm studying about CIC filters for interpolation/decimation and I'm reading about CIC compensation filters due to CIC filters not having a flat freq response in the passband. So I ran the code in this Application Note (Example 1) by Altera on "understanding CIC compesation filters" and I have 2 questions:

How can I obtain the total filter response? If I have $H_{cic}(z)$ and $H_{comp}(z)$, total response should be $H(z)=H_{cic}(z)H_{comp}(z)$, which I believe would result in the convolution of both filters' coefficients. But this is what I got:

It doesn't look good at all. Is this the right way to get the total response?
On page 7 it says

  In a multirate compensation filter, a decimation compensation filter with
  a rate change factor of 2 has input sampling rate fS/R and output
  sampling rate (fS/R)/2. To avoid aliasing, the compensation filter must
  have a cutoff frequency that is no more than half of (fS/R)/2, that is,
  (fS/R)/4.

Where in the example (I mean, where in the code) do you decide that the compensation filter has a rate change factor of 2? And does that mean that the final output signal will have sampling frequency of $f_s/R/2$ instead of $f_s/R$?

Thanks!


texts:
From a comment in another question I read a statement

  "In addition, the initial rate of 48kHz is already performing 6 times
  oversampling and therefore the subsequent decimation by 6 will not
  cause any aliasing either."

Could you please explain it? If I would oversample by 2 and then downsample it by 2 without AA-filter I would have stuff folding back to by final Nyquist band. Is this not exactly what is called aliasing?


texts:
Say I have an LTI system whose impulse response h[n] is:

$$
    h[n] = \delta[n] + \delta[n-4]
$$

I want to find the group delay of this system. I know the group delay ($grd$) is defined as:
$$
  grd = \frac{-d}{dw}(\angle H(e^{jw}))
$$

So I get $\angle H(e^{jw}) = -4w$ and the $grd = 4$ but I believe this is incorrect.

For a more complicated example:

$$
h[n] = -\delta[n+1] + \delta[n] + 2*\delta[n-1] + 2*\delta[n-2] + \delta[n-3] - \delta[n-4]
$$

What would my $\angle H(e^{jw})$ be? Thanks for helping me understand something fundamental that I am missing about group delay.


texts: Relationship between spectral efficiency and PAR

texts:
Low PAR means less fluctiations in the magnitude of a signal and hence analog signal processing (e.g., power amplifier) is tremendously reduced. For example, constant envelope modulation schemes like BPSK, GMSK can use a switching amplifier which are >90% efficient. The downside is low spectral efficiency.

On the other side, high-order QAM or OFDM have high spectral efficiencies but the PAR becomes very high (up to 12dB for OFDM) and hence power amplifiers only reach 10-20% effiency.

Specieal cases and tricks aside (like Crest Factor Reduction, Digital Predistortion, ...) and leaving SNR out of the picture, is there a first order relationship between spectral efficiency and PAR? Any theoretical bounds?

If not, are there at least published plots that plot spectral efficiency vs PAR for various standards/modulation formats? (I did not find any)


texts: How to find first 25 coefficients of DCT in Matlab?

texts:
I need first $25 \times 25$ coefficients of DCT to encrypt an image in Matlab.

How do I obtain them ?

I used this code to compute DCT of an image :

I = imread('cameraman.tif');
I = im2double(I);
T = dctmtx(8);
dct = @(block_struct) T * block_struct.data * T';
B = blockproc(I,[8 8],dct);
mask = [1   1   1   1   0   0   0   0
    1   1   1   0   0   0   0   0
    1   1   0   0   0   0   0   0
    1   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0];
B2 = blockproc(B,[8 8],@(block_struct) mask .* block_struct.data);
invdct = @(block_struct) T' * block_struct.data * T;
I2 = blockproc(B2,[8 8],invdct);
imshow(I), figure, imshow(I2)

The statement in the paper I read is :

  Basic constructions: Let $V$ be a feature space of dimension $d$ (for
  instance, the space $R^d$ corresponding to the entries in the top left
  corner of the DCT of a digital image excluding the DC component) and
  consider an original feature $φ = (φ_1, . . . , φ_d)$.

The paper gives also some practical details like this :

  We choose as a feature space the upper left $25 \times 25$ coefficients of
  the DCT (excluding the DC component).


texts: Segmentation and Labeling of White Blood Cells

texts:
I am trying to segment and label white blood cells from this image:

Using K-Means I managed to segment most of what I wanted:

But as you can see, there are some cells connected to each other which I would like to label as separate objects.

So my questions is:
Can you point me to some known algorithms that perform the task of automatically separating them?
This image comes from a data set with annotations of the cell centers, in case machine learning is involved...

Also, but much less important, it would be nice to hear suggestions about improving the K-Means segmentation (Discarding the 'Stains').

Edit:
Thanks!
After playing around with the regional minima function
(inextendedmin), I managed to segment all of the cells in the center, except for the bottom left in that cluster at first, but some cleaning up of the segmented image did the trick in the second watershed segmentation:

Edit2:
For anyone who still follows (or even cares), I managed to improve segmentation using
K-means for spatial clustering on the original bw image, where the number of cells I obtained via watershed was defined as k (number of clusters). The result provided a bit finer segmentation:

The cells image is taken from ALL-IDB


texts: I know the basic working principle of sinusoidal oscillators. But I have a doubt on this matter when I came across Gram-Schmidt orthogonalization procedure. I have read that the source for sinusoid signal output from an oscillator is the noise. Due to controlled positive feedback a single frequency component is selected and amplified, right? If the noise is a white noise, we say it has all frequency components. We think in terms of all possible sinusoids with different frequencies. When coming to frequency response too, we think in terms of sinusoids. Why can't we think in terms of other orthogonal basis set? Although it makes life difficult, I would like to know the justification for thinking in terms of sinusoids. Is sinusoids the nature's default signals?


texts: What is the output of IFFT operations, continuous or discrete time?

texts:
Assume we have a sequence of symbols
$$S= \{0, 0, 1+j, -1-j, 0 ,0 , 1+j,-1+j\}$$

and that this sequence is a frequency domain sequence and will be input to an IFFT operation.

Is the output a continous time or discrete time signal?

Thanks


texts:
I have started learning digital communication and was on line coding. I read there are certain characteristics that we need to keep in mind while choosing the right line coding method. One of these is considering DC component. I'm not quite able to understand what DC component really is, what and why does it poses a problem in digital communication?

To explain my doubt, I would like to tell two different definitions of DC component (at least they seem different to me) that I read from two different sources. First,

  Signals creates very low frequencies when the voltage level in a digital signal is constant for a while. These frequencies around zero are called DC components, creates problems for a system that cannot pass low frequencies or system that uses electrical coupling.

Second,

  Over one cycle period of a waveform, if all the positive voltages are cancelled by negative voltages, then, DC component of the waveform is 0. In line coding, the signal with the non-zero DC component is treated as a distorted one and it can create errors in received signals.

I don't seem to have any clue about what the first definition wants to say. As far as I know, the definition of frequency is number of cycles completed per unit time. Actually, how do you even measure the frequency of a digital signal? And how does it relate to the DC component?

I understand the second definition in itself pretty well but I don't understand how does it relates to the first definition. Also, what problem does it poses in transmission if the positive voltages do not cancel the negative ones?

P.S : A less mathematical reply would be highly appreciated since I'm new to this field.

Thanks in advance.


texts:
I'm studying OpenCV and, in computer vision and image processing, people speak of blobs, contours, connected regions, and I sometimes hear the phrase "image moments".

I know of an article on Wikipedia about it, but I think it is too technical. I don't really want to go deep into the math background but I want to know what I'm talking about.

Could someone explain to me what image moments are in plain English?


texts:
I have two video where two person having conversation. They begin recording different times. I want to match these two videos' frame numbers, i.e. By matching audio.

How can I do that?


texts:
My question is easy one actually.

First, I generate a random signal using randn() function of MATLAB like this:

Then, I design a FIR filter of order 200 of pass-band characteristics with the pass-band $[0.2\pi, 0.4\pi]$ using the MATLAB function fir2():

My questions are:

What am I supposed to see when I filter a random signal using BPF?
What change in the characteristics will be occur considering the theory?


texts: Correct way to calibrate RX into a measuring receiver

texts:
While playing with my SDR (Software Defined Radio) Board, I was interested in performing a TX output power table at different center frequencies and TX antenna gains.

I have an RF frequency generator. Therefore, my intentions are to generate signals with well known RF power and measure them with the RX of the SDR, somehow converting it into a calibrated measuring receiver. From this, I would just repeat the experiment but now with a direct TX-RX connection. This way, I would know what power I'm transmitting with TX as well.

The problem is that I'm not really sure what should be the quantities that I measure in RX in order to make it into a measuring receiver and I don't know what the digital words measured in RX correspond to voltage neither.
Also, I have to assume that RX does not have a 50 ohm impedance neither does TX. Therefore, I can't just convert the power from the 50 ohm frequency generator into Vpk and then use this result to calculate the digital Vpk of the IQ data in RX, since there would be a reflection in the wave and the result would be wrong... right? Or is there a way to measure the impedance of the RX (and then of the TX)?

Can someone please clarify me the methods? I'm not familiar with RF at all.

Thanks in advance!


texts:
$y$ is scalar observations and so C will be a 1x2 matrix.

I want to represent the following model as a state space representation so as to estimate the hidden states from the noisy observations $y$ using Kalman filter.

The  state space model :

x(t+1) = Ax(t) + w(t)

y(t) = Cx(t) + v(t)

w(t) = N(0,Q)

v(t) = N(0,R)

$w(t)$ is a pseudo-random binary signal that excites/ drives ; and $v(t) = N(0,\sigma^2_v)$ is the measurement noise.

The model is an FIR (MA) filter

$$x(t) = h_1 \epsilon(t-1) + h_2 \epsilon(t-2) + \epsilon(t)$$
$$y(t) = x(t) + v(t)$$
$$ y(t) = h^T \epsilon(t) + v(t)$$

(In vector form)

where $\epsilon(t) = w(t)$.

The other model is an IIR (AR) filter
$$x(t) = ax(t-1) + bx(t-2)+ w(t)$$

The state space representation:

$$x(t+1) = a^Tx(t) + w(t)$$

$$y(t) = h^Tx(t) + v(t)$$

How do I represent these as state space so as to apply Kalman Filter?

There are several ways to represent time series models. This is how I proceeded, but unsure because the output of the log-likelihood is a matrix of 2 by 2 with off diagonal elements being infinity and the diagonal elements are same positive values. So, the dimension and the value of log-likelihood is incorrect, I should get negative instead of positive values.

FIR :

Re-writing the above model as:

$$x(t+1) = h_1 \epsilon(t) + h_2 \epsilon(t-1) + \epsilon(t+1)$$
$$y(t) = Cx(t)+v(t)$$

State Space :

$ \left[ \begin{array}{c}
x(t+1)  \\
x(t)\\
 x(t-1) \end{array} \right] $ = $ \left[ \begin{array}{ccc}
1 & h_1 & h_2 \\
0 & 1 &  h_1 \\
0 & 0 & 1\end{array} \right] $  $\times$ $ \left[ \begin{array}{c}
e(t+1)\\
e(t) \\
e(t-1)\end{array} \right] $

$  y(t)$ = $\left[ \begin{array}{c}
1 \hskip 5 pt 0 \hskip 5 pt 0\end{array} \right] $
 $\times$ $ \left[ \begin{array}{c}
e(t+1)\\
e(t) \\
e(t-1)\end{array} \right] $ + $v(t)$

IIR (AR model)

$ \left[ \begin{array}{c}
x(t+1)  \\
x(t)  \end{array} \right] $ = $ \left[ \begin{array}{cc}
a & b  \\
1 & 0
\end{array} \right] $  $\times$ $ \left[ \begin{array}{c}
x(t)\\
x(t-1)\end{array} \right] $ + $\left[ \begin{array}{c}
1\\
0\end{array} \right] $ $\times$ $\left[ \begin{array}{c}
w(t+1)\\
w(t)\end{array} \right] $

$  y(t)$ = $\left[ \begin{array}{cc}
1 \hskip 5 pt 0\end{array} \right]$ $\times$ $ \left[ \begin{array}{c}
x(t)\\
x(t-1)\end{array} \right] $ + $v(t)$


texts: Algorithms to re-spatialize a stereo recording audio signal?

texts:
Let's say we have an audio signal stereo recording, made for example with a XY microphone positioning:

Which algorithms can be used to "re-spatialize" this recording, i.e. try to virtually "move the microphones", and recreate a new stereo signal, for example with an AB mic positioning?

To do this, we would need to be able to:

know the effect on the signal of rotating a microphone
know the effect on the signal of moving a microphone a few centimenters from each other

I can imagine that this involves delaying/shifting x_L[n], x_R[n] (phase), but more generally should we use convolution / STFT techniques?


texts: Power spectral density vs. Fourier Transform

texts:
I am trying to understand the difference between the Power Spectral Density and the Fourier transform. Specifically, I am trying to understand why the power spectral density is useful and in what scenarios it is useful.

For example, suppose I have some time series and I want to get a better understanding of the frequency content of the time series. I can either take the Fourier transform (e.g. FFT), or I can compute the power spectral density. The power spectral density involves windowing, computing the autopowers for each window and summing. It seems to involve many more steps than a straight-forward FFT.

Below is a MATLAB script I wrote to examine this;

T = 1; %Length of time series in seconds
Fs = 1000; %sample frequency
dt = 1/Fs; %sample length
N = T/dt; %Number of time samples
t = (0:N-1)*dt; %Time vector
f = (0:N/2)*Fs/N; %Frequency vector

%Frequency content of the signal (three frequencies in Hz)
F1 = 200;  F2 = 400;  F3 = 350;
sigma = 3; %Standard deviation of the noise to be added

%Create time series
r = sin(2*pi*F1*t)+sin(2*pi*F2*t)+sin(2*pi*F3*t)+sigma*randn(1,N); %Time series

%Compute one-sided FFT
R = fft(r); %Fourier transform of time series
R2 = abs(R/N);
R1 = R2(1:N/2+1);
R1(2:end-1) = 2*R1(2:end-1);

%Compute power spectral density (autospectrum)
[pxx,fxx] = cpsd(r,r,bartlett(256),128,2048,Fs);

%Plot results
subplot(3,1,1)
plot(t,r,'-'); %Time Series
title('Time series');
xlabel('Time (s)');
ylabel('Amplitude');

subplot(3,1,2)
plot(f,R1,'-') %One-sided FFT amplitude spectrum
title('Fourier transform');
xlabel('Frequency (Hz)');
ylabel('Amplitude');
axis([0 Fs/2 0 1.1])

subplot(3,1,3)
plot(fxx,2*pi*pxx) %Autospectrum
title('Power Spectral Density')
xlabel('Frequency (Hz)')
ylabel('Power / Hz')

The output from this script is the following figure:

Both the FFT spectrum and the autopower spectrum show peaks at 200, 350, and 400 Hz which is good because that is what the true signal contains. But the peaks are more obvious in the FFT. So why would I use the power spectral density method?

Can anyone provide a simple example where the FFT fails to show the correct spectrum but the autopower is able to recover it?


texts: Concatenated Deletion & Sticky Channel Capacity

texts: Suppose you are sending information through a deletion channel with a deletion rate of .5 and then the output of this channel is sent through a sticky channel with a repeat rate of .5 also.  No error correction is allowed in this scenario, the information is not coded in any way.I am not looking for an error correction code for this composite channel, I am NOT sending any information through the channel, I just want to calculate the channel capacity. It is well known that the capacity of the IID deletion channel is unknown. What I am hoping for is to show that if you concatenate a deletion channel with a sticky channel that the capacity for the combined channels is zero, or close to zero. Anybody out there who can do this?


texts: How can I increase the zero-padding on the DFT?

texts:
Now I'm trying to understand and implement the zero-padding work in my example.
As I know, meaningless zero values are affect to better DFT result. So I want to see how zero-padding works.

clear all
clc

fs = 50; %50Hz
T = 1/fs;
N = 8;
t = (0:N-1)*T;

y = 5+cos(2*pi*12.5*t)+sin(2*pi*18.75*t);

X=zeros(1,N);

for k = 0:N-1
    for n = 0:N-1
        X(k+1) = X(k+1) + y(n+1)*exp(-j*(2*pi/N)*k*n);
    end
end

x_mag = abs(X);

f_2 = fs*(0:(N-1))/N;
stem(f_2,x_mag,'-ok','linewidth',2,'MarkerFaceColor','black');

For N=8:

For N=80:

But I feel hard to implement the increasing zero padding in my example code.
Would you please show me how I can increase the zero-pad?

I found the better result when I increased the $N$ number to 80 from 8.
But I'm not sure if increasing $N$ means increasing the zero-pad.


texts: Given a continuous time signal, does the minimum Nyquist sampling rate depend on the choice of the set of basis functions?

texts:
This is my first question on a StackExchange.  When the basis functions to represent a signal are chosen as  $e^{j\omega t}$ such as in a continuous-time Fourier transform then the sample rate $f_\text{s}$ must be more than twice the maximum frequency taken by the chosen continuous time signal. Two questions:

Is it possible to get a Nyquist sampling rate less (I doubt) or more than this by choosing a different basis set? I understand that "frequency" itself may no longer be well defined, so basically: would it be possible to choose a set where one could afford to sample at a higher/lower rate without loss.
If yes, is there some reasoning behind how the set was chosen? Any theory/references would be appreciated.

Would be glad to clarify any doubts/inconsistencies.


texts: Friendliest python library for fixed point algorithm simulation

texts:
My primary programming language is python.  Is anyone aware of solid python libraries to simulate fixed point algorithms in python?  A quick google search revealed this:

https://pypi.org/project/spfpm/

Does anyone have experience with this?


texts:
I performed 512 point FFT on a signal. I got another set of  512 Numbers. I understand that those numbers represent amplitude of the various sine and cosine waves having different frequencies.

If my understanding is correct can somebody tell me how to know the frequencies of those sine and cosine waves from the knowledge of those 512-numbers (i.e amplitudes) ?


texts: Region of convergence of transfer function

texts:
I posted this question Mathematics SE and got no answer so I have posted it here.
I learned in my signal processing class that an LTI system can be defined using a linear constant coefficient differential equation. Whenever we have 'initial rest' condition, the LTI system is causal. Initial rest condition is basically the output $y(t)$ is $0$ till $x(t)$ becomes non-zero for the first time.

$$\sum_{i=0}^N a_i y^{(i)} = \sum_{i=0}^M b_i x^{(i)} \hspace{1cm} initial \hspace{0.25cm} rest \hspace{0.25cm} condition $$

We get the Laplace transform of its transfer function as

$$H(s) = \frac{\displaystyle\sum_{i=0}^M b_i s^{i}}{\displaystyle\sum_{i=0}^N a_i s^{i}} $$

and more importantly, its ROC is the half plane right of the rightmost pole (condition for causality).
My question is how can I modify the initial condition to get any ROC I desire? For example, what should be the initial condition if I want my ROC to be left half plane, left of the leftmost pole? What if I want my ROC to be a vertical strip between two adjacent poles having real parts as $\alpha$ and $\beta$, ROC $= \{s| \alpha < \textrm{Re}\{s\} < \beta\}$?

I have no idea how to approach this problem.


texts: $ \frac{1}{f^2} $ Weighting for Least Squares FIR

texts:
I am currently modifying the firls.m from Octave to allow all types of FIRs, differentiators, and Hilbert transformers, while taking a peak at Matlab's. I see there that, for differentiators, the default weighting is 1/f^2. In Selesnick's paper there's no mention of this. Does anyone know how to achieve it?

My thoughts go to $\int{K(\omega)\cos(n\omega)d\omega}$ (and the rest). Does it derive from $\int{K(\omega)^2\cos(n\omega)d\omega}$ ? Or from $\int{\left[\int{K(\omega)d\omega}\right]\cos(n\omega)d\omega}$ ? Does anyone have a hint?

I just thought of it this way: if it uses a $1/f^2$ weighting, doesn't that mean that the weighting $K(\omega)$ becomes $1/\omega^2$ ? So, the integral would become:

$$\frac{1}{\pi}\int_0^{\pi}{K(\omega)\cos(n\omega)d\omega}=\frac{1}{\pi}\int_0^{\pi}{\frac{\cos(n\omega)}{\omega^2}d\omega}$$

which is similar to the exponential cosine integral, without the log part. Further on there's:

$$\frac{in}{2}\left[\Gamma(-1,in\omega)-\Gamma(-1,-in\omega)\right]$$

The nice thing is that there is no imaginary part in the result. Maybe I'm hoping too much?


texts:
I'm trying to determine whether or not an anti-alias filter is needed for sampling square waves. The goal is to sample square wave pulses from a video detector with an ADC, do some time-domain digital processing on it, and reconstruct it with a DAC.

I do understand that signals with frequencies above the nyquist rate will alias into the "wrong" frequency bin. I guess the best analogy is the camera taking a picture of a car wheel turning at a certain rate, and at certain speeds it looks like the wheel stops or starts spinning backwards (a "misinterpretation" caused by the aliased frequencies). A square wave is made up of an infinite amount of odd harmonics but....

From an ADC perspective, it is just taking a sample of the voltage in time. I fail to see how a "misinterpretation" could be made since there is no "turning car wheel" to take pictures of at the wrong time. Do the harmonics alias in such a way that the wave shape is preserved?

In my mind, adding a filter to the signal will modify the shape of the original signal, getting rid of those upper harmonics. Depending on the filter design, it could add overshoot, ripple, and/or rise/fall time changes. So wouldn't the best representation of the pulse be obtained by direct sampling?


texts:
Thanks to all the people who helped me here, I finally achieved to implement a notch filter (*), with coefficients given by :
http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html

When I do order=2 (number of poles=4, according to this website), all is working very well with :

y[n] = a0*x[n-4] + a1*x[n-3] + a2*x[n-2] + a3*x[n-1] + a4*x[n]
       + b0*y[n-4] + b1*y[n-3] + b2*y[n-2] + b3*y[n-1]

Great!

When I try to increase order (example : order=4 or even order=3 => number of poles=6), then the filter doesn't work anymore. Very quickly (after n=10 or 100), the signal is saturated to the max value : overflow !

(Nota : I work in double (64 bits) floating point).

Somebody told that the higher the order, the more unstable ! What to do then to solve this problem ?

Thank you very much in advance.

(*) The IIR filter is even ... linear-phase ... thanks to the trick that someone gave me (apply the filter on the signal, then reverse the signal, then apply the filter again, then reverse the signal) !


texts: Technique to detect pitch after analysing only one pitch period?

texts:
does anyone know if there is a technic to estimate the pitch of a given signal by analysing only one pitch period.

I'm asking because I read about a program called AudioMotors.
https://lesound.io/product/audiomotors-pro/
If I'm right, you can load in a recording of your car, where you recorded the rpm from idle constantly rising to max rpm. Then you can jump to any position u want and hold the rpm at this point. There are a lot more features this program provides. But I'm only interested in the part where you can hold a chosen rpm and let it sound pretty good.

I'm not an expert in dsp but I thought you can jump to a position you want. Then you select a few samples. From these samples you have to estimate the pitch of the first period and match the pitch of all following pre selected samples (pitch scaling). After this you can loop these samples and not hear any pitch change. And maybe let it sound ok.

If you can help me with this or have any suggestions on how to program a "light" version of AudioMotors pls let me know.

Thanks in advance.