PWPFM

Version 1.0.0 (2.39 KB) by Yajur Kumar
PWPFM Signal Generator with Hysteresis
28 Downloads
Updated 19 Dec 2023

PWPFM Signal Generator with Hysteresis

This repository contains MATLAB scripts for generating a Pulse Width Pulse Frequency Modulation (PWPFM) signal with complex hysteresis. The generatePWPFM function creates a PWPFM signal from a given control signal, incorporating hysteresis thresholds for realistic control behavior. A test script is also provided to demonstrate the usage of this function.

Files

  • generatePWPFM.m: The MATLAB function to generate a PWPFM signal with hysteresis.
  • testPWPFM.m: A test script that demonstrates the function usage and visualizes the output.

Function Usage

generatePWPFM

This function generates a PWPFM signal based on a control signal, taking into account specified hysteresis thresholds. It is useful in simulations where control signals are converted into on/off signals with realistic switching behavior.

Syntax

pwpfm_signal = generatePWPFM(control_signal, sampling_rate, pw_base, pf_base, on_threshold, off_threshold)

Parameters

  • control_signal: The input control signal vector.
  • sampling_rate: The sampling rate in Hz.
  • pw_base: Base pulse width in seconds.
  • pf_base: Base pulse frequency in Hz.
  • on_threshold: Two-element vector [positive_on_threshold, negative_on_threshold].
  • off_threshold: Two-element vector [positive_off_threshold, negative_off_threshold].

Returns

  • pwpfm_signal: The generated PWPFM signal.

Test Script (testPWPFM.m)

The test script testPWPFM.m demonstrates how to use the generatePWPFM function. It generates a control signal, applies the PWPFM function, and plots both the control and the PWPFM signals for visualization.

Running the Test

To run the test script, simply execute testPWPFM.m in MATLAB. The script will generate a control signal, process it through the generatePWPFM function, and plot the results.

License

This project is licensed under the MIT License.

Cite As

Yajur Kumar (2025). PWPFM (https://github.com/YajurKumar/PWPFM), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.