7 views (last 30 days)
kale on 3 Jan 2023
Commented: Paul on 5 Jan 2023
I would like to simulate on Matlab a PAM signal which, travelling on a time-dispersive communication channel, contains intersymbol interference (ISI).
I have 'built' the transmitter by generating:
• M-PSK signal/sequence
• designing the impulse response p(t) of a root of raised cosine
• upsampling
• filtering
So I have the signal ready to transmit ... but without ISI. Now I want to simulate/insert 'L' echoes of the time-dispersive channel.
In the transmission I don't want to have p(t) but a delayed version of it .. so I want the impulse p(t) to be born already with echoes .. for example like this: p(t)+a1*p(t-Ts) with Ts=symbol interval. Therefore I must linearly combine 2 or 3 appropriately delayed replicas of the impulse response in the absence of ISI. But how do I achieve it?
The professor advised me to use "the function that implements the filter impulse response with delay "... but what function is he talking about?
Paul on 4 Jan 2023
Edited: Paul on 4 Jan 2023
So p(t) is a continuous-time signal represented by samples p[n] = p(n*T) where T is the time spacing. Ts is an arbitrary delay, not necessarily an integer mutliple of T. How do you want to represent p(t) between samples of p[n]. Linear interpolation? Something else?
Reading through this comment thread, I'm not sure if where I'm headed with this is where you should be going ...
kale on 4 Jan 2023
p(t) is what is theoretically referred to as the 'pulse' for the PAM signal, i.e. I have chosen (as is often the case) the root raised cosign.
I didn't actually define it explicitly on Matlab, I wrote these steps:
M = 8;
psklev = exp(1j*2*pi*(0:M-1)/M); % M-PSK levels
l = randi([0 M-1], Nsym, 1); % generate Nsym random M-ary symbols
[lg, ~] = togray(l, mb); % Gray mapping
seq = psklev(lg+1);
coeff = rcosdesign(a=0.35, L=30, Ns=10, 'sqrt') % it's discrete, in fact I use the 'stem' command to print it out)
seq_upsample = upsample(seq, Nc=Ns)
seq_filt = filter(coeff, 1, seq_upsample); % this signal is ready to be transmitted, it does not contain ISI
These are the salient steps, but I can send you the whole live script if you need it.
To the seq_filt signal I must add intersymbol interference ... and the professor recommended me to delay the impulse p(t), already creating it with echoes. For example like this: p(t)+a1*p(t-Ts) with Ts=symbol interval.
In the code I have, I do not understand what p(t) is and how I should proceed to achieve this.

Paul on 4 Jan 2023
Maybe this will help:
Let's assume we have a simple FIR filter that takes the average of the current and two previous samples of a signal. That filter would have a transfer function of
H(z) = (1 + z^-1 + z^-2)/3;
In Matlab, we represent this as:
b = [1 1 1]/3; a = 1;
Suppose we have some input sequence, u[n]. Then we know that
Y(z) = H(z)*U(z)
Here we just use a random sequence
rng(100);
u = randn(100,1);
The output of our filter, y[n], in response to u[n] is
y = filter(b,a,u);
Suppose we want to delay the output y by 3 samples. Well, that means that the z-transform of the delayed output is z^-3*Y(z), or
z^-3*H(z)*U(z). So can mutiply H(z) by z^-3 and then run u through that. z^-3 is represented by
z3 = [0 0 0 1]; % 0 + 0*z^-1 + 0*z^-2 + 1*z^-3;
Polynomial multiplication is implemented with conv. So the delayed signal is
y3 = filter(conv(z3,b),1,u);
Plot the output and delayed output, and their sum
subplot(211);plot([y y3])
subplot(212);plot(y+y3)
kale on 5 Jan 2023
Edited: kale on 5 Jan 2023
Thank you for the example! Everything is now clearer.
So basically I have two filters:
- the first filter generates the coefficients (without delay) of RRC impulse given by coeff=rcosdesign(...)
- the second filter adds the delay/ISI to the coefficients generated by the first. So the output of the first filter is the input of the second one
Following your example, I focus only on the second filter (I have already implemented the first one) and my question now is:
if with the second filter I want to delay by 8 samples each of the samples/coefficients of the first filter RRC ..is it correct to do as I did here?
coeff = rcosdesign(alpha=0.35, L=30, Ns=10, 'sqrt') % Ideal! Without delay
% now I delay the the coeff by 3 samples:
z = [0 0 0 0 0 0 0 0 1]; % 0 + 0*z^-1 + 0*z^-2 + 0*z^-3 ... 1*z^-8;
coeff_delay = filter(z3,1,coeff);
subplot(2,1,1);
stem((-L/2:1/Nc:L/2),coeff)
title('RCC Impulse response :)');
subplot(2,1,2);
stem((-L/2:1/Nc:L/2),coeff_delay);
title('RCC Impulse response + delay :(');
Do you think I should add these two signals together in the rest of the programme? (as you did in y+y3). Or should I just use the second one? (i.e. y3)
Thanks!
Paul on 5 Jan 2023
Maybe it's just a terminolgy thing, but I don't understand what you mean by delaying coefficients of a filter. Signals get delayed, not filter coefficients.
Anyway, it sounds like you have a signal u[n] going through a filter H(z) = b(z)/a(z)
y = filter(b,a,u);
Now you want to take that output, and delay it by 8 samples.
b8 = [0 0 0 0 0 0 0 0 1]; % 0 + 0*z^-1 + 0*z^-2 + 0*z^-3 ... 1*z^-8;
y8 = filter(b8,1,y);
It sounds (pun intended) like you want to add y and y8 together to get some sort of echo effect on the original signal. But I'm not really sure what you're trying to do.