We’re rewarding the question askers & reputations are being recalculated! Read more.

# Tag Info

21

The simplest approach is to do some kind of spline interpolation like Jim Clay suggests (linear or otherwise). However, if you have the luxury of batch processing, and especially if you have an overdetermined set of nonuniform samples, there's a "perfect reconstruction" algorithm that's extremely elegant. For numerical reasons, it may not be practical in all ...

18

In short: Upsampling: does/should not loose information (if done wisely), then safer, Downsampling: may loose information (if done unwisely), yet more computationally efficient. So if you compare data at different rates, and in an evaluation phase when one tries to define how the comparison should be done (which features are compared, with what metric, ...

11

For the purposes of this answer I will use Matlab's terminology and define "upsampling" as the process of inserting $m-1$ zeros in between the input samples, and "interpolation" as the combined process of upsampling and filtering to remove the $m-1$ aliases ($m$ being the interpolation factor) that upsampling introduces. For an explanation of how/why ...

11

Downsampling and upsampling are operations that change the sampling rate of a signal. Each one of them is composed of two steps, changing the sampling rate and filtering. Usually, the amount of change is expressed as a ratio. When downsampling, we are trying to take the signal from some $Fs$ to some $Fs_n < Fs$. The key problem with doing this is that we ...

9

One trick, for even-length signals, is what to do with the "middle" sample. Here, I've split it half and half between each side of the FFT. The other trick is to ensure that you have the right amplitudes in the resampled signal. Here's it's a factor of 2. Try this in scilab: x = rand(1,100,'normal'); X = fft(x); XX = 2*[X(1:50) X(51)/2 zeros(1,99) X(51)/...

7

The difference between cubic interpolation as described in your question and cubic spline interpolation is that in cubic interpolation you use 4 data points to compute the polynomial. There are no constraints on the derivatives. Cubic spline interpolation computes a third order polynomial only from two data points with the additional constraint that the ...

7

If you use a function like plot(x,y) the easiest way to display them on the same graph is to simply not resample any of them at all, but simply fill each x vector with proper values for each signal, so both appear where you want on the display. You can also setup the plot to have two different x-axes (one for each curve) with different labels and legends if ...

6

You want to have an interpolation with a equal number of weights on both sides of the points you want to interpolate in between. So you choose either one or two weights on each side, resulting in an interpolation of two (linear) or four (cubic) points. An quadratic interpolation would need three points, which would only make sense at the border of a grid, ...

6

This sounds like a problem of asynchronous sample rate conversion. To convert from one sample rate to another, we can compute the continuous time representation of the signal by performing sinc interpolation, then resample at our new sample rate. What you are doing is not much different. You need to resample your signal to have sample times that are fixed....

6

A recording originally at 8kHz and digitally upsampled to 16kHz will have almost no energy in the 4-8kHz range (whatever is here is due to imperfections in the filters used for the upsampling process). I would just use a 4kHz and 5.5kHz high pass; and use a threshold on the signal energy at the output of these filters. ... Unless your recordings are ...

6

Interpolation (sampling frequency 44.1 kHz ➔ 88.2 kHz) Your original 44.1 kHz sampled signal has frequencies up to 22.05 kHz, so you should lowpass filter at 22.05 kHz after dilution with zeros. Your filter should have a gain of 2. Otherwise the signal amplitude drops to half because you set half of the samples to zero. Like Jim Clay says, you can combine ...

5

You are looking at the wrong metric of "correctness". Nearest neighbor is introducing significant discontinuities that are showing up as massive quantities of noise in the result. The problem is that you should be comparing to the result you would have gotten if you had sampled at 26.25MHz in the first place. Let's try it (sample a 12Hz sine wave at 26 Hz ...

5

I think Jacob's answer is very workable. An easier method that's probably not quite as good in terms of introducing distortion is to do polynomial interpolation. I would use either linear interpolation (easy, not as good signal performance-wise) or cubic splines (still not too hard, better signal performance) to produce samples at any time you want from ...

5

For example a delay of 0.75 sampling periods would have an impulse response like this (red squares sampled from the blue delayed sinc): Time (horizontal axis) unit is sampling periods. That kind of a filter is not causal as there are non-zero samples at negative times. None of the samples is zero, no matter how far left or right you go. That's what they ...

4

Resampling won't change the signal duration. It will change the sample rate and the number of samples. And, if you're lowering the sample rate, it will change the frequency components of the signal (if done right, with a proper filter, it will reduce the maximum possible frequency to half the new sample rate). In order to make your signal "faster" or "...

4

The up-sampling process will always change the signal in some measurable way. However, if it's done properly the changes are negligible and don't result it any audible difference. Most commercially sample rate converters (hardware or software implementations), do a really good job at this. Off course, if done badly, upsampling can result in clearly audible ...

4

If N is odd it's a bit simpler: FF=2*[F(1:(N+1)/2),zeros(1,N),F((N+3)/2:N)]; ff=real(ifft(FF)); This is very close to what you had (apart from the scaling). Also note that due to numerical inaccuraces you have to take the real part of the IFFT operation. However, you should always check that the imaginary part (which you throw away) is very small (in the ...

4

Since Sinc based Interpolation requires you to know the data at any point it can not be done. You might do a Truncated Sinc Interpolation. The artifacts you're seeing can be caused by a kernel which is too short or the parameters aren't good. In order to create a good Sinc kernel you need to know things about the Band Width of the signal and the Sampling ...

4

If you perform the full DFT of a signal with odd number of samples, the frequency values in the spectrum are a DC coefficient and (N-1)/2 conjugate pairs of sinusoid coefficients. If you perform the full DFT of a signal with even number of samples, the frequency values in the spectrum are a DC coefficient, (N-1)/2 conjugate pairs of sinusoid coefficients, ...

4

Downsampling loses information. Upsampling is lossless when the factor is an integer (taken you also remember the factor), but some information is lost when the factor is not an integer. Upsampling could theoretically lose more information than downsampling, for very specific resampling factors. Which one you should use? It depends on the level of certainty ...

4

Since you have already properly low pass filtered the signal, then there is no risk in taking every other sample to complete the downsampling operation. If you were to create a low pass filter that passed your spectrum of interest with no distortion, and rejected all energy in the alias frequency locations then taking every other sample would provide a ...

3

More expensive computationally with marginal results. Most images don't require such interpolation technique. You can also look at this question: Higher order spline interpolation

3

I'll start by saying I don't know anything about GPS, but I believe WanderingLogic has answered the question correctly and I'll see if I can illustrate this with a simplified problem. Let's say the original transmitted signal is a simple sine wave of 1Hz. This will analogous to the transmitted signal from the GPS satellite, and by the way this is the ...

3

There are a couple of ways that you can do it. The first is with resample, but it is a multi-step process. First, you have to figure out which interpolation and decimation factors will get you the sample rate you want. [n, k] = rat(16000.1 / 128000); That gets you an interpolation factor of 20000 and a decimation factor of 159999. You factor those to ...

3

Jim's answer covers it quite well. All upsampling methods follow the same basic scheme: Insert zeros between samples: These results in a periodic repetition of the original spectrum but leaves the spectrum in the original band completely intact Low pass filter to get rid of all the mirror spectra The main difference between methods is how the low pass ...

3

The ratio of sample playback rates should be equal to the ratio of pitches you want to obtain. For example, if your C4 note was sampled at 48kHz, you'll need to play it back at $48000 \times \frac{277.18}{261.63} = 50.85kHz$ to make it sound like a C#4.

3

What should the bandwidth of the BPSK OFDM signal be after resampling? Is it 50 Hz (according to theoretical graph shown), 40 Hz (simulated before resampling) or 80 Hz? What you call resampling is actually modelling D/A conversion with a discrete simulation system. Resampling consists of a repetition of every sample plus low pass filtering. Your D/A ...

3

To add to Famous Blue Raincoat's comment: the process of upsampling a signal aims to increase its sampling rate without affecting the signal otherwise. In your example, outputting x or resx through your sound card should produce exactly the same sound. Upsampling is useful when you need to match sampling frequencies between different systems without ...

3

If you upsample a causal discrete-time signal $x[n]$ by an integer factor $L$ and you use an interpolation filter with a causal impulse response $h[n]$, the upsampled and interpolated signal is given by $$y[n]=\sum_{k=0}^{\infty}x[k]h[n-kL]\tag{1}$$ (Note that the requirement of causality can be easily removed; I just use it to have the lower summation ...

3

You are upsampling by a factor 5, which creates mirrors of the original spectrum (see the spectrum of $Yup$). With the filter you intent to remove these mirrors such that you can safely downsample the signal without aliasing. To prevent aliasing, the upper limit for your cutoff frequency is half the lowest sampling rate, which is $0.5*Fs2 = 10 kHz$. However,...

Only top voted, non community-wiki answers of a minimum length are eligible