plot range of freq on unit circle
6 次查看(过去 30 天)
显示 更早的评论
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
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
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!