Calculating Frequency of an input sine wave.

4 views (last 30 days)
Hello MALABers :)
please help me how to find the frequency of an input signal which is a sine wave.
some thing like this
y=15sin(2000*pi*t + (3pi/4) );
I wish to use the frquencyt for nyquist theorem.
I will be thankfull to you :)

Accepted Answer

Image Analyst
Image Analyst on 22 Mar 2014
Edited: Image Analyst on 22 Mar 2014
Isn't the frequency 1000? See the first equation in http://en.wikipedia.org/wiki/Sine_wave
  4 Comments
Saad
Saad on 22 Mar 2014
thankyou for the detailed reply, but I am very new to MATLAB, If you could give an example , it would be a great help of yours, :)
Image Analyst
Image Analyst on 22 Mar 2014
Good way to learn. Look up string processing functions like strfind() and strcmpi() and so on. I'm not going to write some program where the rules can be so general that it would take hours to handle all case of user input. Why don't you say that the user needs to use "x" as the variable and needs to use "*" between factors, like sin(2*pi*x). Here's some snippets to get you started
userString(userString == ' ') = ''; % Remove spaces.
leftParenIndex = strfind(userString, '(');
rightParenIndex = strfind(userString, ')');
xIndex = strfind(userString, '*x');

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!