MATLAB Answers

How to implement triple summation?

49 views (last 30 days)
Usha Sree Katikala
Usha Sree Katikala on 17 Mar 2021
Edited: Matt J on 9 Apr 2021
  3 Comments
Usha Sree Katikala
Usha Sree Katikala on 9 Apr 2021
I have made an attempt in implementing individual parts of this equation.I need help in combining them as triple summationThe code is:
.
clear all
close all
[x1,Fs] = audioread('C:\Users\admin\Downloads\OSR_us_000_0061_8k.wav'); % audio signal assumed as transmitted signal
values= x1(1:100); % array of received signal x(n)
Nsamps = 100; % number of samples taken from the input signal
t = (1/Fs)*(1:Nsamps)
plot(t, values)
title('signal');
xlabel('Time');
ylabel('Amplitude of signal');
xc=complex(values); % complex of received signal
%SI Signal model
p=3; % high non-linearity order
q=2;
M=0; % memory length
for i= 0:q
M=M+1;
first=2*(delayseq(values,M)); % x(n-m)^q
end
M=0;
for i=0:p-q
M=M+1;
xc1= 2*(delayseq(xc,M)); % x*(n-m)^p-q
end
cf=first.xc1; % x(n-m)^q * x(n-m)^p-q
g=1.012; %g-> gain imbalance
phi=1; % phi-> phase imbalance.
%%% K1 and K2 are the constants in the IQ Modulator output signal%%%
%%% model(frequency independent model)%%%
K1=1/2*(1+g*exp(i*phi)); % K1
K2=1/2*(1-g*exp(i*phi)); % K2
K1abs=abs(K1); % |K1|
K2abs=abs(K2); % |K2|
%%% h1,h2,h3,h4 are Basis function coefficients for P=3 %%%
h1=K1*K1*complex(K2);
h2=(power(K1abs,2)K1)+(2(power(K2abs,2)*K1));
h3=2*(power(K1abs,2))*K2+power(K2abs,2)*K2;
h4=K2*K2*complex(K1);
Can someone help me to solve the triple summation part?

Sign in to comment.

Answers (1)

Matt J
Matt J on 9 Apr 2021
Edited: Matt J on 9 Apr 2021
Well, for each fixed p and q, the inner sum over m is just a discrete convolution. So, perhaps the best solution is to do a double loop over p and q and add up conv() output.
r=0;
for p=1:P
for q=0:p
r=r+conv(____,shape)
end
end
One advantage to this approach is that you can use conv's 3rd argument shape to deal with array edge conditions.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!