Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab code to calculate sine wave amplitude and frequency

Status
Not open for further replies.

awaili

Newbie level 4
Joined
Apr 18, 2009
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,325
calculate sine wave

Hi everyone
i'm new in matlab programming,... i'm trying to write matlab code mfile. this mfile will be used by s-function block to caculate the amplitude and the fequency of sine wave signal which comes from another block in the simulink..

if you guys have any idea how to do that could you tell me plzzzz...my project time is running out ...
 

how do we calculate amplitude of a sine wave

if you are new to Matlab, then directly jumping to mfile s-functions is not what you should do. If you are good at C or C++ trying making C/C++ S-functions
 

calculating top of sine wave

Thanks for your advice.. but i have to do it using s-function..
i started working on this one but the problem that i'm facing that when i run the program that i created i couldnt determine the zero crossing points which will be used to caculate the frequency..
it seems that the counter of the zero crossing that i put in the program in s-function is working in different way unlike the normal m.file

cause i tryed to generate sin wave using m.file and tryed to catch the crossing points and its ok , but when i tryed to convert this m.file to s-function m.file it didnt work

could u help me to fix this

if u are interested i can send u the s-functiom m.file that i wrote


plzzzzzzzz
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top