New answers tagged

1

The Laplace transform of the original differential equation is $$Cs V_o(s) = V_i(s) \left( \frac{1}{R_1} \right) - V_o(s) \left( \frac{1}{R_1} + \frac{1}{R_2} \right)$$ $$R_1 R_2 C s V_o(s) = R_2 V_i(s) - (R_1 + R_2) V_o(s).$$ In the Laplace domain, the ratio $V_o(s)/V_i(s)$ is the transfer function for the circuit, $$H(s) = \frac{ V_o(s) }{ V_i(s) } = \frac{...


1

You can see how it falls out if you work through the simple case of N=2 (I've elided the 1/N for brevity) \begin{equation} \frac{(Y_{1}X_{1}^{*}+Y_{2}X_{2}^{*})(X_{1}Y_{1}^{*}+X_{2}Y_{2}^{*})} {(X_{1}X_{1}^{*}+X_{2}X_{2}^{*})(Y_{1}Y_{1}^{*}+Y_{2}Y_{2}^{*})} \end{equation} It should be pretty obvious that there are now some cross products. Multiplying through:...


1

To emphasize how two point sets differ, using dot and circle markers can be useful, because uneven centering is quite visible (from the comments): and the code is here: x = 0:pi/4:2*pi; v = sin(x); xq = 0:pi/16:2*pi; vq1 = interp1(x,v,xq,'spline'); vq2 = interp1(x,v,xq,'pchip'); plot(x,v,':.k',xq,vq1,'.r',xq,vq2,'ob'); legend('Original','Spline','PChip') ...


3

For clarity, I would write this DCT as: $$F(u) = \alpha(u)\sum_{i=0}^{N-1}f(i)\cos\left(\frac{\pi u}{2N}(2i+1)\right)$$ We note that, with this 1-indexing of Matlab: $$y[i+1] = f(i)\,.$$ Then I would modify the inner limit (from $0$ to $N-1$ instead of $1$ to $N$): for i = 0:N-1 sum = sum + y(i+1)*(cos((pi*(2*i+1)*u(j))/(2*N))); end and you can remove the ...


4

You have mistyped the formula, replace this line sum = sum + y(i).*(cos((pi.*(2.*y(i)+1).*u(j))/(2*N))); with the one below, and it works fine. sum = sum + y(i).*(cos((pi.*(2.*u(i)+1).*u(j))/(2*N)));


0

See the Wikipedia page on CRC computation for general information. Some software (byte-oriented) computations of CRC checksums use the method described in the paper "Computation of Cyclic Redundancy Checks via Table Look-Up". Communications of the ACM. 31 (8): 1008–1013 but there are lots of details that can be different in various implementations (...


2

The best way to understand cubic splines (under whatever name or how specified) is to derive and code them yourself. What you are looking for is a parametric equation with these properties: $$ \begin{aligned} f(0) &= y[n] = y_0\\ f(1) &= y[n+1] = y_1\\ f(2) &= y[n+2] = y_2\\ f(3) &= y[n+2] = y_3\\ \end{aligned} $$ Your candidate ...


0

Let us suppose that we have a discrete signal like: $1,\,0,1,\,0,1,\,0,\ldots,1,\,0$. If you downsample it by a factor of two, you either get $1,1,1,\ldots,1,$ or $0,0,0,\ldots,0,$. Thus downsampling can lose information, any time. And cannot increase frequency resolution by design ONLY! However, with several downsampled copies of a signal, one can ...


2

To answer the OP's question, downsampling alone does NOT change the frequency resolution. The simple answer is that the frequency resolution is determined from the total time duration of the data (this applies universally whether we are in the analog or frequency domain). For rectangularly windowed data of time duration $T$, the frequency resolution given by ...


3

Downsampling by a factor of $N$ in time-domain means that you throw away $N-1$ samples from $x[n]$ for every $N$ samples. In frequency domain this creates $N$ shifted copies of the original spectrum and expansion of frequency axis. The shifted copies are shifted by $\omega = 2\pi \frac{k}{N}, \ k = 0,1,2,...,N-1$. So, the DTFT of downsampled sequence $x_D[n]$...


1

For each sample, we note $1$ if error and $0$ otherwise. Then, for bit error rate $q$, the tests are independent Bernoulli random variables $\{X_i\}$ with probability $q$. The estimate is $\hat{p} = \frac{S}{n}$ where $$S = \sum^n_i X_i \tag{1}$$ and $\mu = \mathbb{E}[X] = np$. Chernoff bound (see Corollary 5) tells us that for every $0 < t < \mu$, $$\...


0

If you mix up to $f_c$, but then use a filter with cut-off frequency of $f_c$, you're not downconverting your signal to baseband at all. You're just cutting off half the signal. I think you want to re-visit the block diagram of the receiver architecture you're trying to implement. You're most definitely missing the important step, but since I'm not sure what ...


1

If the signal is oversampled and the PSF variation corresponds (approximately) to a smooth local compression/expansion, perhaps you can resample y so as to make the PSF approximately LTI, then apply conventional methods (somewhat akin to homomorphic processing) If the input signal is convolved with a small discrete set of PSFs, perhaps you can devonvolve ...


5

can we have re-configurable analog filters? Yes. The knob you turn on your grandma's kitchen or living room radio changes the tuning of an oscillator by changing the capacitance of a component. Any stable oscillator is essentially a filter for its resonant frequency. Also, plenty of other examples: Tunable RC filters with adjustable R; mechanically tunable ...


1

If the constellation at the tarsmitter is symmetric about 0 on the real line then you can simply threshold the output between -1 and +1 with 0 as the threshold. So anything above zero is a logical 1 and everything below zero is a logical 0. This detection is rule is optimal when the noise is additive.


1

CRC is a "definite" indicator of the channel impacting the bits and error in received symbol. So deploying a CRC check would definitely help. Length of CRC would depend on the overall system and data packets.


0

The OP is trying to do what we would refer to as channel estimation. I am linking two posts below where this is all worked out in greater detail but do want to make the point first that the choice of "sounding pattern" is important. The channel can only be estimated where there is signal energy in the frequency domain, so the sine sweep is an ...


1

I suspect that the reason for the difference is the number of samples used in the plot, since the extreme points are likely going to infinity (or very large numbers) such that if less points are used, those large values are simply missed in the computation. If the OP uses the same number of points in each, then the same result should be achieved- and for all ...


1

Is what I am doing correct? Yes If not, how would I reproduce the SINAD function? By replicating the exact same algorithm that the Matlab function uses. Your answer is more correct, but you also "cheated". You have access to the original sine and noise signals. sinad() ONLY has access to the sum of both. Hence it needs to do an estimation using ...


0

As pointed out by Hilmar in a comment, you should remain in the discrete domain. This is most easily done by using the functions freqz() and zplane(): b = [.8,1]; a = [1,.8]; [H,w] = freqz(b,a,2048); subplot(2,1,1), plot(w/pi,abs(H)); subplot(2,1,2), plot(w/pi,angle(H)); figure, zplane(b,a) Note that for a first-order all-pass filter it's also quite ...


2

The variable NI in the book is just a typo, it should be N instead (not N*L as in your code). Apart from that, remember that book was written about $25$ years ago, and the code was run on a $33$ MHz $486$ PC. So in order to see some effects on today's computers, you should crank up the value of L. I've modified the code a bit (see below). Now the figure ...


0

same as your previous RRC question: you simply apply a digital filter that approximates the analog filter. There's no analog signals in your PC, and OFDM is a digital signal anyway, so only the digital equivalent of the analog system would matter to the receiver, anyway. Look at it this way: You're supposed to simulate a digital system. Therefore, the ...


1

The typical method is to use the cross correlation function to recognize the start of each pulse sequence. Typically pulse patterns are chosen for good autocorrelation properties for this very purpose (likely the start of the packet as a header if there is a random data payload also involved). "Good autocorrelation properties" refer to an ...


4

Here's Octave code for a (digital) RRC filter: pkg load signal; % Octave needs this; MatLab doesn't Fs = 16000; % sample rate Rs = 400; % symbol rate sps = Fs/Rs; % samples per symbol % % Root raised cosine pulse filter % https://www.michael-joost.de/rrcfilter.pdf % r = 0.22; % bandwidth factor ntaps = 8 * sps + 1; % Pulse duration is 8 symbols st = [-...


0

I set window length as 512 to see more frequencies and overlap on 256 (as default), is this correct? No, the number of frequencies (i.e. frequency bins) will depend on the NFFT argument of your spectrogram function and will be equal to $NFFT / 2$. Also note that the frequency bins do not represent a single frequency component but rather have a fixed ...


0

You can use the lsim command, it works for discrete and continuous systems. https://www.mathworks.com/help/control/ref/lsim.html In your case, the 'sys' variable should replaced by tf(num,den)


0

The principle behind FMCW is that you transmit a chirped signal and receive a time delayed version of it after reflecting from a target. After mixing and filtering, the resulting signal is a sinusoid at a frequency that is a function of the target's range. This frequency is known as the "beat" frequency $f_b$. Thus, the dechirped signal will have a form of $...


0

One approach could be to get a finite number of values of the impulse response of your system using the 'impulse' function, and then convolve this with your signal (taking care of the actual sampling frequency you are using). % sampling time of 1ms, 20s of time signal T = 0.001; t = 0:T:20; % low pass filter with cutoff frequency at sine frequency wo = 1; ...


0

µ-law is defined for real-valued PCM signals only. You will either need to produce a real-valued signal containing OFDM as passband signal, either by mixing it to a carrier frequency, or by modifying your OFDM system to only produce symmetrical spectrum baseband, or by u-law coding I and Q separately (but that makes little sense, since a high PAPR happens ...


0

A couple of guesses Your bandpass has about 20 dB of gain at the resonance frequency, so it's quite possible that you are clipping something downstream You do block based processing: that means you need to carry the values of the state variable over from one block to the next. You only initialize on the first block You will also get artifacts each time when ...


0

I wrote this to detect shapes that I know before hand (like sawtooth and steps). So if your "peak" shapes are consistent, it could find those two without changing the original signal. You need to play with parameters, but I think it will work: https://www.mathworks.com/matlabcentral/fileexchange/61291-shape_projection_filter?s_tid=prof_contriblnk And ...


1

First you will need to build the frequency tables for each note scale ex. [B, A, G, F, E, D, C], you will need say what scale you will use to compare with each window pitch, of course you also have to worry that your frequency table includes major or minor chords. But the essence of one basic autotunes works by adjusting to the chromatic scale, In other ...


0

This question has multiple facets (after comments), so I will focus on the principal. First, regarding coefficient localization: a discrete wavelet coefficient depends on several signal samples. The number of coefficients influenced by a single sample in a continuous wavelet representation typically depends on the properties of the mother wavelet and the ...


2

Note that a biquad has $5$ degrees of freedom (not $6$), because $a_0$ can always be chosen as $a_0=1$ without loss of generality: $$\begin{align}H(z)&=\frac{b_0+b_1z^{-1}+b_2z^{-2}}{1+a_1z^{-1}+a_2z^{-2}}\\&=b_0\cdot\frac{1+\hat{b}_1z^{-1}+\hat{b}_2z^{-2}}{1+a_1z^{-1}+a_2z^{-2}},\qquad \hat{b}_1=\frac{b_1}{b_0},\;\;\hat{b}_2=\frac{b_2}{b_0}\tag{1}\...


0

It is simply a scaling. If you use $b0=1$ for example, you have the values for $b2$ and $b1$ directly. In contrast if you use $b0=2$ then the filter would have twice the gain and the values for $b2$ and $b1$ would be double. It is that simple. Where you really need to pay attention to the actually scaling used is when you implement the filter with fixed ...


0

For a filter with an input that you know will have a dc component, initialize the filter states (delay line) with the first sample. Matlab have a dedicated function for this, filter_ic(). Another option, as suggested by hotpaw2 1. Subtract the assumed DC 2. Filter 3. Add the DC back in


0

If you know exactly what to look for (3 sines of known duration, frequency, relative phase/amplitude), perhaps you can simply use that as a template in a matched filter, regarding anything else as noise and ad-hoc find a suitable threshold? It might seem expensive to run a full-rate convolution of thousands of taps. Recognizing that your signal bandwidth is ...


0

If the offset is known, or can be determined before applying the filter, you can subtract the offset from the signal before applying the filter, then add the offset back after filtering. If you don't know the offset, neither will the filter when it first starts.


1

Have you considered reading the documentation ? https://www.mathworks.com/help/curvefit/fit.html Goodness-of-fit statistics, returned as the gof structure including the fields in this table. sse: Sum of squares due to error rsquare: R-squared (coefficient of determination) dfe: Degrees of freedom in the error adjrsquare: Degree-of-...


1

Hi Nouali Ibrahim Yassine, Without any additional information about the two signals, what you are trying to do is a blind source separation. This means that you will have to use a set of advanced statistical tools ( principal components analysis or independent component analysis for example, I would go more for the Independant component analysis) to try to ...


0

I don't think OFDM uses a raised cosine filter, that breaks orthogonality.


0

The plots are changing i.e. you are changing inputs to the model (be it random input sequence , random channel matrix , random gaussian noise ) .. there are lot of random combinations here.. which will definitely change the plot.. you cannot expect to have same plot everytime when you are dealing with random numbers.. You can control with using same seed in ...


0

$n$ is the time index for the samples of $y$, $x$, etc. So you can express the 1st sample, 2nd sample, etc., of each signal, with reference to the reference 0 time, for $n=1$, $n=2$, etc. When $x$ is passing through a wireless channel, the result at the channel output is not just $x$, but there is some noise, $w$, and the wireless channel also will result ...


1

Below is a sample MATLAB/pseudocode to generate a 4x4 MIMO system, for 1000 Monte Carlo trials: M=4; MC=1000; H= randn(M,M,MC); x=randn(M,1,MC); w=randn(M,1,MC); Y=zeros(M,1,MC); for j = 1:MC Y(:,:,j)= H(:,:,j)*x(:,:,j) + w(:,:,j); end This would generate y according to the equation in the question. You can view the MC values as different time ...


1

Your system H(s) is continuous $$ H(s) = \frac{s}{s+1} $$ Using a discrete impulse does not make a lot of sense. I suspect Simulink added a "zero-order hold" or ZOH block between your discrete impulse and your system $H(s)$. As such, your impulse response will be affected by the sampling period of your discrete impulse source. If you decrease the sampling ...


3

A bump like this one is likely to be wide-band, especially with the sharp onset. Plus, the line may be hard to deal with in the Fourier domain. Hence, the combination is complicated to remove with a classical linear filter. The problem is very akin to baseline, background or trend removal, answered elsewhere here. Several options are possible, for ...


0

We cannot design an ideal filter! So we should trade off our requirements and approximate the best filter. In this case: b=firls(63,[0,0.25,0.28,1],[1,1,0,0]); figure() freqz(b) may be an acceptable solution. Also we can use fir1 function instead.


0

n is indicative of time. It shows how the input and noise impact the received symbol with time n. If x and w are vectors at time n (let's say of length M), which give the corresponding received vector y, since you take h to be a scalar. Such a system would be a strange MIMO system with only links between transmit and receive antennas pairs and each antenna ...


0

I beleive that h can be a vector or scalar .. depends on channel taps i.e. h y[n] = hx[n] + w[n] -- indicates h convolved with x[n] and then added to noise w[n]


1

Adopted from the Matlab doc: N=40; mu = ones(1,2); sigma = eye(2); R = chol(sigma); z = (mu + randn(N,2)R)[1; 1j]


Top 50 recent answers are included