So i Created an .m file that has a sawtooth signal wave that i am trying to modulate. I have no Problem producing the wave form but when i try to take the .m file and multiply it by "c" MATLAB returns the original waveform. This specific program is using the Double Side Band Modulation Technique. The first piece is my waveform.
function y = Signal
% Signal Summary of this function goes here
n = 23; % Number of Harmonics
t = 0:.0002:n; % incremental value
y = sawtooth(t,.2); % Wave creation
plot(t,y);
ylabel ('Amplitude');
xlabel ('Time');
title('Sawtooth Wave');
end
This next piece is where i am trying to call the .m file, multiply it by 'c' and plot the resulting function.
function [ DSBModulation ] = DSB( DSBModulation )
% Program for DSB-AM
n = 23;
fc = 100;
t = 0:.0002:n;
sig = Signal; % this is how im trying to call the .m file so i can manipulate it
c = cos((2*pi*fc*t)); % using this as the modulating function
u(sig) = (sawtooth(t,.2)).*c; % Multiplying the signal
plot(t,u(sig)); %Displaying the Signal
end