New answers tagged

0

The solution you came up with is the correct homogeneous solution (i.e., when $x[n]=0$). Thing is, this is a non-homogeneous difference equation, and its solutions are of the form $$y[n]=y_h[n]+y_p[n]=k_1\Big(\frac{1}{2}\Big)^nu[n]+ k_2\Big(\frac{-1}{4}\Big)^nu[n]+y_p[n]$$ where $y_p[n]$ is the particular solution that solves for the $x[n]$ term, and you are ...


1

You've already found the solutions of the characteristic equation as $\lambda_1=\frac12$ and $\lambda_2=-\frac14$, so you know that the solution must have the form $$y[n]=c_1\left(\frac12\right)^n+c_2\left(-\frac14\right)^n\tag{1}$$ For the anti-causal solution we know that $y[n]=0$ for $n>0$. The constants $c_1$ and $c_2$ are simply determined by making ...


-1

I guess you want to synthesize that sound, i.e. create a synthetic signal to be as close as possible to the original sound. Potentially, you can do this by creating a superposition of sine waves with varying amplitudes and phases. So you have to know the parameters for those sine functions. From what I can see and hear, the sound has two signals, which are ...


1

The method of subtracting the clean signal from the received signal is a good method and will work as long as the scaling is matched up. As an alternative, you can also try the cross-correlation method which takes care the of the amplitude estimate. This previous answer gives the basic idea, How to calculate time domain SNR using known sequence. If $x(t)$ is ...


0

The Goertzel algorithm gets away without calculating a complex product with $e^{j\pi lk}$ n times; thus drastically reducing the computational complexity.


1

