Is There a Missing 'rcpulse' Function in Your MATLAB Code?

Click For Summary
SUMMARY

The discussion centers on an error encountered in MATLAB code for SCFDMA, specifically the undefined function 'rcpulse'. The user reports an error at the line "psFilter = rcpulse(Ts, Nos, rolloffFactor);" indicating that the function is not recognized for input arguments of type 'double'. The code snippet provided outlines the parameters for a raised-cosine filter, including the rolloff factor and oversampling factor, which are critical for pulse shaping in the context of signal processing.

PREREQUISITES
  • Understanding of MATLAB programming and syntax.
  • Familiarity with signal processing concepts, particularly pulse shaping.
  • Knowledge of raised-cosine filter design and its parameters.
  • Experience with SCFDMA (Single Carrier Frequency Division Multiple Access) modulation techniques.
NEXT STEPS
  • Implement the 'rcpulse' function in MATLAB to define the raised-cosine pulse shaping filter.
  • Explore MATLAB's built-in functions for signal processing to find alternatives to 'rcpulse'.
  • Study the effects of different rolloff factors on pulse shaping in communication systems.
  • Learn about the 'rrcPulse' function for root raised-cosine filtering and its applications.
USEFUL FOR

Signal processing engineers, MATLAB developers, and researchers working on communication systems, particularly those focused on modulation techniques and pulse shaping in SCFDMA applications.

imranisrar
Messages
1
Reaction score
0
here is my MATLAB code of SCFDMA i am getting error at line "psFilter = rcpulse(Ts, Nos,rolloffFactor);" error is Undefined function or method 'rcpulse' for input arguments of type 'double'": function paprSCFDMA()

dataType = 'Q-PSK'; % Modulation format.

totalSubcarriers = 256; % Number of total subcarriers.

numSymbols = 64; % Data block size.

Q = totalSubcarriers/numSymbols; % Bandwidth spreading factor of IFDMA.

Q_tilda =3 ; % Bandwidth spreading factor of DFDMA. Q_tilda < Q.

subcarrierMapping = 'IFDMA'; % Subcarrier mapping scheme.

pulseShaping = 1; % Whether to do pulse shaping or not.

filterType = 'rc'; % Type of pulse shaping filter.

rolloffFactor = 0.5; %Rolloff factor for the raised-cosine filter. %To prevent divide-by-zero, for example, use 0.099999999 instead of 0.1. Fs = 5e6; % System bandwidth.

Ts = 1/Fs; % System sampling rate.

Nos = 4; % Oversampling factor.

if filterType == 'rc' % Raised-cosine filter.

psFilter = rcpulse(Ts, Nos,rolloffFactor);

elseif filterType == 'rr' % Root raised-cosine filter.

psFilter = rrcPulse(Ts, Nos, rolloffFactor);
end

numRuns = 1e4; % Number of iterations.

papr = zeros(1,numRuns); % Initialize the PAPR results.

for n = 1:numRuns,

% Generate random data.
if dataType == 'Q-PSK'
tmp = round(rand(numSymbols,2));
tmp = tmp*2 - 1;
data = (tmp(:,1) + j*tmp(:,2))/sqrt(2);
elseif dataType == '16QAM'
dataSet = [-3+3i -1+3i 1+3i 3+3i ...
-3+i -1+i 1+i 3+i ...
-3-i -1-i 1-i 3-i ...
-3-3i -1-3i 1-3i 3-3i];
dataSet = dataSet / sqrt(mean(abs(dataSet).^2));
tmp = ceil(rand(numSymbols,1)*16);
for k = 1:numSymbols,
if tmp(k) == 0
tmp(k) = 1;
end
data(k) = dataSet(tmp(k));
end
data = data.';
end
% Convert data to frequency domain.
X = fft(data);
% Initialize the subcarriers.
Y = zeros(totalSubcarriers,1);
% Subcarrier mapping.
if subcarrierMapping == 'IFDMA'
Y(1:Q:totalSubcarriers) = X;
elseif subcarrierMapping == 'LFDMA'
Y(1:numSymbols) = X;
elseif subcarrierMapping == 'DFDMA'
Y(1:Q_tilda:Q_tilda*numSymbols) = X;
end
% Convert data back to time domain.
y = ifft(Y);
% Perform pulse shaping.
if pulseShaping == 1
% Up-sample the symbols.
y_oversampled(1:Nos:Nos*totalSubcarriers) = y;
% Perform filtering.
y_result = filter(psFilter, 1, y_oversampled);
else
y_result = y;
end
% Calculate the PAPR.
% papr(n) = 10*log10(max(abs(y_result).^2) / mean(abs(y_result).^2));
end

% Plot CCDF.

[N,X] = hist(papr, 100);

semilogy(X,1-cumsum(N)/max(cumsum(N)),'b')

% Save data.

save paprSCFDMA
 
Physics news on Phys.org

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
7
Views
9K
Replies
2
Views
42K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 45 ·
2
Replies
45
Views
7K
  • · Replies 1 ·
Replies
1
Views
9K