Digital Signal Processing, DSP

Who can help me ? I have a task.
1. Make a sinusoid. User gives amplitude and frequency (input command). 2. Sampling - two periods (Shannon-Kotelnikov theorem) 3. Quantization with 3-bit converter 4. 8 the least significant bit's - change to HEX and DEC
I tried all last week and nothing. This is all what I did:
clear all
close all
a = input(Amplitude: ');
f = input('Frequency: ');
fp = 100*f;
N = 2*100;
T1 = N/fp;
t1 = (0:N-1)/fp;
s1 = a*sin(2*pi*f*t1);
fp = 2*f
s2 = s1(1:N/fp:end);
t2 = (0:length(s2)-1)/fp;
plot(t1,s1)
hold
stem(t2,s2,'rx')
hold
xlabel('Time [s]')
ylabel('Amplitude')

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with DSP System Toolbox 的更多信息

标签

提问:

Jan
2012-6-1

Community Treasure Hunt

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

Start Hunting!

Translated by