Write a program which produces a constant-amplitude square wave with a frequency of 440Hz (440 cycles per second).
Using the init function, the output is configured to use signed 16-bit values for the signal, so a value of 0x8000 represents the “bottom” of the signal range, 0x0 represents the “middle” and 0x7FFF is the “top”. The output sample rate (the rate at which these 16-bit values come out) is 48kHz. This is all the info you need to put the right sequence of values in r0 and branch to BSP_AUDIO_OUT_Play_Sample.
All code needs to be written in ARM Assembly.
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
x(k) = 1:0.001:10; x(k)= x(k)'; n = 10; wave = zeros(size(x(k),1),1); for i = 1:2:n wave = wave + cos(2*i*pi*x)/(2*i*pi); end plot(x(k),wave)
3) Code for sampling and gettting the sqaure wave of duty cycle
clc
close all;
clear all;
x=input('amplitude=');
z= input('Frequency= ');
duc=input('Duty Cycle= ');
z=z*2*pi;
t=0:.001:1;
p=x*square(z*t,duc);
plot(t,p);
axis([0 1 -3 3]);
title('Generation of Square Wave of Duty Cycle')
Kindly revert for any queries
Thanks.
Write a program which produces a constant-amplitude square wave with a frequency of 440Hz (440 cy...