0
$\begingroup$

I am pretty new to signal processing. I am currently trying to reconstruct a sampled band-pass signal created with the filtfilt and cheby2 MATLAB functions. I am trying to do this with sinc interpolation, but I do not know what the discrete reconstruction formula is. I know that

$$h(t) = f_s \cdot \text s \text i \text n \text c(\frac{t \cdot f_s}{2}) \cdot \text c \text o \text s (2\pi t f_s \frac{2n + 1}{4})$$

but I cannot be able to find the corresponding discrete implementation of this - i.e. the equivalent of $$\sum_{n = -\infty}^{\infty} x_n \cdot \text s \text i \text n \text c (t\cdot f_s - n)$$ for the low-pass filter reconstruction that has $$h(t) = f_s \cdot \text s \text i \text n \text c (t\cdot f_s)$$

Can sombody shed some light on this? I have been struggling for a lot of time with this issue (trying different implementations that didn't quite give the right result), but I think the solution should be rather straightforward.

$\endgroup$
  • $\begingroup$ You define $h(t)$ twice, What is the signal that you sampled? $\endgroup$ – Engineer Nov 3 at 12:42
  • $\begingroup$ @Engineer the second definition was just to exemplify what I want to achieve i.e. the discrete sum represented by h(t). I essentially have a random signal that has been band-pass filtered with cheby to attenuate frequencies outside a certain interval. I am sampling this at 30Hz and I want to use sinc interpolation (with that h(t) function) to obtain the 3000Hz version of the signal. I want to find the required sum that I can apply on my discrete 30Hz signal to achieve this. Does this make sense? $\endgroup$ – Andrew Nov 3 at 13:43
  • $\begingroup$ So you have a signal sampled at 30 Hz and want to do a rate conversion to 3000 Hz? $\endgroup$ – Engineer Nov 3 at 22:10
  • $\begingroup$ @Engineer Yes, it is a band-pass signal and I want to do sinc interpolation to achieve that. $\endgroup$ – Andrew Nov 3 at 22:32
0
$\begingroup$

You want to take a signal with sample rate 30 Hz and upsample the signal to 3 kHz rate and then pass it through a low pass filter to perform the sinc interpolation. In MATLAB, you have a couple options:

  1. You could use the built-in interp function. You will need to pass it your signal and the upsample factor (3,000 / 30 = 100). The function will figure out a low pass filter to use and do everything for you. You can also get the filter it used (read the documentation to see how).

  2. You could do it by hand by calling upsample, then design the filter by using the designfilt function for example.

Lets compare the two different methods:

fs1 = 30;
fs2 = 3000;
L = fs2/fs1; % upsample factor
N = 1000; % number of samples in original signal
t = [0:N-1].'/fs1;
sig1 = cos(2*pi*5*t);
upsampledSig1 = L*upsample(sig1, L);
lpFilt = designfilt('lowpassfir', 'PassbandFrequency', 0.25/L, 'StopbandFrequency', 0.5/L, 'PassbandRipple', 0.1, 'StopbandAttenuation', 95, 'DesignMethod', 'kaiserwin');
filterDelay = floor(length(lpFilt.Coefficients)/2);

Now lets use the MATLAB interp function and compare it against our "hand-made" method.

interpSig = interp(sig1, L);
paddedSig1 = [sig1; zeros(filterDelay, 1)];
mySig = filter(lpFilt, paddedSig1);
mySig = mySig(filterDelay+1:end); % strip off filter delay

As you can see, the results are similar with the only difference being a slight scaling difference which can easily be taken care of.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.