0
$\begingroup$

I wrote this simple matlab code to calculate input impedance of a low pass filter but not sure whether all the steps are correct. * First attempt

z0           = 50;

A            = importdata("sparameters_lowpass.dat");

freq         = A(:,1);
realPart     = A(:,2);
imagPart     = A(:,3);

s11_freq     = realPart + imagPart*i; % In frequency domain

%X           = fft(s11_freq, N); % Not sure whether this is the right way to interpolate

X            = s11_freq;

X_conj       = conj(flip(X));

X_input      = [X_conj(1:end-1)', X(1), X(2:end)']';

M            = length(X_input);

window       = hamming(M);

s11_time     = ifft(X_input.*window, 1024);

z_in         = z0*(1+ (s11_time))./(1- (s11_time));

$\endgroup$
  • $\begingroup$ Your data is already in the frequency domain---- it sounds like your challenge is just in how to interpolate your results. To me you are doing a lot more than is needed- I would just compute z_in on the s11_freq data directly and then you can interpolate that using the resample command. $\endgroup$ – Dan Boschen Feb 11 at 14:00
  • $\begingroup$ The idea is to tune a filter in time-domain just like time domain analysis with Network Analyzer. More over the length of the filter and so on. I myself is rather very new to this... $\endgroup$ – jomegaA Feb 11 at 14:55
  • $\begingroup$ Well I don’t think you can get there using this approach— the network analyzer will have a resolution bandwidth and sweep rate that will effect the temporal characteristics of your signal (and I assume within the duration of your capture the impedance hasn’t changed). Your measurement of S11 is the static measurement of S11 vs frequency not time. $\endgroup$ – Dan Boschen Feb 11 at 15:37
  • $\begingroup$ modification to above comment: "...and sweep rate that will effect the measurement of the temporal characteristics of your signal". The network analyzer won't change your signal as my first version of this sentence would literally imply. $\endgroup$ – Dan Boschen Feb 11 at 17:53
  • $\begingroup$ Since its first project in signal processing after 17 years (some work during University studies) and I have little or no clue on some or many things. But having very good time in reading Classics such as Digital Signal Processing - Proakis. Any recommendation read for Filter Design? $\endgroup$ – jomegaA Feb 11 at 18:24
0
$\begingroup$

S11 is in the frequency domain, and the impedance should also be in the frequency domain. If you want to resample the result, simply use the resample command:

z0           = 50;
A            = importdata("sparameters_lowpass.dat");
N            = 5000;      % number of samples in final result desired

freq         = A(:,1);
realPart     = A(:,2);
imagPart     = A(:,3);

s11_freq     = realPart + imagPart*i; % In frequency domain

z_in         = z0*(1+ (s11_freq))./(1- (s11_freq));

freq_resamp = resample(freq, N)
z_in_resamp = resample(z_in, N)

Note that your formula for S11 would be correct when it is given as a complex signal with a magnitude between 0 and 1 and any phase. Just a word of caution in case the result is in dB magnitude and phase (I don't think that is the case given the extraction of the real and imaginary part shown but that should be confirmed).

| improve this answer | |
$\endgroup$
  • $\begingroup$ s11 = realPart + imagPart*i; % In frequency domain s11_resamp = resample(s11, N, 1); s11_time_zero_pad = [ifft(s11)' zeros(1,N-length(s11))]; s11_freq_interpol = fft(s11_time_zero_pad); Are they same? Long wonder how to interpolate spectrum without transforming it to time-domain, zero-pad and transform to frequency domain? $\endgroup$ – jomegaA Feb 17 at 20:19
  • $\begingroup$ They are equivalent and possibly but not necessarily identical. The actual resampling implementation has an interpolation filter and depending on its implementation can change the results (if you are looking for exact equivalence but will generally provide the same result). $\endgroup$ – Dan Boschen Feb 17 at 21:14
  • $\begingroup$ Is there a way to interpolate a spectrum without transforming the spectrum to TD and zero-pad the signals and transform it back to frequency domain? My gut feeling is not possible* $\endgroup$ – jomegaA Feb 17 at 21:20
  • $\begingroup$ Yes of course — insert zeros and then use an interpolation filter all from the same domain. There are other posts here on doing just that, that I can point you to $\endgroup$ – Dan Boschen Feb 17 at 21:25
  • $\begingroup$ Sure. Would like to see those posts. Meanwhile I can also search them. Other obvious questions are how are zero-padding performed on low pass and band pass signal without carrier or rather what has to be considered on performing zero-padding of low-pass and band-pass spectrum without carrier? Zero padding in frequency domain for $N$ even and odd cases are known. $\endgroup$ – jomegaA Feb 17 at 21:30

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.