MATLAB: Sampling

MATLABurgent

I have a composition of 4 sinusoidal tones and would like to sample it at 50kHz. Here is my code:{t1=cos(2*pi*(0:.1:6)); t2=cos(2*pi*2*(0:.1:6)); t3=cos(2*pi*3.5*(0:.1:6)); t4=3*cos(2*pi*20*(linspace(2,2.1,length(t3)))); x=t1+t2+t3+t4;} Can anybody tell me how I can do it?Thanks.

Best Answer

Your data is currently sampled at at 10 Hz. Just redefine your t vector to use steps of 1/5e4. For example:
dt = 1/5e4;
x =cos(2*pi*(0:dt:6));