I'd do this nonlinearily, in two steps: Detect the jump Correct the jump Detection sounds rather easy: a short (linear-phase) high-pass filtered version of your signal is compared to a threshold. From that, we know exactly the position of your jump; it's where the threshold was crossed, minus the group delay of the filter (which happens to be half the ...


1

ADCs don't have a transfer function. An ideal ADC is an ideal sampler with a sampling period T. Real ADCs are not ideal, they have some sampling delays, jitter, quantization noise, thermal noise, etc. Usually the sampling delays are really small compared to the dynamic of the systems, so we don't model them. Quantization noise and thermal noise should not be ...


2

You can employ Compressed Sensing / Sparse Representation for Super Resolution in Frequency Domain. One way to do so is solving the problem: $$ \arg \min_{\boldsymbol{x}} \frac{1}{2} {\left\| F \boldsymbol{x} - \boldsymbol{y} \right\|}_{2}^{2} + \lambda {\left\| \boldsymbol{x} \right\|}_{1} $$ Where the $ {L}_{1} $ norm is sparsity inducing regularization ...


0

I remember being asked to do something like this in a DSP course and it was confusing because I wasn't sure how to model the continuous variable $t$ in MATLAB where everything is digital. You can still make a nice demonstration of sinc interpolation by choosing a low sample rate and use interpolation to create the interpolated signal which is at a higher ...


1

Figured I'd post this since I wrote it anyway, just a confirmation of Fat32's answer. Letting $N' = \frac{N}{2} - 1$ we have $\sum_{0}^{\frac{N}{2} - 1} e^{\frac{-j2\pi k (2n)}{N}} = \sum_{0}^{N'} e^{\frac{-j2\pi k n}{(N'+1)}}$ Then plugging in the geometric sum formula: $=\frac{1 - e^{\frac{-j2\pi k(N'+1)}{(N'+1)}}}{1-e^{\frac{-j2\pi k}{(N'+1)}}}=\frac{1 ...


3

Assuming $N$ even : $$ \begin{align} X[k] &= \sum_{n=0}^{N-1} x[n] ~ W_N^{kn} ~~~,~~~k=0,1,...,N-1\\ \\ &= \sum_{n=0}^{N/2-1} 1 ~ W_N^{k ~2n} \\ \\ &= \sum_{n=0}^{N/2-1} e^{-j 4\pi kn/N} \\ \\ & = \frac{ 1 - e^{-j \frac{4\pi k}{N}N/2 }}{ 1 - e^{-j 4\pi k/N}} \\ \\ & = \frac{ 1 - e^{-j 2\pi k}}{ 1 - e^{-j 4\pi k/N}}~~~,~~~k=0,1,...,N-1\\ ...


0

A linear system cannot add anything new to its input signal, so additive noise is modeled separately from any linear distortion of the signal. In your case with just scaling and delay, the channel impulse response is $h(t)=k\delta(t-\Delta t)$, and the complete channel is modeled by first filtering the input signal with an LTI system with impulse response $h(...


0

I did the same thing you did at first and I could not understand it. But then I realized that the continuous time case was adding $2 \pi$ to $t$, not $w_0$.


1

Given $ \left\{ x \left[ n \right] \right\}_{n \in M} $ where $ M $ is the set of indices given for the samples of $ x \left[ n \right] $. The trivial solution (Which it would be great to have a faster more efficient solution is what I'm looking for) would be: $$ \arg \min_{y} \frac{1}{2} \left\| \hat{F}^{T} y - x \right\|_{2}^{2} $$ Where $ \hat{F} $ is ...


1

A matrix method is far simpler I suppose: h x x1 x2 x3 h1 ⌈x1*h1 x2*h1 x3*h1 ⌉ h2 |x1*h2 x2*h2 x3*h2| h3 ⌊x1*h3 x2*h3 x3*h3 ⌋ h x 3 2 1 1 ⌈3 2 1 ⌉ -2 |-6 -4 -2| 3 ⌊9 6 3 ⌋ Now just add up the diagonals: y[0] = 3 y[1] = -4 y[2] = 6 y[3] = 4 y[4] = 3 p.s I don't know how to type in a matrix here.


1

If it is difficult for you to remember or calculate the convolution of two sequences then you may try doing it as polynomial multiplication. Think of x[n] and h[n] as polynomial coefficients. So we have Px = 3x^2 + 2*x + 1 Ph = 1x^2 - 2*x + 3 Remember that linear convolution of two sequences is polynomial multiplication. Therefore Py = Px * Ph Py = (3x^2 ...


0

A causal signal is one that is non-zero, only for $t \geq 0$, while it is zero for all negative time(or time instants). While, a non-causal signal is one that is defined over the entire time axis(i.e., non zero for all values of the time.)


4

I couldn't quite follow your code (you calculate two different versions of the ACF?), but I believe the problem with the plot being shifted toward zero is that xcov calculates the cross covariance not correlation. Remember that cross covariance is subtracting the mean, so there should be a shift! You should be calling xcorr instead. The following code ...


3

It's convention, they're equivalent: $$ \exp{\left(j2 \pi \frac{N}{2}n/N \right)} = \exp{\left(j2\pi \frac{-N}{2}n/N\right)} \\ \Rightarrow e^{j\pi n} = e^{-j \pi n} \Rightarrow \cos(\pi n) = \cos(-\pi n)=(-1)^n,\ j\sin(\pi n) = j\sin(-\pi n) = 0 $$ MATLAB and Numpy go $[-N/2, ..., N/2-1]$, which is unfortunate for analytic representations (+ freqs only). ...


0

Assuming $x[n]$ is real, resulting in $X[k]$ being "Hermitian symmetric"; $$ X[N-k] = (X[k])^* $$ and if $N$ is even, then the value in the DFT bin $X[\tfrac{N}{2}]$ (which is a real quantity with zero imaginary part) should be split into two equal halves. One half should be placed at $k=-\tfrac{N}{2}$ and the other half placed at $k=+\tfrac{N}{2}$...


2

You really have two questions -- one, is the Kalman filter applicable to linear hybrid systems, and the other is why isn't it used. I can't answer your second question. As for your first question (is it applicable) -- I think it could be made to be applicable. In fact, I strongly suspect that there's some fairly obvious combination of a Kalman-Bucy filter ...


0

If the input is $x[n]=\left(-\frac12\right)^n$ for all $n$, then the output is infinite, because the convolution sum doesn't converge. Note that also the input grows without bounds for negative $n$. If, on the other hand, the input starts at $n=0$, i.e., $x[n]=\left(-\frac12\right)^nu[n]$ then you can use the $\mathcal{Z}$-transform to compute the output: $$...


1

On when does the period of the discrete-time sinusoid decrease as the frequency increase. For a discrete-time sinusoid $x[n]$ of frequency $f_0$ $$ x[n] = x[n + N] \iff f_0 = \frac kN\tag{1} $$ where $k$ and $N$ are relatively prime integers. The condition in Equation $(1)$ is tantamount to $$ \omega_0 N = 2\pi k \tag{2} $$ What to note down is that discrete-...


0

To my understanding, CFO is SFO is So they are different. Could you explain that SFO is a mixture of STO and CFO?


3

You may solve it by 3 steps: Show yourself that a Cyclic Convolution with a vector $ \boldsymbol{e}_{i}^{N} $ is a Cyclic Shift Operator $ {T}_{i - 1} \left( \cdot \right) $. Where $ \boldsymbol{e}_{i}^{N} $ is defined as a vector of length $ N $ which all its elements is zero but the $ i $- th element which is 1. Decompose $ \phi $ into $ 3 $ vectors of ...


2

Your resulting audioFile in the line audioFile= length(audioFile) / distortionPeriod; is a single number and not a vector signal. And for this reason your audioFileFft and audioFileDftMat are computed from the processing of that number and not your initial signal vector in audioFile; which is not your intention. However if that line is for newLength, and ...


2

The command fft computes the FFT along each column of its input matrix. If I understand correctly, you want the FFT along the rows. One way to do that is audioFileFft = fft(audioFile'); The same can be done using the DFT matrix (albeit much less efficient): audioFileDftMat = dftmtx(distortionPeriod) * audioFile';


0

The standard deviation you got can't be right. The (unbiased) sample variance is given by $$s_x^2=\frac{1}{N-1}\sum_{n=1}^N\big(x[n]-m_x\big)^2\tag{1}$$ where $m_x$ is the sample mean: $$m_x=\frac{1}{N}\sum_{n=1}^Nx[n]\tag{2}$$ The standard deviation equals $s_x$, i.e., the square root of the sample variance. Note that the standard deviation does not equal ...


0

The standard deviation of your voltage samples will only be equal to the RMS of your samples if the average of your samples is zero. And that is not your situation here.


4

You're right that the periods of the two signals are very different. The period of a sinusoidal sequence $$x[n]=\cos(n\omega_0+\phi)\tag{1}$$ with $\omega_0=\pi/2$ equals $N=4$, whereas for $\omega_0=999\pi/1000$ it equals $N=2000$. But this is not what "frequency" refers to here. Note that in general the sequence $x[n]$ as defined in $(1)$ isn't ...


0

The period of $\omega_0 = 999\pi/1000$ is 2.0202. The period $\omega_0 = \pi/2$ is 4. So the period of $\omega_0 = 999\pi/1000$ is roughly half the period $\omega_0 = \pi/2$.


1

If you talk about a moving average filter then you only have a single degree of freedom, namely the filter length (i.e., the number of taps). Consequently, given the number of taps, the magnitude of the frequency response is fixed and the cut-off frequency is given. Note that you could also define the delay of the moving average filter as another degree of ...


1

You are right in your concerns here; as is obvious from the magnitude of the frequency response, a moving-average system does not block any portion of the spectrum except at those $M-1$ null frequencies, where $M$ is the length of the moving-average impulse response. However, it's also quite evident from the shape of the spectrum that high frequencies are ...


1

In discrete time, a frequency of zero is just a constant sequence, in complete analogy with continuous time. The main difference between discrete time and continuous time is that in discrete time you have a maximum frequency, whereas in continuous time you (theoretically) don't have one. That maximum frequency in discrete time is achieved for a sequence with ...


0

For the first two questions you just need to use the definition of the DTFT $$X(\omega)=\sum_{n=-\infty}^{\infty}x[n]e^{-jn\omega}\tag{1}$$ and use $\omega=0$ and $\omega=\pi$, respectively. For 3. you just need to use the definition of the inverse DTFT: $$x[n]=\frac{1}{2\pi}\int_{-\pi}^{\pi}X(\omega)e^{jn\omega}d\omega\tag{2}$$ Finally, for 4. and 5. you ...


1

The closed contour $C$ must lie inside the region of convergence, so for the ROC $|z|<2$ you have no poles inside $C$ for $n\ge 0$, hence $x[n]=0$ for $n\ge 0$.


2

HINT: It is based on the fact that $$\sin(x) = \frac{e^{jx} - e^{-jx}}{2j}\quad\text{and}\quad j^2 = -1$$


1

It's because $$ j \cdot ( a + b) = -\frac{a + b}{j} $$ which stems from the fact that the imaginary unit $j$ has the property : $$ j = \frac{-1}{j} $$


0

The first $5000$ points (well, $5001$ to be exact) contain all frequency information, because the signal is real-valued and, consequently, the spectrum is conjugate symmetric: $$X[k]=X^*[N-k]\tag{1}$$ where $N$ is the DFT length. But from $(1)$ we cannot infer all values of $X[k]$ from any arbitrary collection of $N/2$ (consecutive) points of $X[k]$. So you'...


Top 50 recent answers are included