Create Arbitrary waveform-values with spreadsheet..... - Page 1
Forum section: electronics / general

author: eTobey
author_rank: Super Contributor
timestamp: October 05, 2024, 11:31:48 am
content: I would like to create a up/down frequency sweep of a 50% PWM signal via spreadsheet for my utg2025A. I already have a python script that converts from csv to bsv. But i cant think of how to acomplish creating these values with a spreadsheet.Is there a spreadsheet expert here?

author: ebastler
author_rank: Super Contributor
timestamp: October 05, 2024, 12:07:17 pm
content: I am not sure I understand what you need. A spreadsheet with a sequence of ascending, then descending numbers, one number per line?

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 05, 2024, 09:09:47 pm
content: One thing I don't get is that if the OP uses Python already, why not generate the waveforms directly in Python instead of doing that in a spreadsheet and converting that with a Python script. A bit boggled.

author: eTobey
author_rank: Super Contributor
timestamp: October 05, 2024, 10:09:21 pm
content: Quote from: SiliconWizard on October 05, 2024, 09:09:47 pmIf you dont get it, ask him, why he wants to use spreadsheets. You could also suggest using Python to him.

author: Someone
author_rank: Super Contributor
timestamp: October 05, 2024, 10:20:58 pm
content: Quote from: eTobey on October 05, 2024, 11:31:48 amQuote from: eTobey on October 05, 2024, 10:09:21 pmSo given the opportunity to answer the question, you ask them to ask the question again?

author: RoGeorge
author_rank: Super Contributor
timestamp: October 06, 2024, 03:12:25 am
content: Hey, eTobey, you seem friends with the OP. I'm curious, too, please ask him why TF it has to be a spreadsheet?But here's how I would do it:- First, you have to have the waveform sampled at the frequency of your PWM.- Then paste (or import) the digitized samples in a spreadsheet column, let's say column A.- Find the minimum and the maximum values of the column A, then in another cell, find the maximum between the abs(max) and abs(min). That would be the scaling factor for 100%- Then prepare a formula in a second column, say column B, with the scaled value + waveform offset (if there is any), such that the resulting number in the column B is the PWM duty factor.The duty factor column would be the one to export to CSV then convert to the format desired by the signal generator. It's a problem of scaling + applying a bias to the ADC samples.Don't know how good are your spreadsheet skills. Does these steps make any sense? Is this what you want?Another thing, the request is unusual. My generator imports waveform samples, not PWM duty factor samples. Is your generator different, or is the PWM request for some other unusual usecase?

author: eTobey
author_rank: Super Contributor
timestamp: October 06, 2024, 06:43:13 am
content: Quote from: Someone on October 05, 2024, 10:20:58 pmWhat question? Apart from the question of ebastler (which i kindly would like to ignore, as it seems he hasnt done much with arb waveforms), i see only mine. I dont bother about the question that one could read between the lines of SiliconWizard's post. The way he wrote, appears a bit disrespectful to me. Like talking behind someones back.Quote from: RoGeorge on October 06, 2024, 03:12:25 amI feel bad for you having taken the time to create an anwser, invane, because my informations were lacking some details: It should be a frequency sweep of a 50% duty PWM signal. My generator only goes oneway.Why i like the spreadsheet:- You can easily add values- You can easly see you changesBTW: I now have implemented such feature in my microcontroller which drives the other one. Problem is, it doesnt have a constant PWM signal.

author: eTobey
author_rank: Super Contributor
timestamp: October 06, 2024, 07:10:12 am
content: I have now tried chatGPT. And i must say i am quite a bit impressed.I does however dont work all the way.

author: ebastler
author_rank: Super Contributor
timestamp: October 06, 2024, 07:23:16 am
content: Quote from: eTobey on October 06, 2024, 07:10:12 amAlso, unlike the humans who are answering to your threads, you will not piss off ChatGPT quite as easily. Win-win!

author: eTobey
author_rank: Super Contributor
timestamp: October 06, 2024, 08:06:58 am
content: Quote from: ebastler on October 06, 2024, 07:23:16 amIndeed! Humans (in general) are way too often easily pissed off. And patience they dont have either. Cant stay focused on topic, do miss/forget important details... the list goes on.

author: nctnico
author_rank: Super Contributor
timestamp: October 06, 2024, 06:32:19 pm
content: Quote from: eTobey on October 05, 2024, 11:31:48 amMost spreadsheets allow creating sequences of numbers. Start with 3 numbers, select them and expand (drag) the column downwards. Still, this could be quite a bit of work if you need long sequences. Another option is to prepare a CSV file through scripting, import it to make edits and export as CSV again.