Calculating Frequency of an input sine wave.
4 views (last 30 days)
Show older comments
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 :)
0 Comments
Accepted Answer
Image Analyst
on 22 Mar 2014
Edited: Image Analyst
on 22 Mar 2014
4 Comments
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');
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!