% script for problem 2

close all; clear all; clc;

c = 3e8; % speed of light [m/sec]
fc = 1e9; % [Hz]
r = 1e6; % [bits/sec]

ps = [1000, 200, 0];
pr = [0, 0, 0];
v = [-10, 3, 0];

% project v on (pr-ps), which is the radial speed
vr = v*(pr-ps)'/norm(pr-ps);

nu = vr/c;

% Q1
fd = fc*nu;
fprintf('Doppler frequency fd = %.5f\n',fd)

% Q2
bitRateAtRx = r*(1+nu);
fprintf('bitRateAtRx = %.5f\n',bitRateAtRx)

