ChatGPT, Building Signal Processing Functions in Python

My First Impressions on ChatGPT for Python Coding

Mario Rodriguez
Geek Culture

--

ChatGPT python coding results
Photo by Possessed Photography on Unsplash

ChatGPT is a chatbot developed by OpenAI which has been launch this year and has become quite famous due to its accuracy in several topics, including coding. This article is inspired in previous articles such as this and this, which explain how ChatGPT was used to code in different languages. When I read about it, I also wanted to try it. Therefore, I asked ChatGPT to code in Python a AM modulator, something I have had done before here. You can find a description there a description of this modulation and the Python code.

What I asked ChatGPT

This was my reques to ChatGPT:

  • write a python function to modulate an analog signal in amplitude modulation

And ChatGPT started writing this function:

I copy below the Python function which ChatGPT wrote was:

import numpy as np

def amplitude_modulate(signal, carrier_frequency, modulation_index, sampling_frequency):
"""Amplitude modulate a signal using a carrier frequency and a modulation index…

--

--

Mario Rodriguez
Geek Culture

Communication systems engineer | Python developer | Signal processing | AI | Machine learning | Join me in https://mario-rodriguez.medium.com/membership