Finding zero crossings
Hello,
I am looking for a VI to find zero crossings of a given vector.
Thanks for your answer.
michael
On 24 May 2000 05:13:31 -0500, "michael leeb"
wrote:
>
>Hello,
>
>I am looking for a VI to find zero crossings of a given vector.
>
>Thanks for your answer.
>
>michael
There is a vi to give you +ive, zero, -ive values so you could run the
values though a while loop and watch for sign changes.
Or just watch the abs value until you come within an acceptable error
range for the value of zero.
These are the two most common methods for a zero crossing and both
easily done in LabView.
Regards
Steve Drake
Similar Messages
-
Hi,
I trimmed an audio regin in the audio track edior with "Snap Edits to Zero Crossings" on.
But I zoom in、the waveform was not ended at Zero point.
Why?
In the audio file editork, "Snap Edits to Zero Crossings" option works fine.correction needs to be made to step #14, I typed:
14) Point to the start or end one of the clips, when you see the icon showing arrows going either way, right click and drag your clips to roughly match up with the timeline selection, then zoom in further and adjust the clip start and end points to match up exactly with the timeline selection start and endpoints.
Here is the correction, THE CORRECTED PARTS ARE CAPITALIZED:
14) Point to the start or end OF one of the clips, when you see the icon showing arrows going either way, LEFT-CLICK and drag your clips to roughly match up with the timeline selection, then zoom in further and adjust the clip start and end points to match up exactly with the timeline selection's start and end points.
Another Correction:
Originally read:
Addendum: IF you have 2 files selected and click "Edit" to go to Edit view, it will give you the file of the clip you selected first, not 2nd. You must then go back to MT view, de-select the clip you selected first, then de-select the clip you want to edit, then RE-select the clip you want to edit.
Here is the the correction, CORRECTED PARTS ARE CAPITALIZED:
Addendum: IF you have 2 files selected and click "Edit" to go to Edit view, it will give you the file of the clip you selected first, not 2nd. IF YOU WANT TO EDIT THE 2ND FILE YOU SELECTED IN MULTI-TRACK VIEW, You must go back to Multi-track view, de-select the clip you selected first, then de-select the clip you want to edit, then RE-select the clip you want to edit, THEN CLICK "EDIT" TO GO TO EDIT VIEW. -
How to finding zero pionts of a waveform?
Hellow,
I am developing a programme, its output values observed from the waveform chart should be a Sinusoidal wave, but the exact function/expression is unknown. I would like to detect the zero point of the output sinusoidal waveform.
thanks a lot!
ps, I developed the programme in the constrol&simulation loop and I tried to extract the tone information like amp &freq from the outout but did not work...
Best regards,
FloydHellow, thanks for your reply!
As to the zero points, I just need two of them. I also noticed there won't be exactly zero and thought abour linear interpolation, but I don't know how to implement it,
There is no noise and just a pure sinusoidal waveform. Actually I would like to extract the frequency and amp info from the waveform, however extract tone information VI seems not working in control and simulation loop. Finding zero points and then calculate the period and finally get frequency is just am alternative.
I attached an example, in which I generated an sine wave with a "sine signal" VI, but in my programme the sinewave is actually unkonwn.
Best Regards,
Floyd
Attachments:
sine wave.vi 151 KB -
After setting zero to on in the Audio sub-menu, I still get pops. In 7 this worked. What is wrong?
ty
KaiserIn a stereo file it never really works flawless, as zero crossings often differ on either side of the file. Here the right side misses the zero crossings at the start and the end of the selection.
-
How to find zeros in a spred sheet file
I have a spread sheet file having 33 column I want to find is there any zero in any of the columns,how this can be done easily.searching one dimensional array is time consuming since file size is very large
thanks for your time
regards
augustin
Certified LabVIEW Associate Developer
Solved!
Go to Solution.johnsold wrote:
If the spreadsheet file is a text file, you could use the string functions to search for the presence of zeros. The details would depend heavily on the format in which the data is saved.
For working with numeric values another caution is in order. In this case it probably would work to use the Is Equal to Zero comparison primitive, but remember that in general equality comparisons on floating point numbers are not a good idea due to the finite representation in binary and roundoff errors after calculations. Adapting Matt Bradley's suggestion you might test whether the absolute value is less than some tolerance, such as 1e-6, rather than zero.
Lynn
Lynn- good point! but use abs val and compare to the machine epsilon (that "little e" constant on the numeric>constants sub-palette is the smallest value that the computer can represent as a dbl)
Jeff -
Hi All
I am New To Oracle And Need Some Help In Writing A Query In SQL.
I Have The Below Tables
SQL> desc sales_invoice;
Name Null? Type
INVOICE_NO NUMBER(3)
INVOICE_DATE DATE
PRODUCT_CODE VARCHAR2(2)
QUANTITY NUMBER(6,3)
RATE NUMBER(6,2)
VALUE NUMBER(10,2)
SALES_TAX_TYPE VARCHAR2(6)
SALES_TAX_AMOUNT NUMBER(10,2)
TOTAL_VALUE NUMBER(10,2)
PLACE VARCHAR2(2)
SQL> select * from sales_invoice;
INVOICE_NO INVOICE_D PR QUANTITY RATE VALUE SALES_ SALES_TAX_AMOUNT TOTAL_VALUE PL
1 02-JUL-04 01 3 15 45 APGST 3.6 48.6 01
2 02-JUL-04 03 1 23 23 CST 2.76 25.76 03
3 03-JUL-04 03 2 21 42 42 02
4 04-JUL-04 02 4 19 76 APGSTG 3.04 79.04 02
5 05-JUL-04 05 5 11 55 CSTC 2.2 57.2 04
6 02-AUG-04 04 1 65 65 APGST 5.2 70.2 01
7 07-AUG-04 03 3 14 42 42 03
5 10-AUG-04 05 -3 11 -33 CSTC -1.32 -34.32 04
8 11-AUG-04 02 4 12 48 CST 5.76 53.76 03
9 19-AUG-04 02 3 17 51 APGSTG 2.04 53.04 02
10 05-SEP-04 01 5 15 75 CST 9 84 03
10 06-SEP-04 01 -5 15 -75 CST -9 -84 03
11 07-SEP-04 03 3 25 75 CST 9 84 04
12 15-SEP-04 05 5 15 75 APGST 4 54 02
13 20-SEP-04 03 3 20 60 APGSTG 2.4 62.4 01
15 rows selected.
SQL> desc product;
Name Null? Type
PRODUCT_CODE VARCHAR2(2)
PRODUCT_NAME VARCHAR2(20)
LIST_PRICE NUMBER(6,2)
COST NUMBER(6,2)
UNIT VARCHAR2(3)
SQL> select * from product;
PR PRODUCT_NAME LIST_PRICE COST UNI
01 TOOTH PASTE 15 14 NO
02 SOAP 20 15 NO
03 SHAMPOO 25 22 NO
04 SUNFLOWER OIL 65 45 KG
05 MINERAL WATER 12 10 LT
SQL> desc place;
Name Null? Type
PLACE VARCHAR2(2)
PLACE_NAME VARCHAR2(20)
SQL> select * from place;
PL PLACE_NAME
01 HYDERABAD
02 SECUNDERABAD
03 BANGLORE
04 CHENNAI
Here I Want To Find Out "Place wise,Productname wise-'zero sales products.
Thanks In Advance
Sasihere is one emp/dept example with partitioned outer join (10g new feature)
All jobs which does not exist in a department (=all department / job which have no employee)
SQL> select job, dept.deptno from emp partition by (job) right outer join dept on (dept.deptno = emp.deptno) where ename is null;
JOB DEPTNO
ANALYST 10
ANALYST 30
ANALYST 40
CLERK 40
MANAGER 40
PRESIDENT 20
PRESIDENT 30
PRESIDENT 40
SALESMAN 10
SALESMAN 20
SALESMAN 40Enjoy your tea :-)
Laurent -
Full-text search in published project finding zero results for multiple-word entries
[RH10, IE10, Windows 7]
I manage a large WebHelp project that has produced correct search results in the past. At some point the search function stopped finding results for entries of more than one word. For example, it won't find any results for "project plan" even though searching for either "project" or "plan" separately will correctly return results including the numerous pages containing either "plan project" or "project plan".
TCS support is having a look at the files. So far we have found that this occurs under Google Chrome as well as IE 10, and also that the same error occurs if we publish to FlashHelp.
BTW, I have another similarly configured project that does not display this error.
I was hoping someone might have encountered this and can suggest a fix.
AlbertiHi Rick,
We do have baggage files of all sorts but in this project they are excluded from search.
At one point in this project Search failed completely; the Search pane came up blank after generating. I was advised by a TCS support person that PDF baggage files (and not just “errant” ones!) will kill the search function (hmmm…) and must be excluded from search (in the WebHelp layout properties). That proved to be right and fixed the problem. Search worked fine for a while until I observed this new thing.To be extra-cautious I have excluded ALL baggage files from Search, at least until we can eliminate whatever this new issue is. -
Cursor finding zero records is not going into an exception - Why?
Hi:
I have a stored procedure I am running that opens and returns a ref cursor but if the cursor doesnt have any records in it, it isnt firing an exception.
Thanks for any help
PROCEDURE GetPaymentHistory
( pi_seq_memb_id IN NUMBER,
out_status OUT NUMBER,
out_message OUT VARCHAR2,
po_curPmtHist OUT P_EBIZ_DIAM_CONN.cursorType)
AS
vsql VARCHAR2(2000);
memb_id NUMBER;
vSpc VARCHAR2(1);
vComma VARCHAR2(1);
vLength NUMBER;
vDescription VARCHAR2(60);
BEGIN
memb_id := pi_seq_memb_id;
vSpc := '';
vComma := ',';
vDescription := '';
vsql := '' || '';
OPEN po_curPmtHist FOR
SELECT
(SELECT DISTINCT BB.BILLING_SCHEDULE_TYPE
FROM HSD_MEMBER_ELIG_HISTORY MEH
INNER JOIN BILLABLE_GROUP_BCONFIG BGB ON BGB.SEQ_GROUP_ID = MEH.SEQ_GROUP_ID
INNER JOIN BILLING_BATCH BB ON BGB.BATCH_ID = BB.BATCH_ID
WHERE MEH.SEQ_MEMB_ID= m.SEQ_MEMB_ID
AND MEH.EFFECTIVE_DATE <= sysdate) AS billFrequency,
i.invoice_id AS InvoiceNumber,
i.INVOICE_DATE AS InvoiceDate,
i.INVOICE_FROM_DATE AS BillFrom,
i.INVOICE_THRU_DATE AS BillTo,
i.REPORTED_INVOICE_BALANCE AS InvoiceAmount,
i.PAYMENT_DUE_DATE AS DueDate,
T.POST_DATETIME AS PaidDate,
T.AMOUNT AS PaidAmount,
i.TOTAL_NEW_CHARGES AS NewCharges,
i.TOTAL_APPLIED_PAYMENTS AS AppliedPayments,
i.TOTAL_APPLIED_ADJUSTMENTS AS AppliedAdjustments,
i.TOTAL_APPLIED_TRANSFERS AS AppliedTransfers,
i.TOTAL_APPLIED_RETRO_TRANS AS AppliedRetroTransactions,
i.CURRENT_INVOICE_BALANCE AS InvoiceBalance,
i.PREVIOUS_ACCOUNT_BALANCE AS PreviousAccountBalance,
i.TOTAL_REPORTED_PAYMENTS AS ReportedPayments,
i.TOTAL_REPORTED_ADJUSTMENTS AS ReportedAdjustments,
i.TOTAL_REPORTED_TRANSFERS AS ReportedTransfers,
i.TOTAL_REPORTED_RETRO_TRANS AS ReportedRetroTransactions,
i.REPORTED_ACCOUNT_BALANCE AS AccountBalance,
F.UNAPPLIED_AMOUNT AS unappTotalCash,
F.POST_DATETIME AS unappPostDate,
F.CREATE_DATETIME AS unappTransDate,
F.FUNDS_TYPE AS unappType,
F.AMOUNT AS unappAmount,
F.DESCRIPTION AS unappDescription
FROM
invoice i
INNER JOIN ar_account a ON i.ar_account_id = a.ar_account_id
INNER JOIN HSD_MEMBER_MASTER m ON a.SEQ_BILL_ENTITY_ID = m.SEQ_FAMILY_ID
LEFT OUTER JOIN AR_TRANSACTION T ON T.APPLIED_INVOICE_ID = i.INVOICE_ID
LEFT OUTER JOIN FUNDS F ON F.funds_id = a.ar_account_id
WHERE
m.seq_memb_id = memb_id AND
a.bill_entity_type='S' ;
--IF po_curPmtHist%ROWCOUNT = 0 THEN
--out_status := -1;
--out_message := 'No record found for Get Payment History';
-- ELSE
out_status := 0;
out_message := 'Get Payment History Success';
--END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
out_status := -1;
out_message := 'No record found for Get Payment History';
WHEN OTHERS THEN
out_status := -1;
out_message := 'Exception occured: Error Number:' || SQLCODE || ' Err Msg:' || SUBSTR(SQLERRM,1,100);
END GetPaymentHistory;I have a stored procedure I am running that opens
s and returns a ref cursor but if the cursor doesnt
have any records in it, This is a fairly common misconception. A cursor is simply a pointer to a compiled or prepared SQL statement with a plan for how to return the data.
Cursors do not contain data. With a ref cursor you are passing a pointer that will allow the caller to fetch the data using the prepared SQL statement.
Re: Regarding the data in a cursor -
Zero crossing, "Triggering" and XY-Graphs
I'm trying to measure the electrical hysteresis of a sample. The way in which I do this is by measuring two voltages within a circuit, sending them to my DAQ, and then plotting them in an XY-Graph to view the shape of the curve. I can somewhat see the hysteresis, but II need to measure the "zero-crossings"; that is to say, the value of one function, when the other is 0, and vice versa. So when V1 = 0, I want to know what V2 is, and when V2 = 0, I want to know what V1 is. Seems simple enough, and I have included my VI.
First I tried the ZeroCrossingPtbyPt, along witha Relay, which never seemed to trigger properly.
Second, I tried using Trigger and Gate, but that seems to give inflated values.
This VI can be tested by removing the DAQ assitant and replacing it with two "Generate Signal"(s), with the same frequency, different amplitudes, and a small phase difference, and this will produce a similar effect without the real signals.
Next, I am sending the raw voltage signals into a Waveform Graph. However, it is impossible to get the traces to stay "still" on the graph. In other words, if this were a real oscilloscope, there would be a "triggering" problem, and if the trigger were set to the proper value, the oscilloscope would be able to track the waveform without it jittering left to right in time. Any ideas on this? I've tried to change just about everything in the Waveform Graph with no difference. Do I need to send in some other signal to get the graph to follow the waveform properly? This is really important because it will tell me if my sample rate is good enough to capture the signal (a sine wave at 1 kHz).
Finally, the hysteresis curve on the XY Graph seems to cover many cycles (periods) of the waveform, but I want it to cover only 1 cycle at a time, so it isn't so sketchy-looking. It's very boxy as well. So in short, the number of points it is plotting is fine, but it is not plotting them quickly enough, since I'd like all of the points it plots to be over a single period of the waveform.
Please help! Thanks in advance.
Attachments:
hysteresis.vi 176 KBAs it turns out, the issue was that I was not collecting enough samples at a high enough sample rate from the DAQ. This is why it worked with "Generate Signals" and did not work with the DAQ Assistant. Because there were not enough samples, the apparent zero crossing was occuring either too early or too late, leading to an incorrect value. Therefore, the best solution when it comes to finding zero crossings is make sure your # of samples, and sample rate are high enough to get an accurate measurement.
As a result, this is why my XY Graph was showing blocky hysteresis loops, rather than nice smooth curve hysteresis loops. The data being sent to it was not quick enough, and therefore the XY- Graph connected the dots between the points that it was sent, yielding a truncated loop, which appeared blocky or sketchy.
On the issue of triggering, this can apparently be set within the DAQ Assistant in the "Triggering" tab; the key is chosing the correct channel to trigger from, and a reasonable trigger level. This was my problem, and this is why my Graph appeared to jitter. It was not the graph itself, but the DAQ Assistant that did not tell it the proper triggering timing.
So, in short, I solved my own problems, but I leave this as a record for those who encounter similar problems in the future.
Thanks. -
Error in NI's 'Threshold 1-D array'?
I was using this VI to find zero crossings and when I use one in my VI it seems to work fine. If I add a second only one of them works. It switches between which one actually works. I looked at the old version of the program that I am rewriting, it was written in LabVIEW 6i, and found a VI someone created that said it fixxed an error in teh Threshold 1-D array. My question is if this was known in 6i why wouldnt it be fixxed by now? Maybe other people havent came across this or I am just wrong. Just curious either way. I will attach the VI that claims to fix this problem
Attachments:
Threshold.vi 27 KBOK, the only known problem for "threshold array" is documented in the online help: "... and it might return incorrect data if threshold y is less than the value at start index". Does this apply to your data?
I don't think it has anything to do with the number of calls on the diagram, but is an inherent limitation. The array must start with values below the desired threshold.
Your "fixed" VI basically searches the array until the data goes from negative to positive, then starts the "threshold array" at the index of the last found negative value, ensuring that the limitation does not apply. For some reason it jumps through quite a few uneccessary hoops doing so. All the stuff with bundling is not needed, it does not make sense. I have included
a cleaned-up version below. See if this works for you. (llb contains both VIs, I also did a few minor changes to the main vi for simplicity).
As a more general comment, I think there might be better ways to determine a phase shift. How does your data typically look like? (e.g. amount of noise, presence of other frequencies, DC offsets, etc. all will cause serious problems with this simplistic approach).
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Not_NotWorking.llb 32 KB -
Sample accurate editing across multiple files
I'm editing a podcast and need to use zero-crossing points to make inaudible edits.
I have two vocal tracks, in sync, and want to be able to select zero-crossings in one and then ripple delete (e.g. to remove a word), applying that same edit to the other track so that everything stays in sync.
Obviously I can do this by selecting both tracks and using the timeslice tool - but that won't find zero crossings. I can find the crossings in the wavefile editor, but I don't know how to copy those edits to more than one track.
I'm sure this is obvious - I feel as if I'm missing something. I need help.Here's just a thought on how I would approach that.
In the multi-track, I'd pan one track hard left and the other hard right, then export as a single stereo track. Then bring that back in as an audio file project, make all the edits you want, save it, then split the stereo track back into two mono tracks at the end of the edit process.
Hope that'll help!
Matt -
Am adquiring continuious sine signals but they dont start at zero, when i insert those signal in Power.vi the numerics array give me diferent values each time, like increment and decrement.
Whatcanidotosolvethis?
Thanks a lot
Esto adquiriendo señales senoidales continuamente, no empiezan de cero, cambian constantemente, cuando insterto estas señales a Power.vi me arrojan valores diferentes cada vez, las cuales se incrementan y decrementan.
Como puedo resolver esto?
Gracias
Attachments:
power.jpg 153 KBHere is a VI which will find and separate one-cycle segments.
I took the Waveform Graph 2 from your VI and converted it to a control to use as a source of data. The VI uses these steps:
- Extract array component from waveform.
- Find zero crossings using Threshold Detector.vi with the threshold set to zero.
- Use a loop with a shift register and Array Subset to break array into segments containing one cycle each.
- Create an array of one-cycle segments. Note that I did not use autoindexing and a 2D array because not all segments have the same length. The array of clusters with an array in each cluster allows the arrays in the clusters to be of different lengths. A 2D array must have all rows the same length.
- Remove the first element in the array of clusters because it represents a segment which will not have a complete cycle unless the acquisition was triggered exactly at the zero crossing.
- Plot a segment of the user's choice to show that one cycle is included.
Lynn
Attachments:
Cycle segments.vi 15 KB -
Query to find all zeroes in table
Need a sql query to just display if Column B contains zeros like (0000,000,00000,00000 etc..)
Version:2005
Table looks like this:
A B
1 0000
2 000
3 000000
4 000011000
5 0000000sh6820090
sSorry for not being clear, I have leading zeroes and i cant use your both queries. Column is alpha numeric, i just need to find Zeroes in the column
excluding Nulls. Following bold values need to be pulled.
A B
1 0000
2 000agsn86755jdd000
3 000sfdbg0001226
4 0000000
5 0000000sh6820090
6 0000dhsg1190000
7 00000
8 NULL
9 00000xb7826000
10 00
11 00828jxjk0000
12 0
13 00sd000877jsnj
s -
Trouble with command delete using Finder
How do I get my Mac to stop going back to the original folder when deleting an item inside the folder? Instead of moving to the next item when I delete something, it goes back to the original folder instead.
When you tell it to look in the right place for the zero, it returns 19.94484, which seems to be about 20.
1. Connecting an indicator to the error output from the Newton Raphson Zero Finder.vi gives -23021: Both function values have the same sign. Automatic error handling does not pick up the errors from VIs which do not have standard error out clusters. This error suggests that the zero is not between the search limits or that there are multiple zeros in that range.
2. The default values of start and end are 0 and 1. Changing end to 100 produced the result above. There appears to another zero at -246 so you cannot make the limits too far apart.
Often it is useful to visualize the data. Plot the data and the results of the formulas on graphs to see what is happening. Using Eval Single-Variable Array.vi I get this:
Note that it shows two zero-crossings.
Although it does not seem to be a problem here, having very large or very small values can lead to numeric overflow, underflow, or roundoff errors. Multiplying your Spectrum array and intial parameters by 1E23 and then later dividing by the same factor (if necessary) might help avoid such problems.
Lynn -
Do you know a VI to detect numerical zeros in a graph?
I need to detect numerical zeros in a graph and I don't know the analytical formula of the function represented on the graph.
If you just want to detect zeros in the array that represents the graph just search the array for zeroes...However if you want to detect zero crossings you can do it as described here:
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000008B2B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=Zero+crossing&USEARCHCONTEXT_QUESTION_S=0
A similar example can be found on:
http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB8F6111EE034080020E74861&p_node=DZ52028&p_submitted=N&p_rank=&p_answer=&p_source=External
Or if it fits you task; use the in-build zero crossing point by point detector that comes with LabVIEW...
If you do it by detecting changes in sign you can interpolate
between the two points to find the exact position of the crossing. Attached is an example that does just that.
MTO
Attachments:
zerocrossing_Interpolated.llb 22 KB
Maybe you are looking for
-
Making Calls From Landline Through My iMac & Macbook Pro
Hi, being able to make and receive calls from my iPhone 4s through my iMac & Macbook Pro is good, but I (and from what I can see, so many others) also want to be able to make and receive calls from my landline through my iMac, Macbook Pro. Why does A
-
Can I watch Blu-ray discs on my Satellite C75-A-13W?
Hi Can I watch BR discs on Satellite C75-A-13W? According Users manuals document I should be able to use BR discs on this machine. Bye Darkwing Message was edited: posting has been translated
-
Unable to Download Flash Version 9
Running Windows XP SP2, all patches up to date. IE version 6. I've been trying to download version 9 and so far have not been successful. After I click the download button, I see the informational message about installing an ActiveX component and I c
-
Edit preference "in app" is not working.
edit preference "inApp" is not working. Somehow it got set to a jpeg file. How can I reset it to "in app" so I can use editing software automatically??
-
Installation hangs at "Configuring devices."
Solaris 10 6/06 Installation hangs at "Configuring devices." stage. I have tried to: 1) boot with "pci-reprog=off" 2) disabled Core Duo in BIOS and with combinations of these. But nothings helps. My system: Intel Core Duo 6400 @2.13GHz, Western Digit