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.

How to deduce the sine from N sample

Status
Not open for further replies.

dreamcatch16

Newbie level 4
Newbie level 4
Joined
Jan 23, 2014
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
51
Let's say that I have two sinusoidal signals that I want to deduce their amplitudes and the phase between them, I make N sampling for both signals,
how can I do it? knowing that both signals have the same frequency and we know that frequency.

thank you for your help.
 

Do you use Matlab? If so, consider an approach like this:

Code:
close all; clear all; clc;

% Define sampling times
dt = 0.001;
t = (0:dt:5).';

% Sine frequency
f = 3;

% Amplitudes
A1 = 2.6;
A2 = 0.7;

% Phases
phi1 = 0.4;
phi2 = -0.3;

% Sinusoids
x1 = A1*cos(2*pi*f*t + phi1);
x2 = A2*cos(2*pi*f*t + phi2);

% Estimated amplitudes
A1_est = sqrt(2*mean(x1.^2))
A2_est = sqrt(2*mean(x2.^2))

% Estimated phase difference
phase_diff = acos(x1.'*x2/(norm(x1)*norm(x2)))

I can discuss this approach in more detail, or offer an alternative approach which uses the FFT (Fast Fourier Transform).
 
Last edited:

Thank you for the reply,

Unfortunately I do not use MATLAB, I am going to code with C#,
For the FFT how can I do it?

Thank you for your help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top