필터 지우기
필터 지우기

Is there any Matlab built-in function for 4ASK and 8ASK modulation?

조회 수: 11 (최근 30일)
Faheem Ur Rehman
Faheem Ur Rehman 2021년 6월 3일
댓글: Walter Roberson 2022년 1월 21일
i have found below function but i don't know where to change for 4 and 8Ask.
format long;
% Clear all variables and close all figures
clear all;
close all;
% The number of bits to send - Frame Length
N = 8;
% Generate a random bit stream
bit_stream = round(rand(1,N));
% Enter the two Amplitudes
% Amplitude for 0 bit
A1 = 3;
% Amplitude for 1 bit
A2 = 5;
% Frequency of Modulating Signal
f = 3;
% Sampling rate - This will define the resoultion
fs = 100;
% Time for one bit
t = 0: 1/fs : 1;
% This time variable is just for plot
time = [];
ASK_signal = [];
Digital_signal = [];
for ii = 1: 1: length(bit_stream)
% The FSK Signal
ASK_signal = [ASK_signal (bit_stream(ii)==0)*A1*sin(2*pi*f*t)+...
(bit_stream(ii)==1)*A2*sin(2*pi*f*t)];
% The Original Digital Signal
Digital_signal = [Digital_signal (bit_stream(ii)==0)*...
zeros(1,length(t)) + (bit_stream(ii)==1)*ones(1,length(t))];
time = [time t];
t = t + 1;
end
% Plot the ASK Signal
subplot(2,1,1);
plot(time,ASK_signal,'LineWidth',2);
xlabel('Time (bit period)');
ylabel('Amplitude');
title('ASK Signal with two Amplitudes');
%axis([0 time(end) 1.5 1.5]);
grid on;
% Plot the Original Digital Signal
subplot(2,1,2);
plot(time,Digital_signal,'r','LineWidth',2);
xlabel('Time (bit period)');
ylabel('Amplitude');
title('Original Digital Signal');
axis([0 time(end) -0.5 1.5]);
grid on;

답변 (1개)

Walter Roberson
Walter Roberson 2021년 6월 10일
No, there is no built-in function for that. See however the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/47375-ber-of-m-ask-modulation and use different M= values.
  댓글 수: 16
john karli
john karli 2022년 1월 21일
편집: Walter Roberson 2022년 1월 21일
Hellow Walter
I need your help please.
Can you add the above ASK modulation code in the following function of MATLAB?
Walter Roberson
Walter Roberson 2022년 1월 21일
As I read through the example, it looks to me as if it would be do-able to edit in support for ASK as well.
However, this is not something that I have time to do myself at present.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Code Generation and Deployment에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by