plot range of freq on unit circle

조회 수: 6 (최근 30일)
uzmeed
uzmeed 2024년 1월 27일
편집: Vedant Shah 2025년 3월 5일
Hi
I want to plot a range of freq 10 k to 1 M Hz on unit circle
How can I do that
best regards
Uzmeed
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2024년 1월 27일
I am not sure what you want to do but check out the 4th syntax in the description of freqz

댓글을 달려면 로그인하십시오.

답변 (1개)

Vedant Shah
Vedant Shah 2025년 3월 5일
편집: Vedant Shah 2025년 3월 5일
To plot frequencies ranging from 10 kHz to 1 MHz on a unit circle, we can follow the below approach. Assuming the total number of points as 100000, we create a vector of frequencies using the “linspace” function, which allows us to generate evenly spaced points between the specified minimum and maximum frequencies.
Next, we calculate the angular frequency using the formula
Omega = 2*pi*f
where Omega represents the angular frequency. Since we are plotting these frequencies on the unit circle, it is essential to normalize them by dividing by the maximum frequency in our range.
Following this, we compute the complex numbers using Euler's formula,
z = e^{j*theta}
where theta is the normalized angular frequency. These complex numbers represent points on the unit circle.
Finally, we plot these points using “plot” function, allowing to visualize the distribution of frequencies around the unit circle.
Here is an example code snippet for reference:
f_min = 10e3;
f_max = 1e6;
num_points = 100000;
% Vector of frequencies
frequencies = linspace(f_min, f_max, num_points);
% Frequencies mapped to the unit circle
Omega = 2*pi* frequencies;
theta = Omega / f_max; % Normalize with respect to the max frequency
z = exp(1i * theta); % Complex numbers on the unit circle
% Plot the unit circle
figure;
plot(real(z), imag(z), 'b.');
xlabel('Real Part');
ylabel('Imaginary Part');
title('Frequencies on the Unit Circle');
axis equal;
grid on;
Using this code, we get the following unit circle as our output:
For more information you can refer to the following documentations:

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by