Skip to main content

Posts

Search

Search Search Any Topic from Any Website Search
Recent posts

FastAPI Tutorial for Beginners: Build Your First API with CORS and Uvicorn

  FastAPI is amazing! You can create APIs using FastAPI very quickly. With these APIs, you can connect the backend to the frontend. You can access user data through the API and process it on a Uvicorn server.  Here is an example of a FastAPI app you can start with from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware app = FastAPI() # CORS setup app.add_middleware(     CORSMiddleware,     allow_origins=["*"],  # Consider restricting this in production     allow_credentials=True,     allow_methods=["*"],     allow_headers=["*"], ) # Root route @app.get("/") def root():     return {"message": "Welcome to the fastAPI"} How to Run It Go to the project or file directory and run the command: uvicorn main:app --reload Output  You will see output like this at the URL: http://localhost:8000/ In the code, we are using CORS middleware to allow connections between different platforms, such as t...

Computing the FFT in Python

  To analyze the frequency content of a data stream, we use the Fast Fourier Transform (FFT) , which efficiently computes the Discrete Fourier Transform (DFT) . One of the most widely used FFT algorithms is the Cooley–Tukey algorithm , which is a radix-2 divide-and-conquer method . It breaks down a DFT of size N (where N N is a power of 2) into smaller DFTs of size  N /2 , recursively, which reduces computational complexity from  O ( N 2 ) O(N^2)  to O ( N log ⁡ 2 N ) O(N \log_2 N) .   Python Code for FFT  To use this code, you need a sampled signal and the corresponding sampling frequency .     def compute_fft(self, signal):         fft_result = np.fft.fft(signal)         freq = np.fft.fftfreq(len(signal), d=1/self.samplingFrequency)         return np.abs(fft_result), freq     In our case, we will perform the Fast Fourier Transform (FFT) on sine, cosine, rectangula...

How to Find the Fourier Transform of Any Signal

  MATLAB Code This is a simple MATLAB code snippet that computes the Fourier Transform of any signal. I will show you different examples below the main code. Remember, to find the Fourier Transform of any signal using this code snippet, you need a sampled signal and its corresponding sampling frequency . n = length(signal); f = (-n/2:n/2-1)*(fs/n); % Frequency axis centered at 0 S_f = abs(fftshift(fft(signal)/n));  % Normalize FFT S_f_dB = 20*log10(S_f / max(S_f));  % dB scale with normalization Example for finding FFT of a sine wave clc; clear all; close all; fm = 10;      % Message signal frequency (Hz) fs = 1000; % Sampling frequency (100 kHz) t = 0:1/fs:1-1/fs; % Time vector over 1 second signal = sin(2*pi*fm*t); % Compute frequency spectrum in dB n = length(signal); f = (-n/2:n/2-1)*(fs/n); % Frequency axis centered at 0 S_f = abs(fftshift(fft(signal)/n));  % Normalize FFT S_f_dB = 20*log10(S_f / max(S_f));  % dB scale with normalizatio...

Audio Signal Processing with Real-Time Frequency Spectrums

🎙️ Audio Signal Processing with Real-Time Frequency Spectrums This application uses your microphone, and visualizes the frequency spectrum of the audio signal. Center Frequency (Hz): Minimum Frequency (Hz): Maximum Frequency (Hz): Submit If not working try this link  

DSB-SC Modulation and Demodulation

📘 Overview 🧮 DSB-SC Modulator 🧮 DSB-SC Detector 🧮 Comparisons Between DSB-SC and SSB-SC 📚 Further Reading   Double-sideband suppressed-carrier transmission (DSB-SC) is transmission in which frequencies produced by amplitude modulation (AM) are symmetrically spaced above and below the carrier frequency and the carrier level is reduced to the lowest practical level, ideally being completely suppressed. In the DSB-SC modulation, unlike in AM, the wave carrier is not transmitted; thus, much of the power is distributed between the sidebands, which implies an increase of the cover in DSB-SC, compared to AM, for the same power use. DSB-SC transmission is a special case of double-sideband reduced carrier transmission. It is used for radio data systems. This model is frequently used in Amateur radio voice communications, especially on High-Frequency bands.   ...

SSB-SC Modulation and Demodulation

📘 Overview 🧮 SSB-SC Modulator using Hilbert Transform 🧮 Other SSB-SC Modulators 🧮 SSB-SC Detector 📚 Further Reading   As we see in case of DSB-SC only sidebands are transmitted as they bear all informations about the signal. On the other hand, the two sidebands are identical and they carry same information. So, why not just send a single sideband and construct the other sideband from that.     SSB-SC Modulator using Hilbert Transform Single-sideband has the mathematical form of quadrature amplitude modulation (QAM) in the special case where one of the baseband waveforms is derived from the other, instead of being independent messages: S ssb (t) = s(t).cos(2Ï€f 0 t) - (t).sin(2Ï€f 0 t) Where s(t) is the message (real valued), (t) is the Hilbert transform, and f 0 is the radio carrier frequency.   To und...

People are good at skipping over material they already know!

View Related Topics to







Admin & Author: Salim

s

  Website: www.salimwireless.com
  Interests: Signal Processing, Telecommunication, 5G Technology, Present & Future Wireless Technologies, Digital Signal Processing, Computer Networks, Millimeter Wave Band Channel, Web Development
  Seeking an opportunity in the Teaching or Electronics & Telecommunication domains.
  Possess M.Tech in Electronic Communication Systems.


Contact Us

Name

Email *

Message *