Matlab simulink help!

Discussion in 'Programmer's Corner' started by Pika, Nov 19, 2010.

  1. Pika

    Thread Starter New Member

    Jul 27, 2010
    9
    0
    Hi everyone. I'm new to matlab/simulink.
    i'm working on a project at school that involves taking data from an external source at 400 hz, but i'm suppose to output at 1200 hz. I have no idea how to do this. I'm also suppose to have this work real time. Can anyone tell me how i should do this?
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,383
    495
    You have a signal with frequency f=400 Hz.

    You have sampling frequency fs=1200 Hz

    We will assume that your signal is something like this: m(t)=1*cos(2*pi*400*t)

    You need to find sampling period, it is Ts=1/fs

    Then you pick how long your signal is, lets say it is 20 milliseconds.

    So you get this:
    t=0:Ts:0.020;
    m=1*cos(2*pi*400*t);
    plot(t,m)
     
Loading...