How to measure the power of a signal?

Status
Not open for further replies.

keerthna

Member level 1
Joined
Sep 16, 2014
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
251
How do I measure the power of a signal i.e., the instantaneous power and also the voltage and current at any given instant of time? I have to do this in Verilog. Is there any piece of code that I can write?
 

Hi,

Power P = U x I.
To measure intataneous power you need two ADC channels to measure U and I simultaneously.
How to control the ADC is given in their datasheet.
The mathematics U x I should not be the problem.

This result as a single value is not very informative on AC signals.
Here you might use averaging to get the working power.

You don't describe where you see the problem. You don't describe much.

So we don't know waveform, frequency, U range, I range, application, cos-phi, and so on.
Therefore we can't give you detailed assistance.

Klaus
 

I wrote a verilog code to measure the frequency of a signal. Using two counters. And this is how my code looks.


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module scopemeasure(signalin,clk,q,rst,edgedet);
input clk;
input signalin;
input rst;
 
reg [24:0]count1;
reg [24:0]count2;
output edgedet;
reg edgedet;
output [3:0]q;
reg[3:0]q;
reg signald;
reg tempedge;
 
 
reg flag;
 
reg high;
 
initial
begin
 
 
count1=0;
count2=0;
flag=0;
end
 
always@(posedge clk)
begin
if(rst==1)
begin
signald<=1'b0;
count1=0;
tempedge<=signalin&(~signald); 
end
else
begin
count1=count1+1;
high=0;
signald<=signalin;
tempedge<=signalin&(~signald); 
end
 
 
if((count1>=25'b1111101111000101001000000)&&(count1<=25'b1111101111000101100001000))
 
 
begin
count1=0;
high=1;
flag=0;
end
 
 
 
if(tempedge==1)
begin
count2=count2+1;
edgedet<=tempedge;
end
if(high==1)
begin
q[0]=count2[0];  
 q[1]=count2[1];
 q[2]=count2[2];
 q[3]=count2[3];
 
 
count2=0;
end
end
 
endmodule




Now how do I measure the power of the signal?
 
Last edited by a moderator:

I recommend you learn the difference between blocking (=) and non-blocking (<=) assignments.

You are both mixing them in the same procedural always block and you are using blocking in a edge triggered always block.

Have you tried this in a simulator and synthesis tool? Looking over the code you're setting count1 in multiple places, which should end up as a multiple driver problem. You also have the same issue with some of your other signals.
 

Yes I did read the post but i didnt get a clear picture of how do i do it using verilog?

I have simulated and synthesized the tool and my program works perfect. I just need to know the procedure to measure power.
 

I don't see how voltage and current is represented in your design. There should be digitized analog signals.
 

hi friend,
I really think we need a Analog Mixed Signal here. digital design can't not catch any current/voltage to do the power calculation.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…