Hello,
I would like to change my frequency in k-Wave but ı could not change it by using the below codes. Graphs remain same when I changed the values . How can it be changed? Do you have any suggestions?
Codes that I used
% define properties of the input signal
source_strength = 10e6; % [MPa]
tone_burst_freq = 0.5e6; % [Hz]
tone_burst_cycles = 5000;
kgrid.dt = 1000;
** I tried to change these four values but graph remain same
All my code
clc
clear
% set the size of the perfectly matched layer (PML)
PML_X_SIZE = 10; % [grid points]
PML_Y_SIZE = 10; % [grid points]
PML_Z_SIZE = 10; % [grid points]
% set total number of grid points not including the PML
Nx = 50 - 2*PML_X_SIZE; % [grid points]
Ny = 50 - 2*PML_Y_SIZE; % [grid points]
Nz = 50 - 2*PML_Z_SIZE; % [grid points]
dx = 0.1e-3; % grid point spacing in the x direction [m]
dy = 0.1e-3; % grid point spacing in the y direction [m]
dz = 0.1e-3; % grid point spacing in the z direction [m]
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);
% define the properties of the propagation medium
medium.sound_speed = 1400* ones(Nx, Ny,Nz); % [m/s]
medium.sound_speed(Nx/2:Nx, :,:) = 1600; % [m/s]
medium.density = 1 * ones(Nx, Ny,Nz); % [kg/m^3]
medium.density(Nx/2:Nx, :, :) = 1; % [kg/m^3]
% simulation settings
DATA_CAST = 'single';
disc_magnitude = 10; % [Pa]
disc_x_pos = 20; % [grid points]
disc_y_pos = 3; % [grid points]
disc_z_pos = 2;
disc_radius = 1; % [grid points]
%disc_2 = disc_magnitude * makeDisc(Nx, Ny,Nz ,disc_x_pos, disc_y_pos,disc_z_pos, disc_radius);
% create source mask
source.p_mask = makeBall(Nx, Ny,Nz ,disc_x_pos, disc_y_pos,disc_z_pos, disc_radius);
source.p0 = source.p_mask;
% define properties of the input signal
source_strength = 10e6; % [MPa]
tone_burst_freq = 0.5e6; % [Hz]
tone_burst_cycles = 5000;
kgrid.dt = 1000;
% create the input signal using toneBurst
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);
% create the input signal using toneBurst
%source.p = source_strength .* toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);
% DEFINE THE ULTRASOUND TRANSDUCER
% =========================================================================
% physical properties of the transducer
transducer.number_elements = 3; % total number of transducer elements
transducer.element_width = 1; % width of each element [grid points/voxels]
transducer.element_length = 3; % length of each element [grid points/voxels]
transducer.element_spacing = 1; % spacing (kerf width) between the elements [grid points/voxels]
transducer.radius = inf; % radius of curvature of the transducer [m]
% calculate the width of the transducer in grid points
transducer_width = transducer.number_elements * transducer.element_width ...
+ (transducer.number_elements - 1) * transducer.element_spacing;
% use this to position the transducer in the middle of the computational grid
%transducer.position = round([1, Ny/2 - transducer_width/2, Nz/2 - transducer.element_length/2]);
transducer.position = [0.5,0.5,0.5];
% properties used to derive the beamforming delays
transducer.sound_speed = 100; % sound speed [m/s]
transducer.focus_distance = 25e-3; % focus distance [m]
transducer.elevation_focus_distance = 19e-3; % focus distance in the elevation plane [m]
transducer.steering_angle = 0; % steering angle [degrees]
% apodization
transducer.transmit_apodization = 'Rectangular';
transducer.receive_apodization = 'Rectangular';
% define the transducer elements that are currently active
transducer.active_elements = zeros(transducer.number_elements, 1);
transducer.active_elements(1:3) = 1;
% create the transducer using the defined settings
transducer = kWaveTransducer(kgrid, transducer);
% print out transducer properties
transducer.properties;
transducer.plot;