Reply by Peter Mairhofer June 16, 20142014-06-16
Hi Markus,

On 2014-06-14 5:40, mnentwig wrote:
> Hi Peter, > > I've been using Agilent MXA and earlier Rohde&Schwarz for that > purpose. It may be a hardware limitation (don't know Tektronix)
So does it mean you also never set the sampling rate explicitely but just used MATLAB postprocessing?
> but it's easy to work around in Matlab. I usually work with cyclic > signals - the generator plays back a loop - so I don't need to care > about synchronization and the DUT is in thermal steady state. > > Below some Matlab / Octave resampling code that converts between any > integer number of samples, using ideal lowpass if decimating. If you > don't want to assume signals are cyclic, use zero padding (using > twice the original length works always). For cyclic signals and > Nyquist resampling, the result is exact to machine precision (~300 > dB, give or take some).
Thanks, that's a great start! I am still not completely sure about it. So td2td_noncausalResampler is just supplied the integer number of samples you want, right? Doesn't this still require an integer multiple between the two sampling rates (same as for "resample")? In my case, fs1=30.72MHz, fs2=150MHz, fs2/fs1=4.8828 Just as an example, an LTE20 signal with 7 symbols, 1 slot gives me 15360 samples at 30.72MHz which I send to the MXG (vector "x"). With the Tektronix I receive 131072 samples at 150MHz (vector "y"). If I understand your code correctly I would use x = td2td_noncausalResampler(x, fs2/fs1) However, that's non-integer. Even if I use periodic repetition, this factor is still non-integer :(
> BTW, once the signals are back at the same rate, I use this > subroutine for timing alignment: > http://www.dsprelated.com/showarticle/26.php
thanks - exactly this I use already - for some time :) Great article! Peter
Reply by mnentwig June 14, 20142014-06-14
Hi Peter,

I've been using Agilent MXA and earlier Rohde&Schwarz for that purpose.
It may be a hardware limitation (don't know Tektronix) but it's easy to
work around in Matlab. 
I usually work with cyclic signals - the generator plays back a loop - so I
don't need to care about synchronization and the DUT is in thermal steady
state. 

Below some Matlab / Octave resampling code that converts between any
integer number of samples, using ideal lowpass if decimating. 
If you don't want to assume signals are cyclic, use zero padding (using
twice the original length works always). For cyclic signals and Nyquist
resampling, the result is exact to machine precision (~300 dB, give or take
some).

BTW, once the signals are back at the same rate, I use this subroutine for
timing alignment: 
http://www.dsprelated.com/showarticle/26.php

Cheers

Markus

function td = td2td_noncausalResampler(td, n)
    nOld = numel(td);
    realFlag = isreal(td);
    
    if n == nOld
        return;
    end
    
    fd = fft(td);    
    
    if n > nOld
        n1 = ceil(nOld / 2);
        n2 = nOld - n1;
        fd = [fd(1:n1), zeros(1, n-nOld), fd(end-n2+1:end)];
    else
        n1 = ceil(n/2);
        n2 = n - n1;
        fd = fd([1:n1, end-n2+1:end]);
    end
    td = ifft(fd * n / nOld);
    
    if realFlag
        td = real(td);
    end
end
	 

_____________________________		
Posted through www.DSPRelated.com
Reply by Peter Mairhofer June 14, 20142014-06-14
Hi,

Is anyone using equipment like a VSA for data capture? Any idea how I
can set the sampling rate in a Tektronix RSA? Whatever I set (e.g. using
SENSe:ACQuisition:BANDwidth or SENSe:IQVTime:FREQuency:SPAN), the
sampling rate is always 150 MHz! Frustrating...


With an Agilent MSG I am transmitting an LTE signal which is sampled at
30.72MHz and to be received by the Tektronix VSA. (But I can set an
arbitrary rate for the MXG). I would really like to have the
"transmitter" and "receiver" to share the same rate to simplify all the
my DSP in MATLAB.

If this is really not possible (how can that be for an expensive box
like this?) what is the fastest way to make my transmitted and received
signals compatible in MATLAB? "resample" only works for integer
multiples of sampling rates. I could also use "upsample" first and then
"downsample" but I immideately get an error that the filter is too large
(or out of memory).

Thanks
Peter